itMerge branch 'master' of z3bra.org:monochromatic - monochromatic - monochromatic blog: http://blog.z3bra.org Err z3bra.org 70 hgit clone git://z3bra.org/monochromatic URL:git://z3bra.org/monochromatic z3bra.org 70 1Log /scm/monochromatic/log.gph z3bra.org 70 1Files /scm/monochromatic/files.gph z3bra.org 70 1Refs /scm/monochromatic/refs.gph z3bra.org 70 i--- Err z3bra.org 70 1commit 41e38839b23d8ccea33dd48b439143889effbef9 /scm/monochromatic/commit/41e38839b23d8ccea33dd48b439143889effbef9.gph z3bra.org 70 1parent 08fbf73988524ea560bf3f0878c6045301744592 /scm/monochromatic/commit/08fbf73988524ea560bf3f0878c6045301744592.gph z3bra.org 70 hAuthor: z3bra URL:mailto:willyatmailoodotorg z3bra.org 70 iDate: Sun, 16 Aug 2015 19:08:52 +0200 Err z3bra.org 70 i Err z3bra.org 70 iMerge branch 'master' of z3bra.org:monochromatic Err z3bra.org 70 i Err z3bra.org 70 iDiffstat: Err z3bra.org 70 i M 2015/01/you-are-the-wm.txt | 191 ++++++++++++++++++++++++++++++- Err z3bra.org 70 i A 2015/04/the-wrong-sysadmin.txt | 170 +++++++++++++++++++++++++++++++ Err z3bra.org 70 i A 2015/06/vomiting-colors.txt | 77 +++++++++++++++++++++++++++++++ Err z3bra.org 70 i M config.mk | 4 +++- Err z3bra.org 70 i M index.txt | 2 ++ Err z3bra.org 70 i Err z3bra.org 70 i5 files changed, 442 insertions(+), 2 deletions(-) Err z3bra.org 70 i--- Err z3bra.org 70 1diff --git a/2015/01/you-are-the-wm.txt b/2015/01/you-are-the-wm.txt /scm/monochromatic/file/2015/01/you-are-the-wm.txt.gph z3bra.org 70 it@@ -83,4 +83,193 @@ some nice scripts in there ! Err z3bra.org 70 i Now throw your window manager away, you don't need it anymore. **YOU ARE THE WM Err z3bra.org 70 i !** Err z3bra.org 70 i Err z3bra.org 70 i- Err z3bra.org 70 i+**EDIT** Err z3bra.org 70 i+-------- Err z3bra.org 70 i+ Err z3bra.org 70 i+I was asked on reddit to explain my wmutils setup. I gave a fairly Err z3bra.org 70 i+detailed answer which might also be useful for others, so I figured out I could Err z3bra.org 70 i+add it here (original comment [here](https://www.reddit.com/r/unixporn/comments/3b42zj/people_using_wmutils_how_do_you_use_it/csj8iq4)) Err z3bra.org 70 i+ Err z3bra.org 70 i+I Have both `wmutils/core` and `wmutils/opt` installed. I need the latter for Err z3bra.org 70 i+`wew`, an X event watcher. Err z3bra.org 70 i+ Err z3bra.org 70 i+MANAGING WINDOWS Err z3bra.org 70 i+---------------- Err z3bra.org 70 i+ Err z3bra.org 70 i+The central piece of my workflow is `sxhkd`. This is a software one can use to Err z3bra.org 70 i+bind key combos to commands, or **scripts**. I use it both to start my Err z3bra.org 70 i+applications, but also to manage my windows via `wmutils` tools, and scripts. Err z3bra.org 70 i+For instance, here is the entry that let me move windows around the screen using Err z3bra.org 70 i+the keyboard (`pfw` returns the ID of the currently focused window. It's a Err z3bra.org 70 i+rather important piece of software!): Err z3bra.org 70 i+ Err z3bra.org 70 i+ # move windows around Err z3bra.org 70 i+ super + {left,down,up,right} Err z3bra.org 70 i+ wmv {-20 0, 0 20, 0 -20, 20, 0} $(pfw) Err z3bra.org 70 i+ Err z3bra.org 70 i+ # resize windows Err z3bra.org 70 i+ super + alt + {left,down,up,right} Err z3bra.org 70 i+ wrs {-20 0, 0 20, 0 -20, 20, 0} $(pfw) Err z3bra.org 70 i+ Err z3bra.org 70 i+That's for tools that can be bound "directly" via sxhkd. For more complex tasks, Err z3bra.org 70 i+I use a few scripts of my own: Err z3bra.org 70 i+ Err z3bra.org 70 i++ `vroum` - manage window focus Err z3bra.org 70 i++ `groaw` - manage window groups Err z3bra.org 70 i++ `focus` - finer way to focus windows Err z3bra.org 70 i++ `corner` - move windows to screen's corner Err z3bra.org 70 i++ `fullscreen` - put a window in fullscreen mode Err z3bra.org 70 i+ Err z3bra.org 70 i+### vroum Err z3bra.org 70 i+ Err z3bra.org 70 i+It can take 3 arguments: "next, prev, $wid". "next" will focus the next Err z3bra.org 70 i+window on the stack, previous will focus the previously focused window, and Err z3bra.org 70 i+every argument starting by `0x` will be considered a window ID to be focused Err z3bra.org 70 i+directly. It will also change the border of all the inactive windows, and the Err z3bra.org 70 i+active window. I use this script to cycle between them: Err z3bra.org 70 i+ Err z3bra.org 70 i+ # cycle through windows Err z3bra.org 70 i+ alt {, + shift} + tab Err z3bra.org 70 i+ vroum {next, prev} Err z3bra.org 70 i+ Err z3bra.org 70 i+### groaw Err z3bra.org 70 i+ Err z3bra.org 70 i+This is my "group" manager (think of it as workspaces on steroid). By Err z3bra.org 70 i+default, new windows are not assigned any groups. Without much explaning how Err z3bra.org 70 i+each flag works, I just need it to perform 3 tasks: Err z3bra.org 70 i+ Err z3bra.org 70 i+1. add the current window to a specific group Err z3bra.org 70 i+2. toggle visibility state of a specific group Err z3bra.org 70 i+3. remove current window from all groups Err z3bra.org 70 i+ Err z3bra.org 70 i+This result in the following entries: Err z3bra.org 70 i+ Err z3bra.org 70 i+ # add window to a group Err z3bra.org 70 i+ super + shift + {1,2,3,4,5} Err z3bra.org 70 i+ groaw -d all; \ Err z3bra.org 70 i+ groaw -a {1,2,3,4,5} Err z3bra.org 70 i+ Err z3bra.org 70 i+ # toggle groups' visibility Err z3bra.org 70 i+ super + {1,2,3,4,5} Err z3bra.org 70 i+ groaw -t {1,2,3,4,5} Err z3bra.org 70 i+ Err z3bra.org 70 i+ # remove window from all groups Err z3bra.org 70 i+ super + Backspace Err z3bra.org 70 i+ groaw -d all Err z3bra.org 70 i+ Err z3bra.org 70 i+### focus Err z3bra.org 70 i+ Err z3bra.org 70 i+A script I'm really proud of! It focus windows besed on their cardinal Err z3bra.org 70 i+positions. It takes exactly 4 different arguments: Err z3bra.org 70 i+ Err z3bra.org 70 i+ north Err z3bra.org 70 i+ ^ Err z3bra.org 70 i+ | Err z3bra.org 70 i+ west <---+---> east Err z3bra.org 70 i+ | Err z3bra.org 70 i+ v Err z3bra.org 70 i+ south Err z3bra.org 70 i+ Err z3bra.org 70 i+It will then focus the nearest window in the given direction (using top/left Err z3bra.org 70 i+edge of the window) It's bound like so Err z3bra.org 70 i+ Err z3bra.org 70 i+ # select windows using directions Err z3bra.org 70 i+ alt + {left,down,up,right} Err z3bra.org 70 i+ focus {west, south, north, east} $(pfw) Err z3bra.org 70 i+ Err z3bra.org 70 i+### corner Err z3bra.org 70 i+ Err z3bra.org 70 i+There's nothing special about it. It put the window in the corner passed as Err z3bra.org 70 i+argument (Top-Left, Top-Right, Bottom-Left, Bottom-Right, MiDdle) Err z3bra.org 70 i+ Err z3bra.org 70 i+ # move windows to corners Err z3bra.org 70 i+ super + {y,u,b,n,g} Err z3bra.org 70 i+ corner {tl, tr, bl, br, md} $(pfw) Err z3bra.org 70 i+ Err z3bra.org 70 i+### fullscreen Err z3bra.org 70 i+ Err z3bra.org 70 i+Set a window in fullscreen mode (change its size to the size of the monitor, and Err z3bra.org 70 i+remove borders. The previous position/size of the window is saved to a file, so Err z3bra.org 70 i+when you disable fullscreen mode, or move another window in fullscreen, the Err z3bra.org 70 i+window takes its old position back Err z3bra.org 70 i+ Err z3bra.org 70 i+ # set window fullscreen Err z3bra.org 70 i+ super + x Err z3bra.org 70 i+ fullscreen $(pfw) Err z3bra.org 70 i+ Err z3bra.org 70 i+DEALING WITH EVENTS Err z3bra.org 70 i+------------------- Err z3bra.org 70 i+ Err z3bra.org 70 i+The above only applies to existing windows. But when a new window gets created, Err z3bra.org 70 i+I need to run a few commands against it, to integrate it to my workflow. This is Err z3bra.org 70 i+what `wew` is for. It prints X events to stdout, and the window ID the event Err z3bra.org 70 i+applies to. For example: Err z3bra.org 70 i+ Err z3bra.org 70 i+ 16:0x000c00ea Err z3bra.org 70 i+ 19:0x000c00ea Err z3bra.org 70 i+ Err z3bra.org 70 i+Event number 16 is "window creation", 19 is "mapping request". I have a parser Err z3bra.org 70 i+script that will perform different actions depending on the fired event (it's Err z3bra.org 70 i+called `yawee`, I like weird names): Err z3bra.org 70 i+ Err z3bra.org 70 i+ Err z3bra.org 70 i+ #!/bin/sh Err z3bra.org 70 i+ Err z3bra.org 70 i+ while IFS=: read ev wid; do Err z3bra.org 70 i+ case $ev in Err z3bra.org 70 i+ # window creation: center window on the screen (except docks, menus or similar) Err z3bra.org 70 i+ 16) wattr o $wid || corner md $wid ;; Err z3bra.org 70 i+ Err z3bra.org 70 i+ # mapping requests: just set a special border for docks, menus and Err z3bra.org 70 i+ # similar. Focus other windows Err z3bra.org 70 i+ 19) wattr o $wid \ Err z3bra.org 70 i+ && chwb -s 2 -c 0x323232 $wid \ Err z3bra.org 70 i+ || vroum $wid ;; Err z3bra.org 70 i+ Err z3bra.org 70 i+ # when a window gets deleted, focus another one Err z3bra.org 70 i+ 18) wattr $(pfw) || vroum prev 2>/dev/null;; Err z3bra.org 70 i+ Err z3bra.org 70 i+ # Focus windows when the mouse cursor enter them Err z3bra.org 70 i+ 7) wattr o $wid || vroum $wid ;; Err z3bra.org 70 i+ esac Err z3bra.org 70 i+ done Err z3bra.org 70 i+ Err z3bra.org 70 i+In my `$HOME/.xinitrc`, it's started as: Err z3bra.org 70 i+ Err z3bra.org 70 i+ wew | yawee & Err z3bra.org 70 i+ Err z3bra.org 70 i+Pretty straighforward :) Err z3bra.org 70 i+ Err z3bra.org 70 i+USING THE MOUSE Err z3bra.org 70 i+--------------- Err z3bra.org 70 i+ Err z3bra.org 70 i+Nobody's perfect. I use the mouse from time to time to manage my windows. It is Err z3bra.org 70 i+sometimes more efficient to get a window out of your way quickly, or resize one Err z3bra.org 70 i+approximatively. Err z3bra.org 70 i+ Err z3bra.org 70 i+For this purpose, I STILL use sxhkd! Baskerville did an amazing job with this Err z3bra.org 70 i+software, as it support integer replacement of the mouse coordinate Err z3bra.org 70 i+ Err z3bra.org 70 i+ # move windows with the mouse: Err z3bra.org 70 i+ super + !button{1,3} Err z3bra.org 70 i+ {wmv, wrs} -a %i %i $(pfw) Err z3bra.org 70 i+ Err z3bra.org 70 i+As simple as that! Err z3bra.org 70 i+ Err z3bra.org 70 i+MISCELLANOUS Err z3bra.org 70 i+------------ Err z3bra.org 70 i+ Err z3bra.org 70 i+For eye candy purpose, I wrote a `pulsar` script, to make my currently active Err z3bra.org 70 i+window standout. It make the window's border "pulse" like in the following Err z3bra.org 70 i+video: http://raw.z3bra.org/dev/random/wall-border.webm. It uses a `$HOME/.colors` Err z3bra.org 70 i+file containing the colors to be used for the gradient. It will then run `chwb` Err z3bra.org 70 i+at a regular interval to change the current window's borders. Err z3bra.org 70 i+ Err z3bra.org 70 i+ Err z3bra.org 70 i+That's pretty much it! If you have any question, do not hesitate to ask. Err z3bra.org 70 i+Also, sorry for the huge wall of text, I was trying to be as precise as Err z3bra.org 70 i+possible. Err z3bra.org 70 i+ Err z3bra.org 70 i+As a bonus, to congratulate you from reading it all, here is a video from my Err z3bra.org 70 i+actual workflow with this setup (writing my latest blogpost: Err z3bra.org 70 i+[(grab some popcorns, it's 57 minutes long)](http://raw.z3bra.org/dev/random/monochromatic-0x0017-writeup.webm) Err z3bra.org 70 1diff --git a/2015/04/the-wrong-sysadmin.txt b/2015/04/the-wrong-sysadmin.txt /scm/monochromatic/file/2015/04/the-wrong-sysadmin.txt.gph z3bra.org 70 it@@ -0,0 +1,170 @@ Err z3bra.org 70 i+# [The wrong sysadmin](#) Err z3bra.org 70 i+## — 28 April, 2015 Err z3bra.org 70 i+ Err z3bra.org 70 i+*NOTE: This was replicated from the [Unix Err z3bra.org 70 i+Diary](http://nixers.net/showthread.php?tid=1539&pid=11836#pid11836) thread at Err z3bra.org 70 i+[http://nixers.net](http://nixers.net)* Err z3bra.org 70 i+ Err z3bra.org 70 i+Dear Unix diary, Err z3bra.org 70 i+ Err z3bra.org 70 i+today I've been a bad sysadmin. Err z3bra.org 70 i+It just happened. I host my own git repository, and earlier this evening I was working on my crux port tree, when I decided to commit and push my work. But this time, something went wrong and git didn't let me push any reference. Amongst all the messages returned by git, I saw this one: Err z3bra.org 70 i+ Err z3bra.org 70 i+ remote: fatal: write error: No space left on device Err z3bra.org 70 i+ Err z3bra.org 70 i+Fucking shit. I instantly imagine what's happening: my /var partition wasn't correctly sized upon creation. This is where I host my website, gopherhole, git repo, pictures, videos, ... Every 'production' service. And after serving me well for several years, it's now full. Err z3bra.org 70 i+ Err z3bra.org 70 i+Hopefully, I had setup all my partitions on top of LVM, and let like 200GiB available, just in case things go wrong. And they did. Err z3bra.org 70 i+ Err z3bra.org 70 i+So here am I, staring at my red prompt, typing a few commands: Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# df -h Err z3bra.org 70 i+ Filesystem Size Used Available Use% Mounted on Err z3bra.org 70 i+ mdev 1.0M 0 1.0M 0% /dev Err z3bra.org 70 i+ shm 499.4M 0 499.4M 0% /dev/shm Err z3bra.org 70 i+ /dev/dm-1 4.0G 797.9M 3.2G 20% / Err z3bra.org 70 i+ tmpfs 99.9M 208.0K 99.7M 0% /run Err z3bra.org 70 i+ cgroup_root 10.0M 0 10.0M 0% /sys/fs/cgroup Err z3bra.org 70 i+ /dev/sda1 96.8M 14.5M 77.3M 16% /boot Err z3bra.org 70 i+ /dev/mapper/vg0-var 50.0G 50.0G 20.0K 100% /var Err z3bra.org 70 i+ /dev/mapper/vg0-home 100.0G 12.9G 85.2G 13% /home Err z3bra.org 70 i+ /dev/mapper/vg0-data 600.0G 346.7G 252.1G 58% /data Err z3bra.org 70 i+ tmpfs 499.4M 0 499.4M 0% /tmp Err z3bra.org 70 i+ tmpfs 499.4M 32.4M 467.0M 6% /home/z3bra/tmp Err z3bra.org 70 i+ /dev/mapper/vg0-data 600.0G 346.7G 252.1G 58% /var/lib/mpd/music Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# mount | grep /var Err z3bra.org 70 i+ /dev/mapper/vg0-var on /var type xfs (rw,relatime,attr2,inode64,noquota) Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# lvs Err z3bra.org 70 i+ LV VG Attr LSize Err z3bra.org 70 i+ data vg0 -wi-ao---- 600.00g Err z3bra.org 70 i+ home vg0 -wi-ao---- 100.00g Err z3bra.org 70 i+ root vg0 -wi-ao---- 4.00g Err z3bra.org 70 i+ swap vg0 -wi-ao---- 1.00g Err z3bra.org 70 i+ var vg0 -wi-ao---- 50.00g Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# vgs Err z3bra.org 70 i+ VG #PV #LV #SN Attr VSize VFree Err z3bra.org 70 i+ vg0 1 5 0 wz--n- 931.41g 176.41g Err z3bra.org 70 i+ Err z3bra.org 70 i+Ok, so it's not the first time this happens, remember? You already grew your /home partition, and it went good! Just do the same with /var! It works without a reboot! Err z3bra.org 70 i+ Err z3bra.org 70 i+What was those commands again? Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# lvextend -L +20G vg0/var Err z3bra.org 70 i+ Extending logical volume var to 70.00 GiB Err z3bra.org 70 i+ 63e74d07f000-63e74d2c1000 r-xp 00000000 fd:01 8430401 /lib/libdevmapper.so.1.02: mlock failed: Out of memory Err z3bra.org 70 i+ 63e74d2c6000-63e74d4cb000 r-xp 00000000 fd:01 8430404 /lib/libdevmapper-event.so.1.02: mlock failed: Out of memory Err z3bra.org 70 i+ Logical volume var successfully resized Err z3bra.org 70 i+ Internal error: Reserved memory (9064448) not enough: used 9084928. Increase activation/reserved_memory? Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# lvs Err z3bra.org 70 i+ LV VG Attr LSize Pool Origin Data% Meta% Move Log Cpy%Sync Convert Err z3bra.org 70 i+ data vg0 -wi-ao---- 600.00g Err z3bra.org 70 i+ home vg0 -wi-ao---- 100.00g Err z3bra.org 70 i+ root vg0 -wi-ao---- 4.00g Err z3bra.org 70 i+ swap vg0 -wi-ao---- 1.00g Err z3bra.org 70 i+ var vg0 -wi-ao---- 70.00g Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# xfs_growfs -d /var Err z3bra.org 70 i+ meta-data=/dev/mapper/vg0-var isize=256 agcount=4, agsize=3276800 blks Err z3bra.org 70 i+ = sectsz=4096 attr=2, projid32bit=1 Err z3bra.org 70 i+ = crc=0 Err z3bra.org 70 i+ data = bsize=4096 blocks=13107200, imaxpct=25 Err z3bra.org 70 i+ = sunit=0 swidth=0 blks Err z3bra.org 70 i+ naming =version 2 bsize=4096 ascii-ci=0 ftype=0 Err z3bra.org 70 i+ log =internal bsize=4096 blocks=6400, version=2 Err z3bra.org 70 i+ = sectsz=4096 sunit=1 blks, lazy-count=1 Err z3bra.org 70 i+ realtime =none extsz=4096 blocks=0, rtextents=0 Err z3bra.org 70 i+ data blocks changed from 13107200 to 18350080 Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# df -h Err z3bra.org 70 i+ Filesystem Size Used Available Use% Mounted on Err z3bra.org 70 i+ mdev 1.0M 0 1.0M 0% /dev Err z3bra.org 70 i+ shm 499.4M 0 499.4M 0% /dev/shm Err z3bra.org 70 i+ /dev/dm-1 4.0G 797.9M 3.2G 20% / Err z3bra.org 70 i+ tmpfs 99.9M 208.0K 99.7M 0% /run Err z3bra.org 70 i+ cgroup_root 10.0M 0 10.0M 0% /sys/fs/cgroup Err z3bra.org 70 i+ /dev/sda1 96.8M 14.5M 77.3M 16% /boot Err z3bra.org 70 i+ /dev/mapper/vg0-var 70.0G 50.0G 20.0G 71% /var Err z3bra.org 70 i+ /dev/mapper/vg0-home 100.0G 12.9G 85.2G 13% /home Err z3bra.org 70 i+ /dev/mapper/vg0-data 600.0G 346.7G 252.1G 58% /data Err z3bra.org 70 i+ tmpfs 499.4M 0 499.4M 0% /tmp Err z3bra.org 70 i+ tmpfs 499.4M 32.4M 467.0M 6% /home/z3bra/tmp Err z3bra.org 70 i+ /dev/mapper/vg0-data 600.0G 346.7G 252.1G 58% /var/lib/mpd/music Err z3bra.org 70 i+ Err z3bra.org 70 i+Phew... I'm safe now! So what the hell was going on? I decided to investigate a bit further, to see what I should watch next time. Err z3bra.org 70 i+That's how I realised that I did a **HUGE** mistake... Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# cd /var/ Err z3bra.org 70 i+ root var# du -sh * Err z3bra.org 70 i+ 48.5G backup Err z3bra.org 70 i+ 156.7M cache Err z3bra.org 70 i+ 0 db Err z3bra.org 70 i+ 0 empty Err z3bra.org 70 i+ 228.8M git Err z3bra.org 70 i+ 5.7M gopher Err z3bra.org 70 i+ 4.5G lib Err z3bra.org 70 i+ 0 local Err z3bra.org 70 i+ 0 lock Err z3bra.org 70 i+ 7.9M log Err z3bra.org 70 i+ 0 mail Err z3bra.org 70 i+ 0 run Err z3bra.org 70 i+ 40.0K spool Err z3bra.org 70 i+ 0 tmp Err z3bra.org 70 i+ 1.1G www Err z3bra.org 70 i+ Err z3bra.org 70 i+ root var# cd backup/ Err z3bra.org 70 i+ Err z3bra.org 70 i+ root backup# du -sh * Err z3bra.org 70 i+ 12.0K bin Err z3bra.org 70 i+ 20.0K etc Err z3bra.org 70 i+ 48.5G out Err z3bra.org 70 i+ 20.0K usr Err z3bra.org 70 i+ 84.0K var Err z3bra.org 70 i+ Err z3bra.org 70 i+ root backup# mountpoint out Err z3bra.org 70 i+ out is not a mountpoint Err z3bra.org 70 i+ Err z3bra.org 70 i+ root backup# cd out/ Err z3bra.org 70 i+ Err z3bra.org 70 i+ root out# ll Err z3bra.org 70 i+ total 50841516 Err z3bra.org 70 i+ drwxr-sr-x 2 backup users 4.0K Apr 28 02:11 ./ Err z3bra.org 70 i+ drwxr-sr-x 8 backup users 4.0K Feb 2 20:24 ../ Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 5.3G Apr 25 07:43 data Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 0 Apr 25 07:43 data.0.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 12.0G Apr 26 04:37 homedir Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 12.0G Apr 22 04:43 homedir.0.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 12.0G Apr 25 05:00 homedir.1.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 44.0K Apr 26 04:42 homedir.2.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 1.2G Apr 28 02:11 production Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 1.2G Apr 21 02:10 production.0.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 1.2G Apr 22 02:11 production.1.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 1.2G Apr 23 02:11 production.2.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 1.2G Apr 24 02:11 production.3.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 1.2G Apr 25 02:12 production.4.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 0 Apr 26 02:11 production.5.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 5.3M Apr 27 02:12 production.6.BAK Err z3bra.org 70 i+ -rw-r--r-- 1 backup users 0 Apr 28 02:11 production.7.BAK Err z3bra.org 70 i+ Err z3bra.org 70 i+My backup system doesn't check wether it saves to a mountpoint or not. Shit. Err z3bra.org 70 i+For a whole week, all my backups where created in my /var partition instead of a backup USB drive meant for this purpose. And it filled it up pretty quickly. Err z3bra.org 70 i+ Err z3bra.org 70 i+My backup system send me a mail after each backup, explaining me how it went. The fact it's saving to a mountpoint or not is written in it. I just stopped checking. Silly me. Err z3bra.org 70 i+ Err z3bra.org 70 i+I realise that this issue could have been easily solved by mounting my backup disk elsewhere, then moving the files, and remounting where it should be. But I didn't. Instead, I grew a partition that didn't need to be (the backups filled 48GiB out of 50Gib allocated to /var), and this partition can't be shrinked anymore, as it's an XFS filesystem. Err z3bra.org 70 i+ Err z3bra.org 70 i+So today I learnt two things, the hard way: Err z3bra.org 70 i+ Err z3bra.org 70 i+1. Don't do anything until you know what's going on Err z3bra.org 70 i+2. Configure systems checks and READ THEM Err z3bra.org 70 i+ Err z3bra.org 70 i+I hope you'll learn from my mistakes. For now I think I'll just print this over my desktop, as a reminder: Err z3bra.org 70 i+ Err z3bra.org 70 i+ root ~# df -h /var/ Err z3bra.org 70 i+ Filesystem Size Used Available Use% Mounted on Err z3bra.org 70 i+ /dev/mapper/vg0-var 70.0G 1.5G 68.5G 2% /var Err z3bra.org 70 i+ Err z3bra.org 70 i+ Err z3bra.org 70 1diff --git a/2015/06/vomiting-colors.txt b/2015/06/vomiting-colors.txt /scm/monochromatic/file/2015/06/vomiting-colors.txt.gph z3bra.org 70 it@@ -0,0 +1,77 @@ Err z3bra.org 70 i+# [Vomiting colors](#) Err z3bra.org 70 i+## — 09 June, 2015 Err z3bra.org 70 i+ Err z3bra.org 70 i+Creating colorschemes is one of the hardest part of customizing your desktop. Err z3bra.org 70 i+The easiest way to create a new one is to start from a wallpaper made of colors Err z3bra.org 70 i+you like, and then rework it afterward. Err z3bra.org 70 i+ Err z3bra.org 70 i+the best tool for this job is without any doubt Err z3bra.org 70 i+[colors](http://git.2f30.org/colors) by sin. It uses [k-means Err z3bra.org 70 i+clustering](https://en.wikipedia.org/wiki/K-means_clustering) to extract Err z3bra.org 70 i+dominant colors from a PNG file, and is able to set those clusters in different Err z3bra.org 70 i+ways. Err z3bra.org 70 i+ Err z3bra.org 70 i+Without any further commenting, let's see how it works with this magnificent Err z3bra.org 70 i+picture, randomly taken from the internet: Err z3bra.org 70 i+ Err z3bra.org 70 i+[![bamboo.png](/img/thumb/20150609-bamboo.png)](/img/20150609-bamboo.png) Err z3bra.org 70 i+ Err z3bra.org 70 i+`colors` allow you to choose the number of clusters you want to see on the Err z3bra.org 70 i+output, so in our case, we'll output 16. It's possible that `colors` don't Err z3bra.org 70 i+output the number of clusters you asked for. You can "force" outputing empty Err z3bra.org 70 i+clusters with `-e`. Err z3bra.org 70 i+ Err z3bra.org 70 i+![default output](/img/20150609-colors0.png) Err z3bra.org 70 i+ Err z3bra.org 70 i+Then you can choose how to set your clusters (from the hue domain or pixel space Err z3bra.org 70 i+at the time of writing). Another solution when you don't get the number of Err z3bra.org 70 i+colors you asked for (in my case, I only got 12 colors with -h), is to just ask Err z3bra.org 70 i+for more, and truncate the output. It might give better colors than with `-e` Err z3bra.org 70 i+sometimes. Err z3bra.org 70 i+ Err z3bra.org 70 i+![output from hue](/img/20150609-colors1.png) Err z3bra.org 70 i+![output from pix](/img/20150609-colors2.png) Err z3bra.org 70 i+ Err z3bra.org 70 i+And then you can randomize the output, if you feel in the mood! You could also Err z3bra.org 70 i+try using the [k-medians](https://en.wikipedia.org/wiki/K-medians) method, which Err z3bra.org 70 i+takes longer but provides a better output regarding the initial file Err z3bra.org 70 i+ Err z3bra.org 70 i+![output random](/img/20150609-colors3.png) Err z3bra.org 70 i+ Err z3bra.org 70 i+Try different pictures and flag combinations for better results! Err z3bra.org 70 i+ Err z3bra.org 70 i+Once you have your output of choice, you can export it as an XRDB colorscheme Err z3bra.org 70 i+with the following script: Err z3bra.org 70 i+ Err z3bra.org 70 i+ #!/bin/sh Err z3bra.org 70 i+ Err z3bra.org 70 i+ CPT=0 Err z3bra.org 70 i+ while read HEXCODE; do Err z3bra.org 70 i+ printf '*color%d: %s\n' "$CPT" "$HEXCODE" Err z3bra.org 70 i+ CPT=$(expr $CPT + 1) Err z3bra.org 70 i+ done | column -t Err z3bra.org 70 i+ Err z3bra.org 70 i+This will allow live theme trying with the following command: Err z3bra.org 70 i+ Err z3bra.org 70 i+ colors -n 16 bamboo.png | toxrdb | xrdb -merge Err z3bra.org 70 i+ Err z3bra.org 70 i+Another nice way I found to create colorscheme is by randomizing the colors from Err z3bra.org 70 i+the hue domain, resulting in a monochromatic scheme that fits entirely you Err z3bra.org 70 i+wallpaper. This works by outputing 32 colors, extracting the 16 colors in the Err z3bra.org 70 i+middle and randomizing them. this way, your colors will not be too dark or too Err z3bra.org 70 i+light. Err z3bra.org 70 i+ Err z3bra.org 70 i+![output neat](/img/20150609-colors4.png) Err z3bra.org 70 i+ Err z3bra.org 70 i+You can then make a script to change your wall every now and then, and change Err z3bra.org 70 i+the colorscheme on the fly. Your colorscheme will ALWAYS match your current Err z3bra.org 70 i+mood! Err z3bra.org 70 i+ Err z3bra.org 70 i+ Err z3bra.org 70 i+ Err z3bra.org 70 i+ Err z3bra.org 70 i+**Keep tweaking!** Err z3bra.org 70 i+ Err z3bra.org 70 i+ Err z3bra.org 70 1diff --git a/config.mk b/config.mk /scm/monochromatic/file/config.mk.gph z3bra.org 70 it@@ -25,7 +25,9 @@ PAGES = index.html \ Err z3bra.org 70 i 2014/12/so-tox-me-maybe.html \ Err z3bra.org 70 i 2015/01/you-are-the-wm.html \ Err z3bra.org 70 i 2015/02/do-you-gopher.html \ Err z3bra.org 70 i- 2015/03/under-wendys-dress.html Err z3bra.org 70 i+ 2015/03/under-wendys-dress.html \ Err z3bra.org 70 i+ 2015/04/the-wrong-sysadmin.html \ Err z3bra.org 70 i+ 2015/06/vomiting-colors.html Err z3bra.org 70 i Err z3bra.org 70 i FEEDS = rss/feed.xml Err z3bra.org 70 i EXTRA = css img vid data errors favicon.ico Err z3bra.org 70 1diff --git a/index.txt b/index.txt /scm/monochromatic/file/index.txt.gph z3bra.org 70 it@@ -1,3 +1,5 @@ Err z3bra.org 70 i+* 0x0017 - [Vomiting colors](/2015/06/vomiting-colors.html) Err z3bra.org 70 i+* 0x0016 - [The wrong sysadmin](/2015/04/the-wrong-sysadmin.html) Err z3bra.org 70 i * 0x0015 - [Under Wendy's dress](/2015/03/under-wendys-dress.html) Err z3bra.org 70 i * 0x0014 - [Do you gopher ?](/2015/02/do-you-gopher.html) Err z3bra.org 70 i * 0x0013 - [You are the WM](/2015/01/you-are-the-wm.html) Err z3bra.org 70 .