Skip to main content

Posts

Showing posts from January, 2015

Timezone Update in Ubuntu 12.04 LTS

Changing Timezone in Ubuntu server. Step 1: Check ahmed@server:~# date Thu Jan 29 02:38:55 EST 2015 ahmed@server:~# more /etc/timezone US/Eastern Step 2: Change Timezone Setting ahmed@server:~# dpkg-reconfigure tzdata Current default time zone: 'Asia/Kolkata' Local time is now: Thu Jan 29 13:09:54 IST 2015. Universal Time is now: Thu Jan 29 07:39:54 UTC 2015. ahmed@server:~# date Thu Jan 29 13:09:57 IST 2015 ahmed@server:~# Step 3: Also make sure to restart cron service as this will still have the old time. ahmed@server:~# service crond restart ahmed@server:~# service nginx restart And we are done. ​

Hadoop `sysctl.conf` parameters

Hadoop sysctl.conf parameters. File System fs.file-max Increase size of file handles and inode cache [ahmed@server ~]# echo 'fs.file-max = 943718' >> /etc/sysctl.conf Swappiness : Do less swapping vm.dirty_ratio setting virtual memory ratio. vm.swappiness How often swap should be used. 0 is least, 60 default. [ahmed@server ~]# echo 'vm.dirty_ratio=10' >> /etc/sysctl.conf [ahmed@server ~]# echo 'vm.swappiness=0' >> /etc/sysctl.conf Connection Settings net.core.netdev_max_backlog Increase number of incoming connections backlog. net.core.somaxconn Increase number of incoming connections. [ahmed@server ~]# echo 'net.core.netdev_max_backlog = 4000' >> /etc/sysctl.conf [ahmed@server ~]# echo 'net.core.somaxconn = 4000' >> /etc/sysctl.conf TCP settings net.ipv4.tcp_sack Disable select acknowledgments net.ipv4.tcp_dsack Allows TCP to send “duplicate” SACKs. net.ipv4.tcp_...

Simple Script to Create Users on CentOS 6.5

Simple Script to create a user. Default passwd is set as username @123 As we are setting the chage , user needs to change the passwd on first login. usage() { echo -e " usage: $0 Optional parameters:\n --sudo-user, -s\t\tCreate a sudo User --norm-user, -n\t\tCreate a Normal User. --help, -h\t\tDisplay this Message. " exit 1 } create_normal_user() { USRNAME=$1 # create user useradd $USRNAME echo ${USRNAME}@123 | passwd ${USRNAME} --stdin # make sure user changes his passwd on first login chage -d 0 ${USRNAME} } create_sudo_user() { SUDO_USRNAME=$1 create_normal_user ${SUDO_USRNAME} echo -e "${SUDO_USRNAME}\tALL=(ALL)\tALL" >> /etc/sudoers } while true ; do case "$1" in -s) create_sudo_user $2 exit 1 ;; -n) create_normal_user $2 exit 1 ;; --sudo-user) create_sudo_user $2 exit 1 ;; --norm-user) create_n...

Setting SUN Java for Ubuntu.

First create directory for Java ahmed@ahmed-server:~/sun-java# mkdir -p /usr/lib/jvm/ ahmed@ahmed-server:~/sun-java# tar xvzf jdk1.7.0_75.tgz -C /usr/lib/jvm/ Setting Alternatives ahmed@ahmed-server:~/sun-java# sudo update-alternatives --install "/usr/bin/java" "java" "/usr/lib/jvm/jdk1.7.0_75/bin/java" 1 ahmed@ahmed-server:~/sun-java# sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.7.0_75/bin/javac" 1 ahmed@ahmed-server:~/sun-java# sudo update-alternatives --install "/usr/bin/javaws" "javaws" "/usr/lib/jvm/jdk1.7.0_75/bin/javaws" 1 update-alternatives: using /usr/lib/jvm/jdk1.7.0_75/bin/javaws to provide /usr/bin/javaws (javaws) in auto mode. Make sure we have the right permission. ahmed@ahmed-server:~/sun-java# sudo chmod a+x /usr/bin/java ahmed@ahmed-server:~/sun-java# sudo chmod a+x /usr/bin/javac ahmed@ahmed-server:~/sun-java# sudo chmod ...

Installing and Initial setup of Tsung Load Testing CentOS

Installing and Initial setup of Tsung Load Testing CentOS Installation on Centos [ahmed@server ~]$ yum install erlang [ahmed@server ~]$ tar -xvzf tsung-1.5.1.tar.gz -C /opt [ahmed@server ~]$ cd /opt/tsung-1.5.1 [ahmed@server ~]$ ./configure [ahmed@server ~]$ make [ahmed@server ~]$ make install Some Version information. [ahmed@server ~]$ tsung -v Tsung version 1.5.1 [ahmed@server ~]$ tsung Usage: tsung start|stop|debug|status Options: -f set configuration file (default is ~/.tsung/tsung.xml) (use - for standard input) -l set log directory where YYYYMMDD-HHMM dirs are created (default is ~/.tsung/log/) -i set controller id (default is empty) -r set remote connector (default is ssh) -s enable erlang smp on client nodes -p set maximum erlang processes per vm (default is 250000) -m write monitoring output on this file (default is tsung.log) (use - for stand...

Load Testing 'siege' - Install and Usage

Installation Procedure. First install prerequisites gcc/make on server. If Ubuntu sudo apt-get install gcc make On Centos/Redhat sudo yum install gcc make Step to Installation. $ ./configure $ make $ sudo make install Files Installed. siege --> SIEGE_HOME/bin/siege bombardment --> SIEGE_HOME/bin/bombardment siege2csv --> SIEGE_HOME/bin/siege2csv .siegerc --> $HOME/.siegerc siege.1 --> SIEGE_HOME/man/man1/siege.1 bombardment.1 --> SIEGE_HOME/man/man1/bombardment.1 siege2csv.1 --> SIEGE_HOME/man/man1/siege2csv.1 layingsiege.1 --> SIEGE_HOME/man/man1/layingsiege.1 urls_text.1 --> SIEGE_HOME/man/man1/urls_txt.1 urls.txt --> SIEGE_HOME/etc/urls.txt Usage for siege command. root@SIDCLB:~# siege SIEGE 3.0.9 Usage: siege [options] siege [options] URL siege -g URL Options: -V, --version VERSION, prints the version numb...