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
alias install="sudo apt-get install" | |
alias poweroff="sudo shutdown -h now" | |
alias cd..='cd ..' | |
alias ..='cd ..' | |
alias ...='cd ../..' | |
alias d='ls' | |
alias df='df -h -x supermount' | |
alias du='du -h' | |
alias egrep='egrep --color' |
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
sudo sed -i 's/raring/saucy/' /etc/apt/sources.list | |
sudo sed -i 's/olivia/petra/' /etc/apt/sources.list | |
sudo sed -i 's/raring/saucy/' /etc/apt/sources.list.d/official-package-repositories.list | |
sudo sed -i 's/olivia/petra/' /etc/apt/sources.list.d/official-package-repositories.list | |
sudo apt-get update && sudo apt-get dist-upgrade | |
sudo apt-get upgrade |
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
#Verify the disk space on the machine and note the partition names. | |
df -h | |
#Using the partition name above, resize the disk | |
sudo resize2fs /dev/xvde1 | |
#Verify if the resizing was successful | |
df -h |
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
sudo yum update | |
sudo yum install zip subversion git python2.7-dev | |
sudo yum install libcurl4-gnutls-dev librtmp-dev | |
sudo yum install gcc python-devel | |
sudo wget http://pkgs.repoforge.org/p7zip/p7zip-9.20.1-1.el6.rf.x86_64.rpm | |
sudo rpm -i p7zip-9.20.1-1.el6.rf.x86_64.rpm | |
sudo easy_install pip |
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
pscp -i some.ppk SSH_Client_Pub.pub [email protected]:/root/.ssh/ | |
ssh -i some.pem [email protected] | |
ssh-keygen -f ~/.ssh/SSH_Client_Pub.pub -i >> ~/.ssh/authorized_keys | |
scp -i ~/.ssh/id_rsa -o "UserKnownHostsFile /dev/null" -o StrictHostKeyChecking=no -r SRC_FOLDER [email protected]:DEST_FOLDER |
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
#Be on high alert while modifying this file. | |
#There should be no scope any error. | |
#Open the file | |
sudo visudo -f /etc/sudoers | |
#Add this line or modify the username for whom sudo command will not prompt for the password. | |
prash ALL=(ALL) NOPASSWD: ALL |
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
import java.io.IOException; | |
import java.io.InputStream; | |
import java.net.URL; | |
import java.util.Properties; | |
import com.google.common.io.ByteSource; | |
import com.google.common.io.Resources; | |
/** | |
* Reads a properties file and print all the key value pairs to the console. |
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
import java.util.Random; | |
import java.util.concurrent.TimeUnit; | |
import com.google.common.base.Stopwatch; | |
/** | |
* Sample example demonstrating usage of Stopwatch API of Google Guava. | |
* | |
* @see <a href="http://docs.guava-libraries.googlecode.com/git/javadoc/com/google/common/base/Stopwatch.html">Guava Stopwatch</a> | |
*/ |
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
##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### ##### | |
### Shell script to download Oracle JDK / JRE / Java binaries from Oracle website using terminal / command / shell prompt using wget. | |
### You can download all the binaries one-shot by just giving the BASE_URL. | |
### Script might be useful if you need Oracle JDK on Amazon EC2 env. | |
### Script is updated for every JDK release. | |
### Features:- | |
# 1. Resumes a broken / interrupted [previous] download, if any. | |
# 2. Renames the file to a proper name with including platform info. |
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
# This script lists down commands to download Chromium [both 32 and 64 bit] from the shell. | |
#Just in case, if you dont want to go thru this hassle, check Chromium Auto Updater. http://www.firstever.eu/en/chromium-auto-updater. | |
#Steps for downloading 32 bit Chromium for Windows. | |
export ver=`curl http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/LAST_CHANGE` | |
echo $ver | |
wget http://commondatastorage.googleapis.com/chromium-browser-continuous/Win/$ver/chrome-win32.zip | |
mv chrome-win32.zip chrome-win32__$ver.zip |