tcpdump -s 0 -l -w - dst port 3306 | strings
nJoy 😉
tcpdump -s 0 -l -w - dst port 3306 | strings
nJoy 😉
esxcli network ip neighbor list
njoy 😉
sudo yum --enablerepo epel-testing install s3cmd
njoy 😉
a=0;
for i in `cat $FOLDERLIST`
do
((a++))
percentage=`awk -v a=$a -v b=$NUMBEROFFOLDERS 'BEGIN {printf "%3.0f", a / b * 100; exit } '`
arrow=`printf '=%.0s' $(seq 1 $percentage)`
headed=`printf '%s%s' $arrow '>'`
paddedarrow=`printf '%-102s' $headed`
echo -ne "$paddedarrow $a/$NUMBEROFFOLDERS [$percentage] \r "
done
echo
njoy  😉
In recent CentOS version 6.3 is an unresolved bug, which causes the network card to freeze the server.
Following message appears in /var/log/messages
kernel
To work around the problem you will need to turn off Active-State Power Management (ASPM)
(Feature that saves power in the Peripheral Component Interconnect Express (PCI Express or PCIe) subsystem by setting a lower power state for PCIe links when the devices to which they connect are not in use)
For GRUB bootloader edit the following file: /boot/grub/grub.conf and append pcie_aspm=off to the end of kernel boot line.
For example:
kernel /vmlinuz-2.6.32-279.el6.x86_64 ro root=UUID=81e9e0a2-0a51-4d75-955d-909aaf848192 rd_NO_LUKS KEYBOARDTYPE=pc KEYTABLE=us LANG=en_US.UTF-8 SYSFONT=latarcyrheb-sun16 crashkernel=auto rd_NO_DM rd_MD_UUID=c6855f45:016a63bb:2d79bfb2:07371ed8 rd_NO_LVM rd_MD_UUID=5d5a434e:6c20cfcd:51340c3f:29c29151 pcie_aspm=off
To verify the change, reboot the server and run the following command:
dmesg | grep PCIe PCIe ASPM is disabled
If your output is different, the change in grub.conf did not take an effect.
Setting up a listener in UDP :
Install socat
Jist here (Centos 6.6 : http://jist.sudoall.com/socat/setup
install
curl “http://jist.sudoall.com/socat/setup” | bash –
socat -u udp-recv:8888 –
To send the datagram :
nc -u 127.0.0.1 8888
njoy 😉
The “magic SysRq key” provides a way to send commands directly to the kernel through the /proc filesystem. It is enabled via a kernel compile time option, CONFIG_MAGIC_SYSRQ, which seems to be standard on most distributions. First you must activate the magic SysRq option:
echo 1 > /proc/sys/kernel/sysrq
When you are ready to reboot the machine simply run the following:
echo b > /proc/sysrq-trigger
This does not attempt to unmount or sync filesystems, so it should only be used when absolutely necessary, but if your drive is already failing then that may not be a concern.
In addition to rebooting the system the sysrq trick can be used to dump memory information to the console, sync all filesystems, remount all filesystems in read-only mode, send SIGTERM or SIGKILL to all processes except init, or power off the machine entirely, among other things.
nJoy 😉
curl -o – “http://localhost:9200/_nodes/process?pretty”
{
“cluster_name” : “prod-escluster”,
“nodes” : {
“NUyPv6zIQDS3wo_u_8FUaw” : {
“name” : “es01”,
“transport_address” : “inet[/192.168.1.147:9300]”,
“host” : “es-01.streamuk.com”,
“ip” : “127.0.0.1”,
“version” : “1.4.2”,
“build” : “927caff”,
“http_address” : “inet[/192.168.1.147:9200]”,
“attributes” : {
“master” : “true”
},
“process” : {
“refresh_interval_in_millis” : 1000,
“id” : 2185,
“max_file_descriptors” : 500000,
“mlockall” : false
}
}
}
}
Â
#!/bin/bash
wall <<zzz23EndOfMessagezzz23
E-mail your noontime orders for pizza to the system administrator.
(Add an extra dollar for anchovy or mushroom topping.)
# Additional message text goes here.
# Note: 'wall' prints comment lines.
zzz23EndOfMessagezzz23
# Could have been done more efficiently by
# wall <message-file
# However, embedding the message template in a script
#+ is a quick-and-dirty one-off solution.
exit
nJoy 😉
#!/bin/bash
echo "`basename $0` Tool"
[[ $# != 3 ]] && echo "Invalid number of arguments" && echo "Sample Call : create_ftp.sh <numeric_partner_id> <username_alphanum> <password_alphanum>" && exit 128
#number re
re='^[0-9]+$'
if [[ $1 =~ $re ]] ; then
PARTNERID=$1
echo "Partner id set to $1"
else
echo "Invalid param #1 should be numeric"
echo "Sample Call : create_ftp.sh <numeric_partner_id> <username_alphanum> <password_alphanum>"
exit 128
fi
re='^[a-zA-Z0-9][-a-zA-Z0-9]{0,61}[a-zA-Z0-9]$'
if [[ $2 =~ $re ]] ; then
USERNAME=$2
echo "Username set to $2"
else
echo "Invalid param #2 should be alphanumeric"
echo "Sample Call : create_ftp.sh <numeric_partner_id> <username_alphanum> <password_alphanum>"
exit 128
fi
if [[ $3 =~ $re ]] ; then
PASSWORD=$3
echo "Password set to $3"
else
echo "Invalid param #3 should be alphanumeric"
echo "Sample Call : create_ftp.sh <numeric_partner_id> <username_alphanum> <password_alphanum>"
exit 128
fi
njoy 😉