This file contains hidden or 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
RUBY_CONFIGURE_OPTS=--with-readline-dir="/usr/lib/libreadline.so" curl -fsSL https://gist.github.com/mislav/055441129184a1512bb5.txt | rbenv install --patch 2.2.0 |
This file contains hidden or 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
val this_instruction = "sml." + fields(1).capitalize + "Instruction" | |
val instruction_args = fields.drop(2) | |
val c_int = classOf[Int] | |
val c_str = classOf[String] | |
val instruction = instruction_args.length match { | |
case 1 => | |
val c = Class.forName(this_instruction).getConstructor(c_str, c_str, c_int) | |
c.newInstance(fields(0), fields(1), fields(2).toInt: Integer).asInstanceOf[Instruction] | |
case 2 => | |
val c = Class.forName(this_instruction).getConstructor(c_str, c_str, c_int, c_int) |
This file contains hidden or 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
dfs() | |
{ | |
hdfs dfs "$@" 2>&1 | grep -v 'using builtin-java classes where applicable' | |
} | |
export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64 | |
export HADOOP_INSTALL=~/hadoop | |
export HADOOP_HOME=$HADOOP_INSTALL | |
export PATH=$PATH:$HADOOP_INSTALL/bin:$HADOOP_INSTALL/sbin | |
export HADOOP_MAPRED_HOME=$HADOOP_INSTALL | |
export HADOOP_COMMON_HOME=$HADOOP_INSTALL |
This file contains hidden or 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
[root@localhost ~]# lvcreate -L 10G -n root_cache fedora /dev/sdb2 | |
Logical volume "root_cache" created. | |
[root@localhost ~]# lvcreate -L 20M -n root_cache_meta fedora /dev/sdb2 | |
Logical volume "root_cache_meta" created. | |
[root@localhost ~]# man lvconvert | |
[root@localhost ~]# lvconvert --type cache-pool --cachemode writeback --poolmetadata fedora/root_cache_meta fedora/root_cache | |
WARNING: Converting logical volume fedora/root_cache and fedora/root_cache_meta to pool's data and metadata volumes. | |
THIS WILL DESTROY CONTENT OF LOGICAL VOLUME (filesystem etc.) | |
Do you really want to convert fedora/root_cache and fedora/root_cache_meta? [y/n]: y | |
Converted fedora/root_cache to cache pool. |
This file contains hidden or 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 | |
gdb --pid $PPID <<EOF | |
call unbind_variable("TMOUT") | |
detach | |
EOF |
This file contains hidden or 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 | |
# Count threads in use for a given user | |
die() { | |
echo $1 | |
exit 1 | |
} | |
[[ $# -eq 1 ]] || die "Need user as arg" | |
id $1 >/dev/null 2>&1 || die "User ($1) not found" |
This file contains hidden or 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
user1$ xauth list | grep unix`echo $DISPLAY | cut -c10-12` > /tmp/xauth | |
user2$ xauth add `cat /tmp/xauth` |
This file contains hidden or 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
# Resize with right click | |
gsettings set org.gnome.desktop.wm.preferences resize-with-right-button true | |
# Sloppy focus | |
gsettings set org.gnome.desktop.wm.preferences focus-mode sloppy |
This file contains hidden or 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 | |
# Script to make (or update) a yum repo | |
workers=4 | |
REPOS=() | |
# To add a repo, REPOS+=("name or description|directory") | |
REPOS+=("Centos 7 x86_64 - live|/var/repo/repo/live/7/x86_64/") | |
REPOS+=("Centos 6 x86_64 - live|/var/repo/repo/live/6/x86_64/") | |
#REPOS+=("Centos 5 x86_64 - live|/var/repo/repo/live/5/x86_64/") |
This file contains hidden or 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
set ai sw=4 ts=4 sts=4 et bg=dark nu ml | |
set pastetoggle=<F2> | |
" Tabs!! | |
map <F8> :tabn<CR> | |
map <F7> :tabp<CR> | |
map <F6> :tabe | |
" Open the file you are cursor is currently over |