Skip to content

Instantly share code, notes, and snippets.

View errord's full-sized avatar
🎯
Focusing

error.d errord

🎯
Focusing
View GitHub Profile
@errord
errord / gist:7ff55e71b48fcd525ccb
Created August 18, 2014 07:43
linear regression with pylab
http://www.wired.com/2011/01/linear-regression-with-pylab/
@errord
errord / gist:f766cbf401e760e7ea44
Created August 18, 2014 05:49
linxu下使用xvfb虚拟设备进行截图
这2种方法经测试都已经通过。
服务器版本是:ceontos5.4 64位系统。
一、Xvfb + html2image
yum install Xvfb
yum install xorg-x11-fonts*
wget http://www.ys250.com/src/html2image.x86_64.tar.gz
#wget http://www.ys250.com/src/html2image.i386.tar.gz
mv html2image /usr/local/
xvfb 这个工具相当于一个wrapper, 给应用程序提供虚拟的 X server
@errord
errord / gist:fb50defb574c13b810ef
Created June 7, 2014 01:45
scala-development-environment-emacs-sbt-ensime
http://jawher.net/2011/01/17/scala-development-environment-emacs-sbt-ensime/
@errord
errord / gist:fdbd07f5464580e6797b
Created June 6, 2014 03:07
使用auto-complete-mode
使用auto-complete-mode
1 下载auto-complete完整源码
大多数情况下,我还是推荐使用源码库中的最新版本,这样可以避免很多奇怪的问题。所以这里列出了使用auto-complete-mode所涉及的一些源码库:
auto-complete-mode 主源码库
https://github.com/m2ym/auto-complete.git
popup功能库
https://github.com/m2ym/popup-el.git
使用fuzzy模式匹配
https://github.com/m2ym/fuzzy-el.git
增强列表模式
1. git颜色配置
git config --global color.diff auto
git config --global color.status auto
git config --global color.branch auto
2. git默认编辑器设置
@errord
errord / gist:cf14660541113ba9c2b3
Last active August 29, 2015 14:01
innodb check data file
5 in fil_check_first_page of /home/errord/opensource/mysql-5.6.17/storage/innobase/fil/fil0fil.cc:1989
=> in fil_read_first_page of /home/errord/opensource/mysql-5.6.17/storage/innobase/fil/fil0fil.cc:2065
7 in open_or_create_data_files of /home/errord/opensource/mysql-5.6.17/storage/innobase/srv/srv0start.cc:1003
6 in innobase_start_or_create_for_mysql of /home/errord/opensource/mysql-5.6.17/storage/innobase/srv/srv0start.cc:2051
9 in innobase_init of /home/errord/opensource/mysql-5.6.17/storage/innobase/handler/ha_innodb.cc:3267
10 in ha_initialize_handlerton of /home/errord/opensource/mysql-5.6.17/sql/handler.cc:662
11 in plugin_initialize of /home/errord/opensource/mysql-5.6.17/sql/sql_plugin.cc:1126
12 in plugin_init of /home/errord/opensource/mysql-5.6.17/sql/sql_plugin.cc:1417
13 in init_server_components of /home/errord/opensource/mysql-5.6.17/sql/mysqld.cc:4832
14 in mysqld_main of /home/errord/opensource/mysql-5.6.17/sql/mysqld.cc:5429
@errord
errord / gist:99da00123f573c5c9f83
Created May 22, 2014 09:09
有几个和MySQL(尤其是InnoDB引擎)数据表设计相关的建议,希望开发者朋友能遵循
有几个和MySQL(尤其是InnoDB引擎)数据表设计相关的建议,希望开发者朋友能遵循:
a) 所有InnoDB数据表都创建一个和业务无关的自增数字型作为主键,对保证性能很有帮助;
b) 杜绝使用text/blob,确实需要使用的,尽可能拆分出去成一个独立的表;
c) 时间戳建议使用 TIMESTAMP 类型存储;
d) IPV4 地址建议用 INT UNSIGNED 类型存储;
e) 性别等非是即非的逻辑,建议采用 TINYINT 存储,而不是 CHAR(1);
f) 存储较长文本内容时,建议采用JSON/BSON格式存储;
@errord
errord / gist:623ebb7e60a213881aa7
Created May 21, 2014 06:11
build mysql debug version
cmake -DCMAKE_INSTALL_PREFIX=/home/errord/mysql_debug -DMYSQL_DATADIR=/home/errord/mysql_debug/data/mysql/ -DSYSCONFDIR=/home/errord/mysql_debug/etc -DWITH_DEBUG=1 ../
@errord
errord / gist:7926810
Created December 12, 2013 11:45
python crypto AES
# -*- coding: utf-8 -*-
from Crypto.Cipher import AES
import os
BS = AES.block_size
pad = lambda s: s + (BS - len(s) % BS) * chr(BS - len(s) % BS)
unpad = lambda s : s[0:-ord(s[-1])]
key = os.urandom(16) # the length can be (16, 24, 32)
text = 'to be encrypted'