Skip to content

Instantly share code, notes, and snippets.

@Honghe
Honghe / limit_tx.sh
Last active November 22, 2017 02:33
Linux limit TX(output transmit) of some Port on the specified Interface. Use tc and iptables.
#!/bin/bash
#
# limite net output rate
#
# 2014.09.25
# with kernel 2.6, netem was added to kernel,
# so it is easier to use it with tc instead of the following way.
# if su
@Honghe
Honghe / pandas.ipynb
Created November 24, 2013 13:02
test
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
#!/usr/bin/env python
"""
Interactive execution with automatic history, tries to mimic Mathematica's
prompt system. This environment's main features are:
- Numbered prompts (In/Out) similar to Mathematica. Only actions that produce
output (NOT assingments, for example) affect the counter and cache.
- The following GLOBAL variables always exist (so don't overwrite them!):
_p: stores previous result which generated printable output.
@Honghe
Honghe / barman_back
Created March 23, 2015 03:17
barman_postgres_backup_info
barman show-backup wifi 20150320T020002
Backup 20150320T020002:
Server Name : wifi
Status : DONE
PostgreSQL Version : 80413
PGDATA directory : /var/lib/pgsql/data
Base backup information:
Disk usage : 6.6 GiB (6.6 GiB with WALs)
Incremental size : 6.5 GiB (-1.48%)
@Honghe
Honghe / BeginningOpenGl.md
Created September 30, 2016 06:19
OpenGL Startup

The Travel Guide to OpenGL

This is a pain in my side.

I've figured out several things while trying to extend my knowledge of Computer Graphics.

  1. OpenGL is a bitch.
  2. There is no worse pain than to experience CMake without knowing what you're doing.
  3. When walking to the depths of hell, it would be nice to have a travel guide.
@Honghe
Honghe / gist:c5df625176854aada16bc3ad98f685ae
Created February 16, 2017 14:21
Ubuntu 14.04.5 Memory corruption detected in low memory
[ 0.000000] Initializing cgroup subsys cpuset
[ 0.000000] Initializing cgroup subsys cpu
[ 0.000000] Initializing cgroup subsys cpuacct
[ 0.000000] Linux version 4.4.0-62-generic (buildd@lcy01-33) (gcc version 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04.3) ) #83~14.04.1-Ubuntu SMP Wed Jan 18 18:10:30 UTC 2017 (Ubuntu 4.4.0-62.83~14.04.1-generic 4.4.40)
[ 0.000000] Command line: BOOT_IMAGE=/boot/vmlinuz-4.4.0-62-generic root=UUID=615f68de-5f7c-4b3a-8dc5-891f9b1dd651 ro quiet splash vt.handoff=7
[ 0.000000] KERNEL supported cpus:
[ 0.000000] Intel GenuineIntel
[ 0.000000] AMD AuthenticAMD
[ 0.000000] Centaur CentaurHauls
[ 0.000000] x86/fpu: xstate_offset[2]: 576, xstate_sizes[2]: 256
@Honghe
Honghe / delete_cloudinit.yml
Created May 2, 2018 06:52
delete cloudinit function of reseting hostname on reboot
---
- name: delete cloud-init
hosts: cdh
remote_user: root
tasks:
- shell: |
sed -i '/- set_hostname/d' /etc/cloud/cloud.cfg
sed -i '/- update_hostname/d' /etc/cloud/cloud.cfg
sed -i '/- update_etc_hosts/d' /etc/cloud/cloud.cfg
@Honghe
Honghe / translateByGoogle.py
Last active May 8, 2018 08:20
Use Google web Translate in Python2
#/usr/bin/env python
#coding=utf8
import httplib
import md5
import urllib
import urllib2
import HTMLParser
import random
@Honghe
Honghe / npm.taobao.sh
Created June 8, 2018 13:22 — forked from 52cik/npm.taobao.sh
npm 淘宝镜像配置
npm set registry https://registry.npm.taobao.org # 注册模块镜像
npm set disturl https://npm.taobao.org/dist # node-gyp 编译依赖的 node 源码镜像
## 以下选择添加
npm set sass_binary_site https://npm.taobao.org/mirrors/node-sass # node-sass 二进制包镜像
npm set electron_mirror https://npm.taobao.org/mirrors/electron/ # electron 二进制包镜像
npm set puppeteer_download_host https://npm.taobao.org/mirrors # puppeteer 二进制包镜像
npm set chromedriver_cdnurl https://npm.taobao.org/mirrors/chromedriver # chromedriver 二进制包镜像
npm set operadriver_cdnurl https://npm.taobao.org/mirrors/operadriver # operadriver 二进制包镜像
npm set phantomjs_cdnurl https://npm.taobao.org/mirrors/phantomjs # phantomjs 二进制包镜像
@Honghe
Honghe / .vimrc
Created June 8, 2018 13:40
.vim config use vundle
set nocompatible " be iMproved, required
filetype off " required
" set the runtime path to include Vundle and initialize
set rtp+=~/.vim/bundle/Vundle.vim
set runtimepath^=~/.vim/bundle/ctrlp.vim
" TUI 颜色设置
" set termguicolors
" TUI 颜色设置,不然 vim-airline等着色不对
"set t_Co=256