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"…
Category: Uncategorized
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…
Getting Qcache stats from MYSQL
SHOW STATUS LIKE ‘Qcache%’; nJoy 😉
Gluster peer probe fails (repeated UUID)
The UUID for a node is stored in /var/lib/glusterd/glusterd.info The uuidgen tool is used to create a new UUID. voila nJoy 😉
To cleanup a brick previously used under glusterfs
This must be done after you REALLY know this brick is going to be re-used elsewhere not in the same volume it was used before. NOTE: Potential data loss setfattr -x trusted.glusterfs.volume-id $brick_path setfattr -x trusted.gfid $brick_path rm -rf $brick_path/.glusterfs
Playing with Glusterfs
More details in a later post but I finally realized the order of things ? Thought I’d share. Reference sites: http://www.gluster.org/community/documentation/index.php/Getting_started_configure http://www.redhat.com/magazine/009jul05/features/gfs_practices/ mkdir ~/gluster cd ~/gluster wget -l 1 -nd -nc -r -A.rpm http://download.gluster.org/pub/gluster/glusterfs/LATEST/RHEL/epel-6/x86_64/ Â yum install glusterfs-libs-*.el6.x86_64.rpm -y yum install glusterfs-*.el6.x86_64.rpm -y yum install glusterfs-fuse-*.el6.x86_64.rpm -y yum install glusterfs-cli-*.el6.x86_64.rpm -y yum install glusterfs-server-*.el6.x86_64.rpm…
Svn side-by-side compare a file in two versions
So you want to compare a file across two revisions. svn diff -r 107:106 routes/user.js –diff-cmd /usr/bin/diff -x “–side-by-side” nJoy 😉
Replacing a piece of XML with awk
This script searches for an initial tag and and closing one and replaces the content. # !/bin/bash awk ‘ BEGIN {pr = 1;one = 0} /<Name>OPENING<\/Name>/ {pr = 0;} { if (pr) print } { if (!pr && !one) {print (“\t\t <Name>OPENING</Name> \n \t\t\t <Value>false</Value> \n \t\t<Type>STOPHERE</Type> \n ” ); one =1 ;}} /<Type>STOPHERE<\/Type>/ {pr…
Track ftp password from tcpdump Linux
Very nice and simple: tcpdump port ftp -l -A | egrep -i ‘pass=|pwd=|log=|login=|user=|username=|pw=|passw=|passwd=|password=|pass:|user:|username:|password:|login:|pass |user ‘ –color=auto –line-buffered -B20 nJoy  😉
Force an update on a zone for bind (named)
Just a simple command: rndc retransfer domain.com nJoy 😉