Skip to content

Instantly share code, notes, and snippets.

Houdini /
Created Dec 10, 2015 — forked from quark-zju/
Trace all function calls using gdb
#!/usr/bin/env python
import gdb
inside_gdb = True
except ImportError:
inside_gdb = False
if inside_gdb:
View linked_list.c
#include <sys/queue.h>
#include <stdlib.h>
#include <stdio.h>
struct entry {
SLIST_ENTRY(entry) next;
SLIST_HEAD(top, entry) head;
View ssl_client.scala
object SslClient {
val jks_file_name = ""
// Crypto initializer
val keyManagerFactory = KeyManagerFactory.getInstance("SunX509")
val trustManagerFactory = TrustManagerFactory.getInstance("SunX509")
val keyStore = KeyStore.getInstance("JKS")
val trustKeyStore = KeyStore.getInstance("JKS")
View sbt-web.error.log
houdini@houdini-XPS:~/codes/sbt-web$ sbt
Picked up JAVA_TOOL_OPTIONS: -javaagent:/usr/share/java/jayatanaag.jar
[info] Loading project definition from /home/houdini/codes/sbt-web/project
Missing bintray credentials /home/houdini/.bintray/.credentials. Some bintray features depend on this.
[info] Set current project to sbt-web (in build file:/home/houdini/codes/sbt-web/)
> publishLocal
[warn] Credentials file /home/houdini/.bintray/.credentials does not exist
[info] Main Scala API documentation to /home/houdini/codes/sbt-web/target/scala-2.11/sbt-0.13/api...
[info] Compiling 11 Scala sources to /home/houdini/codes/sbt-web/target/scala-2.11/sbt-0.13/classes...
[info] :: delivering :: com.typesafe.sbt#sbt-web;1.2.1-SNAPSHOT :: 1.2.1-SNAPSHOT :: integration :: Sun May 24 04:03:59 MSK 2015
View output
lua test.lua
lua: test.lua:5: attempt to index a nil value (global 'zstring')
stack traceback:
test.lua:5: in main chunk
[C]: in ?
View mkmf.log
houdini@houdini-bizon:~/.rvm/gems/ruby-2.1.5/extensions/x86_64-linux/2.1.0/pg-0.17.1$ cat mkmf.log
find_header: checking for libpq-fe.h... -------------------- yes
"gcc -o conftest -I/home/houdini/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0/x86_64-linux -I/home/houdini/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0/ruby/backward -I/home/houdini/.rvm/rubies/ruby-2.1.5/include/ruby-2.1.0 -I. -I/usr/local/pgsql/include -O3 -fno-fast-math -ggdb3 -Wall -Wextra -Wno-unused-parameter -Wno-parentheses -Wno-long-long -Wno-missing-field-initializers -Wunused-variable -Wpointer-arith -Wwrite-strings -Wdeclaration-after-statement -Wimplicit-function-declaration -fPIC conftest.c -L. -L/home/houdini/.rvm/rubies/ruby-2.1.5/lib -Wl,-R/home/houdini/.rvm/rubies/ruby-2.1.5/lib -L/usr/local/pgsql/lib -Wl,-R/usr/local/pgsql/lib -L. -fstack-protector -rdynamic -Wl,-export-dynamic -Wl,-rpath,'/../lib' -Wl,-R -Wl,'/../lib' -L'/../lib' -lruby -lpthread -ldl -lcrypt -lm -lc"
checked program was:
/* begin */
1: #include "ruby.h
View oversun Moscow
houdini: /mili/mili2 > traceroute
traceroute to (, 64 hops max, 52 byte packets
1 ( 14.121 ms 2.905 ms 3.370 ms
2 ( 2.475 ms 2.537 ms 5.381 ms
3 ( 4.971 ms 2.357 ms 5.912 ms
4 ( 20.584 ms 4.797 ms 10.359 ms
5 ( 4.839 ms 3.624 ms 5.660 ms
6 ( 4.418 ms 2.287 ms 2.091 ms
7 ( 13.067 ms 7.357 ms 4.110 ms
8 ( 6.100 ms 4.308 ms 7.592 ms
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 test.rb
class A
@@dir_name = nil
def self.dir_name
class B < A
@@dir_name = "B"
View 1.sql
"Limit (cost=7462.23..7462.26 rows=10 width=404) (actual time=174.219..174.221 rows=10 loops=1)"
" -> Sort (cost=7462.23..7588.10 rows=50345 width=404) (actual time=174.218..174.219 rows=10 loops=1)"
" Sort Key: (count(loans.*))"
" Sort Method: top-N heapsort Memory: 27kB"
" -> GroupAggregate (cost=0.00..6374.30 rows=50345 width=404) (actual time=0.036..153.099 rows=50285 loops=1)"
" -> Merge Left Join (cost=0.00..5610.68 rows=52033 width=404) (actual time=0.019..106.530 rows=52034 loops=1)"
" Merge Cond: ( = loans.user_id)"
" -> Index Scan using users_pkey on users (cost=0.00..2486.07 rows=50345 width=97) (actual time=0.008..26.936 rows=50285 loops=1)"
" -> Index Scan using index_loans_on_user_id on loans (cost=0.00..2348.34 rows=52033 width=311) (actual time=0.007..30.102 rows=52034 loops=1)"
"Total runtime: 174.269 ms"