AireadFan's

   Fragments of memories

Using Git Through a SOCKS Proxy (or SSH Tunnel)

| Comments

Git supports two protocols: HTTP and native git (git://). Unfortunately, git over HTTP is terribly slow. As a result, most public repositories don’t prominently display an HTTP URL, because most people would prefer the git:// URL.

In a corporate environment, one does not commonly have the ability to open arbitrary ports on the outside internet. In that case, the git:// protocol is effectively unusable without an unrestricted SOCKS proxy.

To work around the problem, I create my own SOCKS proxy via SSH, then use a wrapper script with git. In essence, this allows me to use git through an SSH tunnel. Any repository, anywhere: one tunnel.

程序员:增加编程经验的3种途径

| Comments

最近,有位论坛会员陷入了一个与许多入门级程序员相同的尴尬局面中:企业们不喜欢雇佣没有经验的人,并且多数都不愿意提供培训。如果那么多的企业都不雇佣没有经验的人,那么这些人要从哪寻得他们所需的经验呢?不幸的是,这种局面是大多数IT人士所面临的主要问题。

通过与这位会员长期的交流与反复的讨论,就加快他的职业生涯发展,除了给他《开始编程生涯的5个建议》之外,我另外还提出了三条建议,以助他积累增加编程经验。

微软老将Philip Su的离职信:回首12年职场生涯的心得和随笔

| Comments

编者注:Philip Su在1998年加入微软,开始时是一位软件工程师。12年后,Philip Su从微软辞职,当时是微软的主群经理(Principal Group Manager),又一次以一位普通软件工程师的身份加入Facebook。Philip Su现任Facebook 伦敦办公室的主管。Philip Su在当时的离职信中写了他在微软工作12年比较独到的一些体会,希望对在职场的读者们有一些启发。这封离职信写于2010年9月3日。

过去的 12 年里,我一直很喜欢在微软工作,但是今天是我在微软的最后一天。

我一直是一个比较随意的人,所以我希望今天的信也一样是有个性的、有争议的、乐观的、凭感觉的,而可能没有让人读后很满意的答案。

请不要在我的信里找连贯性,因为你是不会找到的。如果有内容冒犯了你,那你可能不太了解我,因为我经常会在无意中冒犯到别人,几乎已经成为了定律。

谢谢所有的一切。

/etc/network/interfaces Ubuntu Linux Networking Example

| Comments

Q. Can you explain how to setup network parameters such as IP address, subnet, dhcp etc using /etc/network/interfaces file?

A. /etc/network/interfaces file contains network interface configuration information for the both Ubuntu and Debian Linux. This is where you configure how your system is connected to the network.

R Lang: Introduction of Data Frame and Data Import

| Comments

In this post, we will introduct the operations of data frame, how to import data from external file. In addition there is a unusual example about importing data. Just for fun!

Data Frames in R

Technically, a dataframe is R is a type of object. Less formally, a dataframe is a type of table where the typical use employs the rows as observations and the columns as variables. At first, We use R’s data.frame command to create a dataframe and stored the result in the variable village.

Shell Script Construct String to Variable Name

| Comments

This post shows how to access shell variable via a name, which created by a string. Ok, let’s see the code straight:

1
2
3
4
5
6
7
8
9
10
11
#!/bin/bash

a1=10
a2=20
a3=30

for i in `seq 3`
do
        name=a$i
        echo ${!name}
done

The script will print:

10
20
30

Note the echo ${!vname}. if it change to echo ${name} and will just print:

a1
a2
a3

That’s the difference. The `!’ construct string to variable name.

What Is Rcu, Fundamentally?

| Comments

Introduction

Read-copy update (RCU) is a synchronization mechanism that was added to the Linux kernel in October of 2002. RCU achieves scalability improvements by allowing reads to occur concurrently with updates. In contrast with conventional locking primitives that ensure mutual exclusion among concurrent threads regardless of whether they be readers or updaters, or with reader-writer locks that allow concurrent reads but not in the presence of updates, RCU supports concurrency between a single updater and multiple readers. RCU ensures that reads are coherent by maintaining multiple versions of objects and ensuring that they are not freed up until all pre-existing read-side critical sections complete. RCU defines and uses efficient and scalable mechanisms for publishing and reading new versions of an object, and also for deferring the collection of old versions. These mechanisms distribute the work among read and update paths in such a way as to make read paths extremely fast. In some cases (non-preemptable kernels), RCU’s read-side primitives have zero overhead.