Category: Uncategorized

  • Unbricking WRT54G

    A quick guide how to ‘fix’ bricked WRT54G. I managed to brick it by installing OpenWRT firmware (attitude adjustment v12.09). Unfortunately this router doesn’t have enough memory to handle v12.09. My attempts to upload a new firmware trough ssh bricked the router. To unbrick it I first did 30 30 30 reset. Powered router hold […]

  • Net watchdog for OpenWrt

    Lately, my cable connection gets disconnected too often. To automate reconnection, I installed a simple watchdog script that pings outside address and if there is no response it restarts router network. It’s not most efficient, since only WAN needs to be restarted, but it does the job. Here is a simple watchdog script. #!/bin/sh n=0 […]

  • Replacing failed disk in software RAID

    mark the drive as failed first mdadm /dev/mdX -f /dev/sdYX Power down and physically replace faulty drive. Make sure the partitions are properly aligned, as in http://www.ibm.com/developerworks/linux/library/l-4kb-sector-disks/#tools Boot and partition new drive, and if you want to partition the new drive similar as others, you can do it with.. sfdisk -d /dev/sdX | sfdisk /dev/sdY mdadm […]

  • Windows 7 boot fix

    Win7 unable to boot. After BIOS, computer restarts. Seems like boot sector error. Linux utils unable to find anything wrong. Boot win7 installation disk and select REPAIR, go to command prompt and run following instructions. bootrec.exe /fixboot bootrec.exe /fixmbr

  • Large HD reminder

    Prepare hard drive with parted. It is recommended to ask parted to use optimal partition alignment: parted -a optimal /dev/sdX (parted) help (parted) print (parted) mklabel gpt (parted) mkpart primary ext4 0% 100% (parted) name 1 storage_01 (parted) print (parted) quit create filesystem mkfs.ext4 /dev/sdX1 To remove hot-plugged SATA disk, first unmount then suspend disk […]

  • Grub2 on gentoo

    Grub2 is finally declared as stable in gentoo portage. While optional, migration from grub:0 to grub2 is straightforward. Installation of grub2 is done in four steps. First inspect your existing grub.conf file and make sure naming is correct. Grub2 has strict naming requirements and wants kernel images to be named as kernel-${version} or vmlinuz-${version} and […]

  • Partitioning of 3T hard drives

    use parted with parted /dev/sdX Most disks on x86/amd64 are prepared using an msdos label, thus supporting partitions up to 2T in size. To create larger partitions (2 TB and more), one must use a gpt label (the GUID Partition Type). With parted, this can be accomplished with mklabel gpt: (parted) help (parted) print (parted) […]

  • WebApp Error: : [Errno 24] Too many open files

    Most likely the number of file descriptors not enough. Check for number of file descriptors with ulimit -a ulimit -n Increase in /etc/security/limits.conf username hard nofile 3072 username soft nofile 2048 Another things to do, if above solution doesn’t help. As suggested at slashdot, increase number of max open connections in sysctl.conf, kernel headers and […]

  • Mounting USB devices in KDE

    After updating KDE to 4.9.5 my system stopped auto mounting external USB devices. The fix was to change udisk policy in /usr/share/polkit-1/actions/org.freedesktop.udisks.policy <action id=”org.freedesktop.udisks.filesystem-mount”> <description>Mount a device</description> <message>Authentication is required to mount the device</message> <defaults> <allow_any>no</allow_any> <allow_inactive>yes</allow_inactive> <allow_active>yes</allow_active> </defaults> </action>

  • Linux command-line cheatsheet

    Using help apropos topic_name Show list of manual pages related to topic man topic_name Show manual page for specified topic info topic_name Show info page for specified topic (sometimes easier to read than man) whatis command_name One-line summary for command whereis command_name Displays information where binary command is located; alternatively: “type command_name”