# Setting Global Username/Email
git config --global user.name "Aayush Tuladhar"'
git config --global user.email "[email protected]"'
# Clone a Repo from URL
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
package com.aayushtuladhar.HelloWorld; | |
class B { | |
protected int x; | |
int getX() { return x; } | |
void setX(int x) { this.x = x; } | |
void increase() { x = x+1; } | |
void decrease() { x = x-1; } | |
int returnx() { return x; } |
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
#!/usr/bin/expect | |
#Aayush Tuladhar | |
#Usage ./splunk_install.sh servername | |
#Setting Variable | |
set server [lrange $argv 0 0] | |
spawn scp file.txt splunk@$server:/home/asadmin/testfile.txt | |
expect { | |
-re "RSA key fingerprint" {send "yes\r"} |
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
# Installing tmux on Amazon-EC2 | |
# If you don't have libevent install use wget to install the libevent and install | |
wget https://github.com/downloads/libevent/libevent/libevent-2.0.18-stable.tar.gz | |
tar zxf libevent-2.0.18-stable.tar.gz | |
sudo ./configure & sudo make install | |
# If you don't have curses install use yum to install the curses |
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
""""""""""""" | |
" Basics | |
"""""""""""" | |
syntax on | |
set background=dark | |
set ruler " Show the line number on the bar | |
set showmatch " Show matching parenthesis | |
set more " Use more prompt | |
set autoread " Watch for file changes |
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
/** | |
* <h2> Converts ResultSet to HashMap of List<String,Object></h2> | |
* @param row | |
* @param rs_SubItemType | |
* @throws SQLException | |
*/ | |
private static void getHashMap( List<Map<String, Object>> row, ResultSet rs_SubItemType) throws SQLException { | |
ResultSetMetaData metaData = rs_SubItemType.getMetaData(); |
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
#!/usr/bin/expect -f | |
#Expect Script to Run Command on Remote Server | |
#Usage : ./test.sh <password> <servername> <username> | |
#Usage : ./test.sh password myserver user | |
#Set your command you want to run | |
set command "cat /etc/hosts | grep -i" |
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
############## | |
#File Commands | |
############## | |
ls # - Directory Listing | |
ls -al # - Formatted listing with hidden files | |
cd dir # - Change directory to dir | |
pwd # - Print Working Directory (Show Current Directory) | |
mkdir dir # - Create a Directory dir | |
rm file # - Delete File |
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
#Install Updates and Upgrades | |
sudo apt-get update && sudo apt-get upgrade | |
# Installing Apache2 | |
sudo apt-get install apache2 -y | |
#Install Build Essential packages | |
sudo apt-get install build-essential | |
#Nautilus Open Terminal |