Simple pomodoro script

This is a very basic pomodoro script I am using to avoid getting in a fixed position for hours at a time: <pre lang="shell"> #!/bin/bash UNIT=5 UNIT_CNT=5 PAUSE=6 notify-send -i clock "Starting interval..." for i in $(seq $UNIT_CNT); do sleep ${UNIT}m let c=$i*$UNIT notify-send -i clock "$c minutes" done (for i in $(seq $PAUSE); do let c=$PAUSE-$i+1; echo -n "Pause ${c}m"; echo -e '\f'; sleep 1m; done; echo -e '\f'; echo "Work";) | sm -

December 22, 2016 · len

Simple hdmi activate script

This is a simple script I bound to ‘meta+F7’ to activate a second hdmi display I am using: <pre lang="shell"> INTERNAL=eDP1 EXTERNAL=HDMI2 LOCK=/tmp/${EXTERNAL}.on disper -l | grep $EXTERNAL function on { disper -e -d $INTERNAL,$EXTERNAL -r 1920x1080,1920x1080 touch $LOCK } function off { disper -s -d $INTERNAL -r auto rm -f $LOCK } if [ $? -eq 1 ]; then #there is no EXTERNAL, run single command off elif [ -f $LOCK ]; then off else on fi

December 22, 2016 · len

Ubuntu 16.04

I’we used ubuntu since edgy days and migrating from gentoo. Things got better each time, until they started getting worse or until I started to expect not to have to fix and patch each time. So now I don’t feel like giving any impression, just a list of bugs: sound is sometimes not working after reboot. This is due to the fact that the sound card order changes. One needs to add: options snd-hda-intel id=HDMI index=-2 in /etc/modprobe....

May 25, 2016 · len

LUKS disk encryption with usb key on ubuntu 16.04

The goal is to create an encrypted device which gets automatically unlocked using an usb key. Updated on 20160521 for ubuntu 16.04 which creates a lot of problems. Create the key on the usb drive A good idea is to put the key on the usb drive in such a way it’s not obvious that is a key. Usually on the usb drive there is a 512 bytes MBR (1 sector) and then up to 32 other sectors until the first partition....

January 11, 2016 · len

Oracle 11g release 2 XE on Ubuntu 14.04

There are many, many links, threads, bugs and discussions related to this since oracle 11g installation is no longer breeze at it was the case with oracle 10g, at least on Ubuntu. This is my short, minimal list of things to do to have oracle running on Ubuntu 14.04 12.04. Last updated 2014-05-01, install on 14.04 Last updated 2013-12-25, install on 12.04.3. 0. backup. If you have a previous oracle install backup your databases with expdp....

May 2, 2014 · len

CD backup

Since my last laptop with a working CD drive is dying this a simple script which does the following ops once the CD is inserted and auto-mounter: finds the mount point copies the files ejects the CD <pre lang="bash">cd "$(cat /proc/mounts | grep iso9660 | cut -d' ' -f2 | sed -e 's#\\040# #g')" && cp * /media/backup/data/ && cd && eject /dev/sr0

March 7, 2014 · len

Old laptop, broken charger, limited frequency

I have an old laptop with a broken charger. The laptop works on the charger but it does not charges the battery. This should not be a problem since the battery is broken also. However I’ve noticed the laptop is very slow. After further investigation I noticed that the cpu maxfreq is always equal the the low frequency no matter the governor: cat cat /sys/devices/system/cpu/cpu0/cpufreq/cpuinfo_max_freq I installed cpufreq and tried setting the governor to performance, no luck....

January 2, 2014 · len

My new laptop is a … Tuxedo

There is a cabinet in my workplace which contains 5 Dell laptops. Now there will be a 6th and probably last Dell laptop going to that cabinet since my new laptop is not a Dell anymore. And this is not for lack of trying. And I’ve tried also Acer, Asus, Lenovo, even Toshiba. This was part of the now standard 3 year cycle of laptop renewal: make a list of requirements, search for a few weeks, get mad, search again, compromise, buy a laptop....

December 25, 2013 · len

A few notes about external hdd encryption

When storing your backups on an external drive you occasionally take with you it is a very good idea to encrypt your backups. Here are some personal conclusions after trying 2 different solutions. eCryptFs Advantages (reasons to choose): stacked – can be used on top of another filesystem, even on top of NTFS allocated on the fly – no need to pre-allocate your space, it will be allocated on the fly....

December 7, 2013 · len

Checking badblocks in soft raid setup

Use case 2 hdd in raid 1 using md, smartd signals: Device: /dev/sda [SAT], 8 Currently unreadable (pending) sectors Actions 1. Run smartctl on each disk, wait and check the results smartctl -t long /dev/sda smartctl -t long /dev/sdb #wait a looong time smartctl -l selftest /dev/sda smartctl -l selftest /dev/sdb sdb is ok but sda confirms the smartd error: # 2 Extended offline Completed: read failure 60% 4832 2519297024 2....

January 22, 2013 · len