Skip to content

Instantly share code, notes, and snippets.

@Houdini
Houdini / gdb-trace.py
Created Dec 10, 2015 — forked from quark-zju/gdb-trace.py
Trace all function calls using gdb
View gdb-trace.py
#!/usr/bin/env python
try:
import gdb
inside_gdb = True
except ImportError:
inside_gdb = False
if inside_gdb:
View vimrc
" Auto save when focus lost and ignore warnings from untitled buffers
:au FocusLost * silent! :wa
" Save on buffer switch
:set autowriteall
set runtimepath+=~/.vim/vim-objj
au BufNewFile,BufRead *.j,Jakefile setf objj
" au! BufRead,BufNewFile *.json set filetype=json
autocmd BufNewFile,BufRead *.json set ft=javascript
autocmd BufNewFile,BufRead *.prawn set ft=ruby
au BufRead,BufNewFile /opt/nginx/conf/* set ft=nginx
@Houdini
Houdini / autobench_plot.py
Created Aug 31, 2011
python autobench grapher
View autobench_plot.py
from optparse import OptionParser
import sys
from pylab import *
parser = OptionParser()
parser.add_option('-f', '--file', dest = "filenames", help = "files devided by comma")
parser.add_option("-l", "--legend", dest = "legend", help = "legend for plots")
(options, args) = parser.parse_args()
View .vimrc
" Auto save when focus lost and ignore warnings from untitled buffers
:au FocusLost * silent! :wa
" Save on buffer switch
:set autowriteall
set runtimepath+=~/.vim/vim-objj
au BufNewFile,BufRead *.j,Jakefile setf objj
" au! BufRead,BufNewFile *.json set filetype=json
autocmd BufNewFile,BufRead *.json set ft=javascript
autocmd BufNewFile,BufRead *.prawn set ft=ruby
au BufRead,BufNewFile /opt/nginx/conf/* set ft=nginx
View gbrt
#!/usr/bin/env ruby
def format_commit_info timestamp, time_desc, commit_id, message, ref_name
[
"#{timestamp.strftime("%y %b %d")}, #{timestamp.strftime("%l:%M%p").downcase}",
"(#{time_desc})",
commit_id,
message,
ref_name
]
View .vimrc
source ~/.vim/vimrc
" Auto save when focus lost and ignore warnings from untitled buffers
:au FocusLost * silent! :wa
" Save on buffer switch
:set autowriteall
set runtimepath+=~/.vim/vim-objj
au BufNewFile,BufRead *.j,Jakefile setf objj
" au! BufRead,BufNewFile *.json set filetype=json
autocmd BufNewFile,BufRead *.json set ft=javascript
autocmd BufNewFile,BufRead *.prawn set ft=ruby
View gist:6293870
* (1)
* hello.mixal: say 'hello world' in MIXAL (2)
* (3)
* label ins operand comment (4)
TERM EQU 19 the MIX console device number (5)
ORIG 1000 start address (6)
START OUT MSG(TERM) output data at address MSG (7)
HLT halt execution (8)
MSG ALF "MIXAL" (9)
ALF " HELL" (10)
View run_chef_test.sh
ubuntu@ip-10-0-1-86:/usr/lib/ssl/certs$ sudo chef-server-ctl test
Configuring logging...
Creating platform...
Starting Pedant Run: 2013-06-26 15:24:19 UTC
setting up rspec config for #<Pedant::OpenSourcePlatform:0x000000036b5820>
Configuring RSpec for Open-Source Tests
_______ _______ _______ _______ _______ ______ _______
| || || || || || | | |
| _ || _ || _____|| || _ || _ || ___|
| | | || |_| || |_____ | || | | || | | || |___
View gist:4174544
10.0.1.94 deploy_revision("/mili/cryptopro_proxy") do
10.0.1.94 provider Chef::Provider::Deploy::Revision
10.0.1.94 action [:force_deploy]
10.0.1.94 updated true
10.0.1.94 supports {:restart=>true}
10.0.1.94 retries 0
10.0.1.94 retry_delay 2
10.0.1.94 deploy_to "/mili/cryptopro_proxy"
10.0.1.94 environment {"RAILS_ENV"=>"production", "LC_ALL"=>"C"}
10.0.1.94 repository_cache "cached-copy"
View gist:4068397
#!/bin/bash
function check_fail(){
if test $1 -ne 0; then
echo " Installation failed. LSB package may not be installed.
Install LSB package and reinstall CryptoPro CSP. If it does not help, please
read installation documentation or contact the manufacturer: support@cryptopro.ru."
exit $1
fi
}