-
Notifications
You must be signed in to change notification settings - Fork 1
Bash & Stuff
sudo du -ah /home --max-depth 1 | sort -n -r
unset $(env | grep proxy |awk -F'=' '{print }')
http://tldp.org/LDP/Bash-Beginners-Guide/html/sect_07_01.html
find . -maxdepth 1 -name "test.rpm" -delete find . -maxdepth 1 -name "test.tar" -exec cp "{}" ../../../../ ;
sudo echo "$USER ALL=(ALL) NOPASSWD:ALL" | sudo tee -a /etc/sudoers
git filter-branch -f --env-filter '
an="$GIT_AUTHOR_NAME"
am="$GIT_AUTHOR_EMAIL"
cn="$GIT_COMMITTER_NAME"
cm="$GIT_COMMITTER_EMAIL"
if [[ "$GIT_COMMITTER_EMAIL" = jacks* ]]
then
cn="Jack Slingerland"
cm="[email protected]"
an="Jack Slingerland"
am="[email protected]"
fi
if [[ "$GIT_AUTHOR_EMAIL" = jacks* ]]
then
cn="Jack Slingerland"
cm="[email protected]"
an="Jack Slingerland"
am="[email protected]"
fi
export GIT_AUTHOR_NAME="$an"
export GIT_AUTHOR_EMAIL="$am"
export GIT_COMMITTER_NAME="$cn"
export GIT_COMMITTER_EMAIL="$cm"'
-- --all
http://ctf-dev-environment-vagrant.s3.amazonaws.com/Gerrit-Performance-Tuning-Cheat-Sheet.pdf
yum whatprovides */ldapsearch
http://alblue.bandlem.com/2005/08/howto-ssh-logins-using-keys.html
http://www.thegeekstuff.com/2011/10/grep-or-and-not-operators/
http://www.ibm.com/developerworks/library/l-bash-parameters/
vim /etc/sysconfig/network Change to your hostname: HOSTNAME=jenkins-playground.df.alucloud.local
touch /opt/dev/ns-update.sh chmod +x /opt/dev/ns-update.sh echo "#!/bin/bash" >> /opt/dev/ns-update.sh echo "IP=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`" >> /opt/dev/ns-update.sh echo "LAST_QUADRANT=`/sbin/ifconfig eth0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}' | cut -d. -f4`" >> /opt/dev/ns-update.sh echo "echo "server 135.248.16.241" >> /opt/dev/ns-update.sh echo "update add $HOSTNAME 3600 A $IP" >> /opt/dev/ns-update.sh echo "send" >> /opt/dev/ns-update.sh echo "zone 18.248.135.in-addr.arpa" >> /opt/dev/ns-update.sh echo "update add $LAST_QUADRANT.18.248.135.in-addr.arpa. 86400 IN PTR $HOSTNAME" >> /opt/dev/ns-update.sh echo "send" >> /opt/dev/ns-update.sh echo "quit" >> /opt/dev/ns-update.sh echo "" | nsupdate" >> /opt/dev/ns-update.sh crontab -l | { cat; echo '*/20 * * * * /opt/dev/ns-update.sh'; } | crontab -
Log out and in and verify that hostname has changed. Then run /opt/dev/ns-update.sh
To format your attached storage:
fdisk /dev/vdb N P 1 enter enter W
mkfs.ext4 /dev/vdb1
Create the directory to mount on and the following entry to /etc/fstab: /dev/vdb1 /workspace ext4 defaults 0 0
set +xe
cd run/ant-deploy
COUNT=1
i=0
while [[ $i -lt $MAX_RETRY && $COUNT -gt 0 ]]; do
echo -e "\n\n\n"
echo "Retry count: ${i}"
echo "-----------------"
ACTION HERE
i=$((i+1))
sleep 10s
done
sudo /usr/bin/apt-get install -y dpkg-dev devscripts
missing_deps="`dpkg-checkbuilddeps debian/control 2>&1 | sed 's/^.*: *//' | sed 's/(.*)//g'`"
if [ -n "${missing_deps}" ]; then
sudo /usr/bin/apt-get install -y ${missing_deps}
fi
version=${BUILD_VERSION}-${BUILD_NUMBER}
if [ -f /etc/redhat-release ]; then
export DISTRIBUTION="rhel`lsb_release -r -s | sed 's/\..*$//'`"
ARCHITECTURE=`uname -p`
MAKEFLAGS="VERSION=${version}"
else
export DISTRIBUTION="`lsb_release -c -s`"
ARCHITECTURE=`dpkg-architecture -qDEB_HOST_ARCH`
./dev_scripts/mkversion.sh ${DISTRIBUTION}
fi
http://stackoverflow.com/questions/25657596/how-to-set-up-gui-on-amazon-ec2-ubuntu-server