Posts Tagged ‘ubuntu’

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:

#!/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 -

Simple hdmi activate script

This is a simple script I bound to ‘meta+F7’ to activate a second hdmi display I am using:

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

 

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:

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.

(more…)

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
cd "$(cat /proc/mounts | grep iso9660 | cut -d' ' -f2 | sed -e 's#\\040# #g')" 
&& cp * /media/backup/data/ && cd && eject /dev/sr0

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. At first the governor was always getting back to ondemand until I realized to stop the ondemand service (update-rc.d remove -f ondemand). Then, even with the performance governor the frequency was never getting as high as it should. Finally after a lot of research I found the following lines which added to /etc/rc.local fixed everything:

echo 1 > /sys/module/processor/parameters/ignore_ppc
echo -n 2000000 > /sys/devices/system/cpu/cpu0/cpufreq/scaling_max_freq
echo -n 2000000 > /sys/devices/system/cpu/cpu1/cpufreq/scaling_max_freq

Of course you should use your max frequency from /sys/devices/system/cpu/cpu1/cpufreq/scaling_available_frequencies

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. The compromise part seemed greater each time as there are fewer and fewer configurable options anymore. Yes, I understand, some research group knows better what laptop everyone needs but I am a stubborn person and my requirements where the following this time:

  •  16G, 120SSD + 500GHDD
  • 1080p, >= 14”, matte IPS
  • dual-band wi-fi ac/n
  • usb3
  • i7 4****
  • < 2.5kg

(more…)

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.

(more…)

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
 (more…)

Checking badblocks with smartmontools

… and some other observations. Warning: use at your own risk!

I used to keep some of my photo backups on an external Seagate 500G drive which I also use for travel. Today however as I tried to access it I noticed some problems so I quickly ran:

smartctl -t long /dev/sdb
#followed by
smartctl -l selftest
#the result
Extended offline    Completed: read failure       90%       109         414996448 (more…)