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!

[1] http://blog.my1matrix.org/2011/12/libreoffice-tragedy-corrupted-ods-file.html

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: http://www.makestuff.eu/wordpress/sata-hotplug-in-ubuntu/

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!

[1] http://productforums.google.com/forum/#!topic/docs/t6xPcOkjNbQ/discussion
[2] https://developers.google.com/apps-script/reference/spreadsheet/spreadsheet

arch latex bug

hey folks!

Have you got this nasty error message?

This is pdfTeX, Version 3.1415926-2.5-1.40.14 (TeX Live 2013/Arch Linux) restricted \write18 enabled.---! /var/lib/texmf/web2c/pdftex/latex.fmt doesn't match pdftex.pool(Fatal format file error; I'm stymied)

Then you should do the following:

… copying the *.pacnew files in /etc/texmf over the non .pacnew files and running fmtutil –all fixes the issue.

Found here: https://bbs.archlinux.org/viewtopic.php?id=166163

Grub 2 and the VGA parameter

It was annoying to have only a resolution of 640×480 in the virtualbox instance of my new debian virtual instance. So I have had to do something. Here [1] I found the solution of the already well known problem:

In Grub2 the vga= parameter is deprecated.

To set a screen resolution for your console you can do the following log in as root

edit /etc/default/grub uncomment the GRUB_GFXMODE=640×480 and change the resolution to something you can use e.g. 1024×768
Add the line
GRUB_GFXPAYLOAD_LINUX=keep
to the file to have the same resolution at the Linux console. You do not edit the 00_header file as some suggest you need to do.

run update-grub

run reboot to confirm that your changes worked!

[1] https://wiki.debian.org/GrubTransition

how to restart udev

hey folks,

if you need to refresh your /etc/udev/rules.d/config.rule and for example add some embedded devices, take your editor and do so:

#EnergyMicro J-Link Device
SUBSYSTEM=="usb", ATTRS{idVendor}=="1366", ATTRS{idProduct}=="0101", GROUP="users", MODE="0666"

if you don’t want to restart your service or reboot your machine to enable your changes, here is a really handy command:

udevadm control --reload

happy coding and developing!

http://www.freedesktop.org/software/systemd/man/udevadm.html