RSS

Posts in 2019

  • qemu-nbd

    Monday, July 01, 2019 in Commands

    modprobe nbd max_part=8 qemu-nbd -c /dev/nbd0 image.img mount /dev/nbd0p1 /mnt # or vgscan && vgchange -ay [...] umount /mnt qemu-nbd -d /dev/nbd0

    Read more

  • Qemu

    Monday, June 10, 2019 in Commands

    Quickly launch a qemu vm with local qcow as hard drive In this example I am using the docker0 bridge because I do not want to have to modify my shorewall config, but any proper bridge would do : ip tuntap add tap0 mode tap brctl addif docker0 tap0 …

    Read more

  • Busybox web server

    Tuesday, April 16, 2019 in Commands

    If you have been using things like python -m SimpleHTTPServer, here is something even more simple and lightweight to use : busybox httpd -vfp 80

    Read more

Posts in 2018

  • rrdtool

    Tuesday, September 25, 2018 in Commands

    Graph manually for i in `ls`; do rrdtool graph $i.png -w 1024 -h 768 -a PNG --slope-mode --font DEFAULT:7: \ --start -3days --end now DEF:in=$i:netin:MAX DEF:out=$i:netout:MAX \ LINE1:in#0000FF:"in" LINE1:out#00FF00:"out" done …

    Read more

  • List active calls on asterisk

    Tuesday, September 25, 2018 in Commands

    watch-d-n1'asterisk -rx “core show channels”'

    Read more

  • Import commits from one git repo to another

    Tuesday, September 25, 2018 in Commands

    This imports commits from a repo in the ../masterfiles folder and applies them to the repository inside the current folder : (cd ../masterfiles/; git format-patch –stdout origin/master) | git am

    Read more

  • How to have asterisk call you into a meeting

    Tuesday, September 25, 2018 in Commands

    At alterway we sometimes have DTMF problems that prevent my mobile from joining a conference room. Here is something I use to have asterisk call me and place me inside the room : channeloriginateSIP/numlog/06XXXXXXXXapplicationMeetMe85224,M,secret

    Read more

  • Find where inodes are used

    Wednesday, April 25, 2018 in Commands

    find . -xdev -printf '%h\n' | sort | uniq -c | sort -k 1 -n

    Read more

  • Rewrite a git commit history

    Monday, March 05, 2018 in Commands

    Here is how to rewrite a git commit history, for example to remove a file : git filter-branch –index-filter "git rm --cached --ignore-unmatch ${file}" --prune-empty --tag-name-filter cat - -all

    Read more

  • omreport

    Monday, March 05, 2018 in Commands

    Your raid status at a glance omreport storage pdisk controller=0 vdisk=0|grep -E '^ID|State|Capacity|Part Number'|grep -B1 -A2 Failed Other commands omreport storage vdisk omreport storage pdisk controller=0 vdisk=0 omreport storage pdisk …

    Read more