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
1. Open Mac OS x terminal | |
2. Go to Preferences -> Settings -> Keyboard | |
3. Redefine keys to "Send string to shell" as follows: | |
Key Escape Sequence | |
Home \033[1~ | |
End \033[4~ | |
Page Up \033[5~ | |
Page Down \033[6~ |
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
ec2hm=`curl -s http://169.254.169.254/latest/meta-data/public-ipv4`; echo ec2-${ec2hm//./-}.compute-1.amazonaws.com; unset ec2hm |
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
var c = require('riak-js').getClient({ host: 'hostname', port: 8098 }); | |
var mr = c.add('bucket').map(function m(v){return [1]}).reduce(function(v) { return [v.reduce(function(t, val) { return t + val; }, 0)]}); | |
mr.run({timeout: 10000000}); |
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
ADD JAR s3://<s3-bucket>/jars/hive_contrib-0.5.jar; | |
CREATE TEMPORARY FUNCTION now as 'com.mt.utils.udf.Now'; | |
CREATE TEMPORARY FUNCTION user_agent_f as 'com.mt.utils.UserAgent'; | |
set hive.merge.mapredfiles=true; | |
set hive.merge.mapfiles=true; | |
set hive.merge.size.per.task=500000000; | |
CREATE EXTERNAL TABLE data |
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 | |
apt-get -y update | |
apt-get -y install mdadm | |
echo "y" | mdadm --create /dev/md0 --level 0 --raid-devices 2 /dev/xvdb /dev/xvdc | |
echo "DEVICE /dev/xvdb /dev/xvdc" > /etc/mdadm/mdadm.conf | |
mdadm --detail --scan >> /etc/mdadm/mdadm.conf | |
blockdev --setra 65536 /dev/md0 | |
mkfs.ext3 -F /dev/md0 | |
mkdir -p /mnt/dataraid && mount -t ext3 /dev/md0 /mnt/dataraid -o noatime | |
echo "/dev/md0 /mnt/dataraid ext3 noatime 0 0" | tee -a /etc/fstab |
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
1. Open terminal inside your virtual machine and run: | |
sudo dd if=/dev/zero of=EMPTY bs=1M | |
sudo rm ./EMPTY | |
This will zeroify all the empty blocks on your disk. | |
2. Shutdown you virtual box. | |
3. Check what type of virtual drive do you have: VMDK or VDI. VirtualBox shrinking works only with VDI files. | |
If you have a VDI file, proceed to the last step, otherwise you'll need to perform an additional step of converting your VMDK file |
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
#!/usr/bin/env sh | |
## | |
# This is script with usefull tips taken from: | |
# https://github.com/mathiasbynens/dotfiles/blob/master/.osx | |
# | |
# install it: | |
# curl -sL https://raw.github.com/gist/2108403/hack.sh | sh | |
# |
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
1. | |
# vim /etc/sysctl.conf | |
fs.file-max = 999999 | |
net.ipv4.tcp_rmem = 4096 4096 16777216 | |
net.ipv4.tcp_wmem = 4096 4096 16777216 | |
net.ipv4.ip_local_port_range = 1024 65535 | |
2. | |
# vim /etc/security/limits.conf | |
root - nofile 999999 |
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
wget -O s3c.zip http://goo.gl/skBTi && unzip s3c.zip && cd ./s3cmd-1.1.0-beta3 && python setup.py install && cd ../ && rm -rf ./s3c.zip ./s3cmd-1.1.0-beta3 |
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
echo "syntax on" >> ~/.vimrc |