This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
> rvm use 1.9.2-p290@mall --create | |
Database file /home/rebx/.rvm/user/db does not exist. | |
> __rvm_db | |
bash: /db: No such file or directory | |
> echo $rvm_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
live: | |
tshark -i eth0 -aduration:60 -d tcp.port==3306,mysql -T fields -e mysql.query 'port 3306' | |
capture: | |
tcpdump -i eth0 port 3306 -s 1500 -w tcpdump.out | |
tshark -r tcpdump.out -d tcp.port==3306,mysql -T fields -e mysql.query > query_log.out |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cat voidsize.c | |
#include <stdio.h> | |
int main(void) { | |
printf("void size: %d\n", sizeof(void)); | |
return 0; | |
} | |
$ make voidsize | |
cc voidsize.c -o voidsize | |
voidsize.c: In function ‘main’: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ echo $rvm_usr_path | |
/some/path/to/rvm/usr | |
$ rvm remove 1.9.3 | |
Removing /some/path/to/rvm/src/ruby-1.9.3-p0... | |
Removing /some/path/to/rvm/rubies/ruby-1.9.3-p0... | |
Removing ruby-1.9.3-p0 aliases... | |
Removing ruby-1.9.3-p0 wrappers... | |
Removing ruby-1.9.3-p0 environments... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env perl -w | |
# rebx | |
use strict; | |
my $mod = shift(@ARGV); | |
my @customperl = qw(/path/to/perl); | |
push (@INC, @customperl); | |
(!defined($mod)) && exit 1; | |
unless ( eval "require $mod;1") { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
def merge_sort(list_struct=[]): | |
""" | |
merge_sort | |
as if there's not enough merge sorts in python out there | |
""" | |
list_len = len(list_struct) | |
if list_len <= 1: | |
return list_struct | |
mid = list_len / 2 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
dir=$1 | |
if [ -z "$dir" -a "${dir+oinothir}" = "oinothir" ]; then | |
dir=$PWD | |
fi | |
ack -h --output='$1' '^\s*sub\s+(\w+)\b' $dir \ | |
| sort -u \ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# size of array | |
sub foo { return qw(foo bar baz);} | |
$size = () = foo(); | |
# or just use int. scalar works as well, but int is more "intuitive" than scalar to me | |
$size = int (@array); | |
# interleave array | |
sub interleave { | |
my %interleaved; | |
@interleaved{ @{$_[0]} } = @{$_[1]}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# make a list into hash keys | |
list = %w{foo bar baz} | |
s ||= {} | |
list.each {|key| s[key.to_sym] = 1} | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# -*- encoding: utf-8 -*- | |
# | |
# taken from perl | |
# my bad perl habits aren't so easy to stomp out...tsk, tsk... | |
# | |
module File::Which | |
# | |
# Returns the full path to the executable |
OlderNewer