June 2012
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Categories

June 2012
M T W T F S S
 123
45678910
11121314151617
18192021222324
252627282930  

Create a Logical Partion

Creation deletion of Logical Partition and extended

1) List the Partition Table

[root@localhost ~]# fdisk -l

2) Create Extended Partition on the New disk /dev/sdb

fdisk /dev/sdb

[root@localhost ~]# fdisk /dev/sdb Device contains neither a valid DOS partition table, nor Sun, SGI or OSF disklabel Building a new DOS disklabel with disk […]

SUDO on Linux

SUDO on Linux

cat /etc/passwd

test:x:500:500:test:/home/test:/bin/bash

[root@localhost ~]# cp /etc/sudoers [root@localhost ~]# cp /etc/sudoers /etc/sudoers.org

1) Full Permission to User # User privilege specification test ALL=(ALL) ALL

Let restart apache with out sudo

[test@localhost ~]$ /etc/init.d/httpd restart rm: cannot remove `/var/run/httpd/httpd.pid’: Permission denied

test@localhost ~]$ sudo /etc/init.d/httpd restart [sudo] password for test: […]

Balancing Traffic Across Data Centres Using LVS

Source is taken from http://www.linuxforu.com/2009/05/balancing-traffic-across-data-centres-using-lvs/

SCP

Fast SCP SCP is a great way to copy files from somewhere to somewhere else, but as we all know it can be slower than (insert slow metaphor here). Here’s a way you can get way speedier(really a word?) transfers using scp.

scp -c arcfour -C sourcefile desthost: BY This way we can copy the […]

Logging on Apache

Apache server behind a proxy server

If you are using an apache server behind a proxy server, you may find that in your log files you will be given the proxy IP as the source IP of the connection. This is true, however you can adjust the apache log settings to pass the X-Forwarded-For […]

Netstat

Netstat

netstat -antpuleo

Will display the Timer running on the service

Proto Recv-Q Send-Q Local Address Foreign Address State User Inode PID/Program name Timer tcp 0 0 0.0.0.0:111 0.0.0.0:* LISTEN 0 9169 1246/rpcbind off (0.00/0/0) tcp 0 0 0.0.0.0:22 0.0.0.0:* LISTEN 0 22083 14524/sshd off (0.00/0/0) tcp 0 0 0.0.0.0:36998 0.0.0.0:* LISTEN […]

HTTPD process check

HTTPD process check

The apache/httpd config file has a setting which determines how many running processes your apache /httpd daemon will commit to the system. The idea is, that if your web server needs more processes to handle more connections it will spawn a new child and serve the request. If it is able it […]

Eating your memory? Let is find Out

Works on CENTOS AND FEDORA Prints the top 10 memory consuming processes

TR=`free|grep Mem:|awk ‘{print $2}’`;ps axo rss,comm,pid|awk -v tr=$TR ‘{proc_list[$2]+=$1;} END {for (proc in proc_list) {proc_pct=(proc_list[proc]/tr)*100; printf(“%d\t%-16s\t%0.2f%\n”,proc_list[proc],proc,proc_pct);}}’|sort -n |tail -n 10

Pound Loadbalancer

Pound Loadbalancer

Pound is a bit more specific to HTTP/Web scenarios. It functions as a 100% Layer-7 load balancer as it does full HTTP(S) integration and has full access to the HTTP stack. What this means is that you can do some fancy routing based on cookies, url regex, and do this with SSL termination. […]

Load balancer HAPROXY STUNNEL

Load balancer HAPROXY STUNNEL

HAProxy Software Load Balancer

HAProxy is a bit more bare metal as it targets a very specific set of scenarios focused on TCPIP more than HTTP. You can use cookie based injection with HAProxy to do round robin and stick users to a specific server. However, you can not do this […]