fixing permission denied issue with udp 512 port graylog

use iptables to pre-route NAT the udp port :   iptables -A PREROUTING -t nat -i eth0 -p udp –dport 514 -j REDIRECT –to-port 10515   This will bypass the limit in the OS to ports < 1024 to non=root users . nJoy 😉  

Installing sample data in elastic search

After installing elastic search it is useful for testing and training to load some sample data. 1) create mapping : curl -XPUT http://localhost:9200/shakespeare -d ' { "mappings" : { "_default_" : { "properties" : { "speaker" : {"type": "string", "index" : "not_analyzed" }, "play_name" : {"type": "string", "index" : "not_analyzed" }, "line_id" : { "type"…

VMWare vSphere ESXi v5.5 Install Errors disk cannot partition

While adding a new disk to an ESX5.5. box it could not finish the partitioning stage and did not add to the Datastores. Apparently ESX does succeed to clean up the Disk from the GUI. NOTE: This procedure will destroy all data on the disk

Preferred Tools on Linux

Might need Epel or other repo For CentOS 6 : yum install epel-release -y yum install net-tools man screen htop vim-enhanced wget iotop iftop sysstat usbutils nfs-utils bind-utils ntp tcpdump telnet tree mlocate zip unzip pciutils git -y For Ubuntu apt-get install -y glances language-pack-en net-tools man screen htop vim wget iotop iftop sysstat usbutils…

Pretty Json in Bash

Simply pipe through python -m json.tool e.g.   curl -u Administrator:kpassword http://172.16.3.136:8091//pools/default | python -m json.tool  

Restoring a bucket in Couchbase

[root@mofo bin]# ./cbrestore /tmp/cbbackup/2015-01-19T220530Z/2015-01-19T220530Z-full/ -u Administrator -ppassword http://mofo.lan:8091 –bucket-source=beer-sample –bucket-destination=DAVID [####################] 100.0% (7303/estimated 7303 msgs) bucket: beer-sample, msgs transferred… : total | last | per sec byte : 2541549 | 2541549 | 3415000.2 done [root@mofo bin]#

pre-pend log timestamp

Adds a timestamp before alog from a script awk -v sec=$(date -u +%s) '{print strftime("%Y-%m-%d %H:%M:%S",sec), $0; fflush();}' in cron : awk -v sec=$(date -u +\%s) '{print strftime("\%Y-\%m-\%d \%H:\%M:\%S",sec), $0; fflush();}' So : # echo hello world | awk -v sec=$(date -u +%s) '{print strftime("%Y-%m-%d %H:%M:%S",sec), $0; fflush();}'   2014-10-30 08:40:26 test nJoy 🙂

Invalidate Varnish cache

1)   netstat -plnt 2)   varnishadm -T 127.0.0.1:6082 ban.url /wp-content/themes/catch-box -S /etc/varnish/secret   Will invalidate all content under  /wp-content/themes/catch-box.   nJoy  😛  

Fix Raid on LSI controllers when a disk is shown as ubad

This can be done with both megacli and storcli. Since the way forward is storcli this how to will be based on that.   storcli /c0 show all   Drive Information : =================   ——————————————————————————- EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp ——————————————————————————- 8:1 7 Onln 0 465.25 GB SATA HDD…