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
python -m SimpleHTTPServer |
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 <scheduler> > /sys/block/$disk/queue/scheduler | |
(http://stackoverflow.com/questions/1009577/selecting-a-linux-i-o-scheduler) |
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
On Ubuntu: | |
1.sudo apt-get install lzop liblzo2-dev | |
2.download and build: https://github.com/kevinweil/hadoop-lzo | |
3.copy the resulted jar to: <yourhadoop>/lib/, typically: /usr/lib/hadoop/lib/ | |
4.download: http://code.google.com/a/apache-extras.org/p/hadoop-gpl-compression/ | |
5.cp ./hadoop-gpl-compression-0.1.0/lib/native/Linux-<your_acrh_type>/*.* /usr/lib/hadoop/lib/native/Linux-<your_acrh_type>/ | |
6.Add the following properties to core-site.xml: | |
<property> | |
<name>io.compression.codecs</name> | |
<value>org.apache.hadoop.io.compress.GzipCodec,org.apache.hadoop.io.compress.DefaultCodec,com.hadoop.compression.lzo.LzoCodec,com.hadoop.compression.lzo.LzopCodec,org.apache.hadoop.io.compress.BZip2Codec</value> |
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
sed 's/'`echo -e "\01"`'/,/g' input_file.txt > output_file.csv |
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
On source: | |
dd if=/dev/sda | gzip -cf | nc <destination-system-ip> <port> | |
On destination: | |
nc -l -p <port> | gzip –dfc | dd of=/dev/sda | |
(http://conshell.net/wiki/index.php/Linux_P2V) |
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
Ubuntu: | |
sudo apt-get install wondershaper | |
sudo wondershaper eth0 [down rate in kilobits] [up rate in kilobits] |
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
1. | |
Paste it to the bash: | |
git config --global alias.lg "log --graph --pretty=format:'%C(auto)%h -%d %s %Cgreen(%cr) %C(bold blue)%an <%ae>%Creset' --abbrev-commit" | |
2. | |
Then in any git repo type: git lg | |
3. | |
Enjoy |
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
$ diff -u riakclient.proto.piqi riakclient.proto.piqi.edited | |
--- riakclient.proto.piqi 2012-02-08 20:55:35.000000000 -0600 | |
+++ riakclient.proto.piqi.edited 2012-02-08 20:55:25.000000000 -0600 | |
@@ -299,6 +299,7 @@ | |
] | |
.field [ | |
.name done | |
+ .ocaml-name "ocaml_done" | |
.type bool | |
.optional |
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
# Nginx - logrotate & upload to S3 | |
0 0 * * * /usr/sbin/logrotate /etc/logrotate.d/nginx | |
15 0 * * * s3cmd put /var/log/nginx/access.log-`date +"\%Y\%m\%d"`.gz s3://$LOGS_BUCKET_NAME/nginx-access/`date +"dt=\%Y\%m\%d"`/`hostname -s`.access.log-`date +"\%Y\%m\%d"`.gz |
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
parse_git_branch () { | |
git symbolic-ref HEAD 2> /dev/null | sed 's#refs/heads/\(.*\)# \1#' | |
} | |
parse_svn_branch() { | |
parse_svn_url | sed -e 's#^'"$(parse_svn_repository_root)"'##g' | | |
awk '{print " (svn::"$1")" }' | |
} | |
parse_svn_url() { | |
svn info 2>/dev/null | sed -ne 's#^URL: ##p' | |
} |
OlderNewer