start new:
tmux
start new with session name:
tmux new -s myname
#!/bin/bash | |
echo "Post-install recipe executed at `date`." > /tmp/post-install.out |
#!/bin/bash | |
echo "Pre-install recipe executed at `date`." > /tmp/pre-install.out |
# Save below scripts as stopeth.sh | |
#!/bin/sh | |
ip link set eth0 down | |
sleep 60 | |
ip link set eth0 up | |
# Execute the script | |
$ sudo nohup ./stopeth.sh & |
set nocompatible " be iMproved, required | |
filetype off " required | |
" set the runtime path to include Vundle and initialize | |
set rtp+=~/.vim/bundle/Vundle.vim | |
call vundle#begin() | |
" alternatively, pass a path where Vundle should install plugins | |
"call vundle#begin('~/some/path/here') |
#!/bin/bash | |
AMBARI_USER='admin' | |
AMBARI_PASSWORD='admin' | |
AMBARI_HOST='localhost' | |
CLUSTER_NAME='mitate' | |
MOVE_FROM='old-host.mitate.com' | |
MOVE_TO='new-host.mitate.com' | |
# Tell to ambari we want to install this component on new_host |
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
$script = <<SCRIPT | |
sudo yum -y install ntp | |
sudo chkconfig ntpd on | |
sudo /etc/init.d/ntpd start | |
sudo chkconfig iptables off | |
sudo /etc/init.d/iptables stop | |
sudo setenforce 0 |
# Pretty print HDFS usage | |
include Java | |
import org.apache.hadoop.util.StringUtils | |
path = ARGV[0] | |
dus = %x[$HADOOP_HOME/bin/hadoop fs -dus #{path}] | |
splited = dus.split | |
byteDesc = StringUtils.byteDesc(splited[0].to_i) | |
puts splited[1] + "\t" + byteDesc |