Skip to content

Instantly share code, notes, and snippets.

View duobei's full-sized avatar
🐳
dingdong

Luca Zhang duobei

🐳
dingdong
View GitHub Profile
# Add the package repositories
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
@duobei
duobei / README.md
Created August 31, 2020 03:48 — forked from chuyik/README.md
macOS 给 Git(Github) 设置代理(HTTP/SSH)

Keybase proof

I hereby claim:

  • I am duobei on github.
  • I am duobei (https://keybase.io/duobei) on keybase.
  • I have a public key whose fingerprint is 3A54 C8B2 58B3 D2DC BA4A 368E 2366 BF91 E0A1 8268

To claim this, I am signing this object:

from sre_parse import Pattern, SubPattern, parse as sre_parse
from sre_compile import compile as sre_compile
from sre_constants import BRANCH, SUBPATTERN
class Scanner(object):
def __init__(self, tokens, flags=0):
subpatterns = []
pat = Pattern()

Ultimate OpenStack IceHouse Guide

This is a Quick Guide to deploy OpenStack IceHouse on top of Ubuntu 14.04, it is IPv6-Ready!

It is compliant with OpenStack's official documentation (docs.openstack.org).

The tenant's subnets are based on Neutron, with ML2 plugin and Single Flat Network topology, dual-stacked.

The Single Flat Network is the simplest network topology supported by OpenStack (I think). So, it is easier to understand and follow.

@duobei
duobei / jquery-ajax.md
Last active December 10, 2015 18:18
jquery-ajax 使用方法

jQuery.post(url, [data], [callback], [type])

概述

  • 通过远程 HTTP POST 请求载入信息。

  • 这是一个简单的 POST 请求功能以取代复杂 $.ajax 。 请求成功时可调用回调函数。 如果需要在出错时执行函数,请使用 $.ajax。

@duobei
duobei / dump.js
Last active December 10, 2015 16:59
查看 Javascript 对象内容
// from http://www.nowamagic.net/librarys/veda/detail/802
// 简单版
function dump_obj(aObject) {
var s = "";
for (var property in aObject) {
s = s + "\n " + property + ": " + aObject[property];
}
alert(s);
}
@duobei
duobei / shell_tips.md
Created November 21, 2012 08:34 — forked from flaneur2020/shell_tips.md
shell tips
  • gcc -M hello.c 可以得到某文件依赖的头文件。

  • grep processor /proc/cpu_info 显示当前的CPU数目

  • sudo shutdown -r now 重启机器

  • sshfs yourname@host:/path/to/your/dir ~/local sshfs挂载到本地

  • sudo -u fleuria bash: 切换用户

@duobei
duobei / cmd.sh
Created November 14, 2012 09:35
神奇的命令行
python -m SimpleHTTPServer 8000
ROOT_PATH = os.path.dirname(os.path.abspath(__file__))
if ROOT_PATH not in sys.path:
sys.path.append(ROOT_PATH)
sys.path.insert(0,ROOT_PATH);