Skip to content

Instantly share code, notes, and snippets.

Alfred Zhou adaiguoguo

Block or report user

Report or block adaiguoguo

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@adaiguoguo
adaiguoguo / lvmdisk.sh
Last active Aug 29, 2015
lvm 分区 需默认安装lvm2 /srv 10g /home 10g /data 10g
View lvmdisk.sh
umount /dev/vdb1 /data
fdisk -c -u /dev/vdb <<EOF
D
w
EOF
sleep 1s
fdisk -c -u /dev/vdb <<EOF
n
p
1
@adaiguoguo
adaiguoguo / 0_reuse_code.js
Last active Aug 29, 2015
Here are some things you can do with Gists in GistBox.
View 0_reuse_code.js
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
View Gerrit-Jenkins-Sonar
reponame = os.environ['GERRIT_PROJECT']
repo = reponame.replace('/','-')
print repo
file=open('sonar-project.properties','w')
s='''sonar.projectKey='''+repo+'''\nsonar.projectName='''+repo+'''\nsonar.projectVersion=1.0\nsonar.sources=.\nsonar.sourceEncoding=UTF-8'''
file.write(s)
file.close()
@adaiguoguo
adaiguoguo / _.md
Last active Aug 29, 2015 — forked from klange/_.md
View _.md

Since this is on Hacker News and reddit...

  • No, I don't distribute my résumé like this. A friend of mine made a joke about me being the kind of person who would do this, so I did (the link on that page was added later). My actual résumé is written in BSD mandoc.
  • I apologize for the use of _t in my types. I spend a lot of time at a level where I can do that; "reserved for system libraries? I am the system libraries".
  • Since people kept complaining, I've fixed the assignments of string literals to non-const char *s.
  • My use of type * name, however, is entirely intentional.
  • If you're using an older compiler, you might have trouble with the anonymous unions and the designated initializers - I think gcc 4.4 requires some extra braces to get them working together. Anything reasonably recent should work fine. Clang and gcc (newer than 4.4, at
@adaiguoguo
adaiguoguo / close_fds
Last active Aug 29, 2015
don't close_fds on Windows
View close_fds
return Popen([sys.executable, '-c', cmd, '--existing', cf] + argv,
- stdout=PIPE, stderr=PIPE, close_fds=True,
+ stdout=PIPE, stderr=PIPE, close_fds=(sys.platform != 'win32'),
)
You can’t perform that action at this time.