Category Archives: how2do

problems with missing link to maxima files

hey folks,

if maxima is complaining about missing files e.g. for the draw package, check your homedirectory and delete those old compiled files …

rm -rf $HOME/.maxima/binary

and then load it again … maybe it is also useful to check the workdir 😉


happy maths!

retrieve javadoc with wget

hey folks,

sometimes the API documentation is not provided in a downloadable format, so I was a little bit frustated … here is a easy wget command to download the API from a URL:

wget --recursive --no-clobber --page-requisites --html-extension --convert-links --restrict-file-names=windows --domains DOMAIN --no-parent http://DOMAIN/javadocs/

I’ve found it here!

Resizing linux filesystem without lvm


if you need to resize your virtual harddisk in your virtual guest system and you are not using LVM, then this tutorial may help you: Extending a root filesystem in Linux without LVM

Here are the important steps for fast forward how-to:

  1. expand harddisk in vmware
  2. reallocate partition table with fdisk and restart your guest
  3. resize it with resize2fs

Be aware that fdisk takes the same starting block, otherwise you will mess up your partition table!

Happy working 😉

stm32f3-discovery – unknown chip id

hey folks,

have you ever got this error message? relax, here [1] you will find further informations.
After looking up the pin information in the user manual of the discovery board I was searching for the R36 to shorten it to VDD … yeah, here it is:

r36_stm32f3so, take a screwdriver or something similiar, reset the board and start st-flash erase
et voila, it works again!


mounting a software raid-1 member

if you want to mount a raid-1 member in a external system, you should install mdadm and checkout those commands:

# Connect harddisk to auto-plugable controller/system
# Check which device name was assigned to the pluged-in harddisk
tail /var/log/syslog
fdisk -l /dev/sdb
mkdir /mnt/data
mdadm --examine /dev/sdb3
mdadm -A -R /dev/md0 /dev/sdb3
mount -o ro /dev/md0 /mnt/data
# Read, what you want to read ;)
umount /mnt/data
mdadm -S /dev/md0
# Remove the harddisk

that is it. thnx Milosz for your help and saving my time 😉

Corrupted ODS-File

I have had the exact same problem as Azman did, and he found the solution and described it here [1]. After reading his post I’ve decided to take the shortcut and install the xmlindent package first. So here is my approach:

# cp FILE.ods BACKUP_FILE.ods
# unzip -p FILE.ods content.xml | xmlindent > content.xml
# vim content.xml
# zip FILE.ods content.xml

Thanks Azman, it helped me a lot!


SATA hotplug

Have you ever hotplugged a SATA Drive? With new mainboards udev will recognize the new harddisk with no effort, but if you use older hardware maybe you should check your BIOS (switch from IDE to AHCI mode) and type following command in your shell after replacing your SATA drives:

echo "- - -" >> /sys/class/scsi_host/host[2|3|4]/scan

For more information and a safe unmount script look here:

How to cause kernel panic

Last week we have had to test a special state of a virtual instance in our new cluster at university – KERNEL PANIC 😉 So, how is the fastest was to cause it without executing malicious code? Here is the solution:

echo 1 > /proc/sys/kernel/sysrq
echo c > /proc/sysrq-trigger

Google Drive – Conditional formatting of entire rows

I was searching for a possibility to format entire rows or defined cells in condition to a formula or content of another cell. This is a really handy functionality of other spreadsheet programs. So I thought it should also be possible in Google Drive … yeah, but only with a selfwritten function. Here [1] I found the first hints and with the API [2] I finished mine:

function onEdit() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Issues'); // Change to your own
var rows = sheet.getRange('a1:c');
var numRows = rows.getNumRows();
var values = rows.getValues();

for (var i = 0; i <= numRows - 1; i++) {
var n = i + 1;
if (values[i][2] == 'finished') {
sheet.getRange(n + ':' + n).setBackgroundColor('white');
sheet.getRange(n + ':' + n).setFontColor('lightgrey');
else if (values[i][2] == 'new') {
sheet.getRange(n + ':' + n).getCell(1,2).setBackgroundColor('yellow');
sheet.getRange(n + ':' + n).setFontColor('black');
else if (values[i][2] == 'workingOn') {
sheet.getRange(n + ':' + n).getCell(1,2).setBackgroundColor('red');
sheet.getRange(n + ':' + n).setFontColor('black');
else {
sheet.getRange(n + ':' + n).setBackgroundColor('white');
sheet.getRange(n + ':' + n).setFontColor('black');

function onOpen() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheet = ss.getSheetByName('Issues'); // Change to your own
var sortRange = sheet.getRange('a2:c');
sortRange.sort([{column: 1, ascending: true}, {column: 3, ascending: true}]);

Hope it helps you too!