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  

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 […]

JBOSS AUTO RESTART SCRIPT

JBOSS AUTO RESTART SCRIPT

set –xv

Shell script with Debug command inside:

Add set –xv inside the shell script now to debug the output as shown below.

$ cat filesize.sh #!/bin/bash set -xv for filesize in $(ls -l . | grep “^-” | awk ‘{print $5}’) do let totalsize=$totalsize+$filesize done echo “Total file […]

sgid

SGID attribute

Setting the SGID attribute on a directory : chmod g+s

If the SGID (Set Group Identification) attribute is set on a directory, files created in that directory inherit its group ownership.

If the SGID is not set the file’s group ownership corresponds to the user’s default group.

In order to set the SGID […]

Link commands

delete symbolic link

When using the rm or unlink command to remove a symbolic link to a directory, make sure you don’t end the target with a ‘/’ character because it will create an error. Example:

$ mkdir dirtest $ ln -s dirtest lntest $ rm lntest/ rm cannot remove directory ‘lntest/’ : Is a […]

File /Folder Permissions

File /Folder Permissions

These are the numeric values and its related permissions in a linux system.

4000 – Setuid on execution 2000 – setgid on execution 1000 – set sticky bit 0400 – read by owner 0200 – write by owner 0100 – execute by owner 0040 – read by group 0020 – wrrite by […]

Kill processes for user

Kill processes for user

To easily kill all processes running under a user

ps -u USER | awk ‘{print $1}’ | xargs kill -9

or

pkill -u USER

replacing USER with the username.

To kill all specific processes such as php running under a user run,

ps -u USER | grep PROCESS |awk ‘{print $1}’ […]

Hide Commands in Shell

Hide Commands in Shell

To hide the commands you are entering in shell, use “stty” command 🙂

#stty -echo

Now, all commands that you type are invisible. To disable this mode, issue the following command at the shell prompt:

#stty echo

Nmap Command

Nmap Command

User can scan entire network or selected host or single server. Nmap is also useful to test your firewall rules. namp is metwork exploration tool and security / port scanner. According to nmap man page: It is an open source tool for network exploration and security auditing. It was designed to rapidly scan […]

Port scanning with netcat (nc) command

Port scanning with netcat (nc) command

How do I find out which ports are opened on my own server? How do I run port scanning using nc command?

A. It may be useful to know which ports are open and running services on a target machine. You can use nmap command for port scanning.

[…]