Get the count of Ceph PG’s per OSD

ceph pg dump | awk ‘ BEGIN { IGNORECASE = 1 } /^PG_STAT/ { col=1; while($col!=”UP”) {col++}; col++ } /^[0-9a-f]+\.[0-9a-f]+/ { match($0,/^[0-9a-f]+/); pool=substr($0, RSTART, RLENGTH); poollist[pool]=0; up=$col; i=0; RSTART=0; RLENGTH=0; delete osds; while(match(up,/[0-9]+/)>0) { osds[++i]=substr(up,RSTART,RLENGTH); up = substr(up, RSTART+RLENGTH) } for(i in osds) {array[osds[i],pool]++; osdlist[osds[i]];} } END { printf(“\n”); printf(“pool :\t”); for (i in poollist) […]

Read More »

ESPtool commands

sudo esptool.py –port /dev/ttyUSB0 read_flash 0x00000 0x100000 image-T1Original.bin sudo esptool.py –port /dev/ttyUSB0 erase_flash sudo esptool.py –port /dev/ttyUSB0 write_flash -fs 1MB -fm dout 0x0 sonoff.bin

Read More »

Living with Network-Manager

Network manager can be a right pain in the ass, my goto has usually been to simply install it, but in some environments(Particularly Laptop\Desktop PC’s) it can actually be useful.   So here are some useful command that might make NM tolerable 1 – Show status Network Manager has a command line tool that can […]

Read More »

Bluetooth headset in Ubuntu Gnome

One of the most difficult things about moving to Ubuntu Gnome so far has been my Bluetooth headset of all things. It paired and worked brilliantly right out of box, but after a reboot the quality was woeful. Turns out the audio profile had changed to HSP\HFP – Headset Head Unit when I wanted it […]

Read More »

Renewing Lets Encrypt certificate for use in HAProxy

Here is a script i’ve put together from a  few different sources that renews specified LE certificates, copies them to the HAProxy SSL directory, copies them to the second HAPpoxy server and reloads haproxy on both nodes Just call like this bash ~/renewLECert.sh domain1.com domain2.com   Will create 2 separate certificates, usefull if you don’t […]

Read More »