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
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
[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]#
SHOW STATUS LIKE ‘Qcache%’;
nJoy 😉
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 🙂
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 😛
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 N N 512B WDC WD5003ABYX-01WERA1 U 8:2 6 Onln 0 465.25 GB SATA HDD N N 512B WDC WD5003ABYX-01WERA1 U 8:3 5 Onln 0 465.25 GB SATA HDD N N 512B WDC WD5003ABYX-01WERA1 U
.
. 8:14 4 UBad - 223.062 GB SATA SSD N N 512B INTEL SSDSC2CW240A3 U -------------------------------------------------------------------------------
Say 8:14 is marked a Ubad. (Unconfigured bad)
storcli /c0 /e8 /s14 set good
storcli /c0 show all
It should now have the disk marked as Ugood ( Unconfigured Good)
------------------------------------------------------------------------------- EID:Slt DID State DG Size Intf Med SED PI SeSz Model Sp ------------------------------------------------------------------------------- 8:1 7 Onln 0 465.25 GB SATA HDD N N 512B WDC WD5003ABYX-01WERA1 U 8:2 6 Onln 0 465.25 GB SATA HDD N N 512B WDC WD5003ABYX-01WERA1 U 8:3 5 Onln 0 465.25 GB SATA HDD N N 512B WDC WD5003ABYX-01WERA1 U
.
. 8:14 4 uGood F 223.062 GB SATA SSD N N 512B INTEL SSDSC2CW240A3 U -------------------------------------------------------------------------------
storcli /c0 -/fall show
Controller = 0 Status = Success Description = Operation on foreign configuration Succeeded FOREIGN CONFIGURATION : ===================== ---------------------------------------- DG EID:Slot Type State Size NoVDs ---------------------------------------- F - Cac0 Frgn 223.062 GB 1 ---------------------------------------- NoVDs - Number of VDs in disk group|DG - Diskgroup Total foreign drive groups = 1
This would show an external configuration which needs clearing.
Now we need to clear the config data from the previous RAID conf cached on the disk.
storcli /cx /fall import
This will clear the foreign config and start the rebuild.
To follow the rebuild :
storcli /c0 /e8 /sall show rebuild
Controller = 0
Status = Success
Description = Show Drive Rebuild Status Succeeded.
———————————————————
Drive-ID Progress% Status Estimated Time Left
———————————————————
/c0/e8/s0 – Not in progress –
/c0/e8/s1 – Not in progress –
/c0/e8/s2 – Not in progress –
/c0/e8/s3 – Not in progress –
/c0/e8/s4 – Not in progress –
/c0/e8/s5 – Not in progress –
/c0/e8/s6 – Not in progress –
/c0/e8/s7 – Not in progress –
/c0/e8/s8 – Not in progress –
/c0/e8/s9 – Not in progress –
/c0/e8/s10 – Not in progress –
/c0/e8/s11 – Not in progress –
/c0/e8/s12 – Not in progress –
/c0/e8/s13 – Not in progress –
/c0/e8/s14 93 In progress –
/c0/e8/s15 – Not in progress –
———————————————————
Or for one drive in particular:
storcli /c0 /e8 /s14 show rebuild
Controller = 0
Status = Success
Description = Show Drive Rebuild Status Succeeded.
———————————————————————————————————-
Drive-ID Progress% Status Estimated Time Left
———————————————————————————————————-
/c0/e8/s14 93 In progress –
———————————————————————————————————-
That’s it.
[ NOTE : ] Rebuild might take more than 1 day in default mode…. Just saying be patient.
nJoy 😉
Sample entry
root@192.168.168.100:/mnt/streamstorage53/stage.k/ura/web /opt/kaltura/web fuse.sshfs _netdev,auto 0 0
nJoy 😉
This is a small script that takes a bash command and decodes the parameters in non sequential order except definers.
#!/bin/bash
if [ "$#" -ne 1 ] || ! [ -d "$1" ]; then
echo "Usage: $0 " >&2
exit 1
fi
while [[ $# > 1 ]]
do
key=”$1″
echo $key
shift
case $key in
-c|–color|color)
COLOR=$1
shift
;;
-s|–section|section)
SECTION=”yes”
;;
*)
;;
esac
done
nJoy 😉
1) Install the following:
xorg-x11-xauth
xorg-x11-fonts-*
xorg-x11-utils
2) Enable the following in the sshd_config file
X11Forwarding yes
3) Use an appropriate X-Server on your desktop
nJoy 😉
Simple:
ifconfig | grep –color -E ‘^|[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}’
nJoy 😉