Category Archives: Tips & Tricks

VMware modules, Arch Linux & kernel 4.8.13

After upgrading the kernel to 4.8.13-1-ARCH some of the vmware kernel modules failed to compile: /tmp/modconfig-6BT70S/vmmon-only/linux/hostif.c:1592:47: error: ‘NR_ANON_PAGES’ undeclared (first use in this function) /tmp/modconfig-BBuLH6/vmnet-only/netif.c:468:7: error: ‘struct net_device’ has no member named ‘trans_start’; did you mean ‘mem_start’? The fix:

Be notified when critical battery level is reached

Ever happened to be focused on something and miss the fact that your laptop is running out of battery? And to lose your work? Yesterday happened twice! “Really? Hmm… I need to fix this as soon as possible.” I googled a bit and this stackexchange post  popped up. Nice, great! But being notified even when you’re … Continue reading Be notified when critical battery level is reached

Kill all mysql queries having query time greater than 1 minute

At this point there are two approaches to achieve this. One is using pt-kill from Percona Toolkit, and the other one is to use a bash script with a lot of pipes :) Why would someone use the second approach? I don’t know, perhaps because there is no Percona Toolkit available. If you can/want to … Continue reading Kill all mysql queries having query time greater than 1 minute

Check and mark badblocks on ext4 partitions

My storage is acting weird today and I’m trying to fix it with this command: And the result was: /dev/vg0/lv0: ***** FILE SYSTEM WAS MODIFIED ***** 6329 inodes used (0.01%, out of 107380736) 44 non-contiguous files (0.7%) 4 non-contiguous directories (0.1%) # of inodes with ind/dind/tind blocks: 0/0/0 Extent depth histogram: 6123/119 86511679 blocks used … Continue reading Check and mark badblocks on ext4 partitions

haproxy: rewrite request aka prefix url

Today I had a task which sounded like this “Change for balancer urls for this VIP – vip:8080 -> server* 16081/int” Long story short: frontend my_vip     bind x.x.x.x:8080     mode http     maxconn 30000     default_backend my_backend backend my_backend     mode http     balance leastconn     acl int_prefix path_beg /int     reqrep ^([^\ :]*)\ … Continue reading haproxy: rewrite request aka prefix url