Sunday, December 21, 2014

Adding pagespeed module to nginx 1.7.8 on Ubuntu 14.04

Wanted run fresh nginx version with Google Pagespeed on Ubuntu 14.04.

Saturday, December 20, 2014

Installing Ubuntu 14.04 LTS with Cacti 0.8.8c

Ubuntu provides only Cacti 0.8.8b so we need to compile our own package with 0.8.8c after installing OS.

Virtualizing old Centos 5 server with software RAID disks

VMware Converter does decent job converting old physical servers to virtual machines, but it refuses to do anything to servers using software RAID. I really don't get why such arbitary limitation is in place. It really doesn't matter if physical server used RAID, software or not, because everything is copied by Converter on file lever rather than block level.

Remapping bad sectors with Linux and dd

I have one faulty non-RAID disk on server which I can't replace right now so I wanted to see if I could mask problems by manually triggering bad sector reallocation.

Sunday, December 14, 2014

Using Sonera 6rd IPv6 with Cisco IOS router

Sonera recently started offering 6rd tunnels to their customers in Finland. Based on this Comcast example it was easy to get Sonera 6rd up with Cisco 892 running IOS 15.5(1)T.

Saturday, December 13, 2014

Prefer IPv4 over IPv6 on CentOS 6

To prefer IPv4 (A) addresses over IPv6 (AAAA) on CentOS 6 you need to add new file named /etc/gai.conf with following content. Last line is what controls if IPv4 or IPv6 should be tried first.

Enable UserDir with Centos 6 and SELinux

I had unfortunate opportunity to play with RedHat / Fedora / CentOS distribution today. I have to say that as much as I hate Ubuntu, CentOS is even worse than it was few years ago when CentOS5 was still current.

And now we're ignoring RHEL7 / CentOS7 where headless server installer requires GUI that's optimized for touch screen and tries to imitate Ipad. Recommended solution? Use VNC to connect installer. Aargh! I should probably have Ipad to run that VNC client - for improved user experience you know.

Wednesday, December 10, 2014

Remote conversion of 64-bit CentOS 6.5 to 64-bit Ubuntu 14.04

For 32-bit source to 64-bit see my older post.

Old install was using software RAID-1, but did not have LVM. Small 200MB /boot partition, 8GB swap and rest as one root partition. We're redoing it completely so what it used to be doesn't really matter. All existing data on root will be lost.

Oddities of dnsmasq when used with IPv6 resolvers

# dnsmasq --version
Dnsmasq version 2.68  Copyright (c) 2000-2013 Simon Kelley
Compile time options: IPv6 GNU-getopt DBus i18n IDN DHCP DHCPv6 no-Lua TFTP conntrack ipset auth

# md5sum dnsmasq*
8a704b6aa977df9485b3faf940cc5e35  dnsmasq_2.68-1_all.deb
60bafb9b863671bb02595505a447270c  dnsmasq-base_2.68-1_amd64.deb

There was odd "[icmp6 sum ok] ICMP6, destination unreachable, unreachable port" going out from my server every time DNS reply was received. Turns out it was because dnsmasq IPv6 support is buggy.

Sunday, December 07, 2014

Headless Ubuntu 14.04 Server with full disk encryption, remote unlock, software RAID, LVM and EFI for over 2TB disk support

Headless Ubuntu 14.01 LTS server with full disk encryption, remote unlock over SSH, software RAID, LVM and support for over 2TB disks with EFI and BIOS MBR boot. That's what this post is about. Oh, and pics are at the end.

Thursday, December 04, 2014

Cisco EEM applet to monitor and repair broken DHCP leases

Dirty hack to renew DHCP lease on Cisco 881 if Internet access is lost. This can happen when Cisco has valid DHCP lease from ISP and then cable modem or DSL router is power cycled but switch between Cisco and upstream device keeps link-state up. Options are either to fix it manually (pull cable / change config / reboot Cisco) or hack something like below. I'm also pinging over VPN tunnel to Intranet as it would be shame to break this due Level 3 and Google blocking ICMP which might happen one day.

/31 aka 255.255.255.254 netmask with Windows

Windows GUI prevents you from setting this with helpful error message of "All of the bits in the host address portion of the IP address are set to 0". IP stack seems to be fine with /31 networks so just set it from CLI.

netsh interface show interface

netsh interface ip set address name="Local Area Connection" source=static addr=10.71.219.238 mask=255.255.255.254 gateway=10.71l.219.239

Monday, December 01, 2014

Moving VMs between datastores with free ESXi (and very fast GhettoVCB restores)

Trying to move virtual machine between datastores (local or remote) can be painful without vCenter and SVmotion. Easy and fast way is to use traditional VI Client to move contents of virtual machine directory via datastore browser (Move To feature). Processing stays within ESXi and goes quickly. VMware converter could also be used, but it's SLOOOOOW and everything goes via management PC which is dumb design.

GhettoVCB restores aren't fastest either. This is quite obvious workaround, but I have to admit didn't realize this until today. Since backups are NFS mounted I can simply import VMX file from backup directory using datastore browser. Yes, this will result in changes to backup which is not that great, but at least it's quick - even biggest VM can be restored in couple minutes. And that issue with changes to backup could be easily solved with ZFS snapshots.

Monday, November 24, 2014

Making Intel 910 PCIe SSD bootable

Recently market has been flooded with 400GB and 800GB versions of Intel 910 Enterprise PCIe SSD priced just one tenth of original cost. Downside of this device is its inability to boot requiring separate SSD for system files and software RAID0 support from OS. Both obvious downsides for my intended use with ESXi.

Saturday, November 22, 2014

Topfield TF500PVRc with TF510PVRc or TF520PVRc firmware

Latest firmware for Topfield TF500PVRc is 3.56 from 2010 while for TF510PVRc and TF520PVRc there's 3.96 from 2013.

Can you flash Topfield TF510PVRc / TF520PVRc firmware to older TF500PVRc? Yes, yes you can after changing SysID with VegaPack and it will start and appear to work just fine. However since TF500PVRc has only 32MB RAM system will quickly run out of memory. First menus will disappear and soon entire system crashes.

Flashing newer model firmware "works" only for DVB-C models. In DVB-T models (TF500PVRt / TF510PVRt / TF520PVRt) tuner was changed and while OS will run it won't be able to receive any channels.

Thursday, November 20, 2014

Buffalo WLAE-AG300N, OpenWrt Barrier Breaker and auto power on

While looking for something else I spotted Buffalo WLAE-AG300N "range extender" in IT "treature room". Noticing it's OpenWrt supported decided to give it try.

Sunday, November 16, 2014

Cisco CSR1000v 3.13 finally working on VMware ESXi 5.1

After many, many months of waiting Cisco finally managed to build new version of CSR1000v 3.13 that is compatible with VMware ESXi 5.1. Another quiet release without release notes. As with earlier 3.13 versions this new 03.13.01S build is available only in OVA format without purchasing license (csr1000v-universalk9.03.13.01.S.154-3.S1-ext.ova). Not to worry as you can extract ISO image and even BIN images if needed for upgrading older install from OVA.

If you're coming from 3.12 or older with eval license (which allowed creation of eval license locally) you'll need new licenses. Usual two month license is available from Cisco portal but it's extra step compared to 3.12. 


Another difference is performance levels for unlicensed and eval licensed modes. Unlicensed 3.12 is 2,5Mbit/s, eval licensed 3.12 is 50Mbit/s, unlicensed 3.13 is 0,1Mbit/s and eval licensed 3.13 is 10Gbit/s.


Wednesday, November 05, 2014

Upgrading HP Proliant firmware is easy... NOT!

Server in question was HP Proliant DL320 G6 from 2010 without any firmware upgrades ever made. Those old versions have multiple known issues, both usability, stability and hardware component compatibility related. Downtime required to perform these steps will be around 3 hours.

Thursday, October 09, 2014

LTE 450MHz performance

Seems Ukkomobile has fixed their provisioning setup. LTE network itself came up last week, but only DNS traffic was allowed and all tcp/80 traffic was hijacked to infinite 302 redirect loop between www.ukkoverkot.fi and www.ukkomobile.fi.

Saturday, September 27, 2014

Cisco CSR1000v 3.13 crashes on VMware ESXi 5.1

Initial version of Cisco CSR1000v 3.13 (csr1000v-universalk9.03.13.00.S.154-3.S-ext) was broken and kept crashing while booting on VMware ESXi 5.1, but apparently does work on ESXi 5.5. Cisco has silently replaced it with 3.13S0a version (csr1000v-universalk9.03.13.00a.S.154-3.S0a-ext) without providing any release notes or even updating filedates. Which is exactly as broken as old one - stuck in infinite reboot loop.

Download is here, but for some reason for 3.13 only OVA packaged one is available after free registration. If you need ISO simply unpack OVA with 7zip and use ISO you can find inside for install.

And then it will fail. Perhaps something to do with crazy nested virtualization CSR uses. Thanks guys.

Monday, September 01, 2014

Export all SMTP addresses from Exchange using PowerShell

Tested with Exchange 2010. You'll need Exchange Management shell but no need for exchange admin rights.

Get-Recipient -ResultSize unlimited | Select Name -ExpandProperty EmailAddresses | Where-Object {$_.SmtpAddress -ne $null} | Select Name,SmtpAddress,IsPrimaryAddress | Export-csv -Encoding unicode -NoTypeInformation AllEmailAddress.csv

Sunday, August 31, 2014

How to change Atheros AR9xxx aka ath9k EEPROM values

One of my Atheros AR9280 minipcie cards had some odd undefined regulatory domain (0x6B) configured. This caused even latest Linux ath9k driver to break so I wanted to change it to valid regdom. Which ath9k developers think is sin and are trying to prevent people from doing, but luckily our old friend iwleeprom has Atheros support letting us to fix this.

Saturday, August 30, 2014

Modifying Huawei B593u firmware images using FMK

Nothing special here in my opionion, but I've seen few comments saying that FMK doesn't work with Huawei B593u. Just follow instructions below and you end up with normal firmware image having one important difference - you can telnet in as admin from LAN side of device.

Thursday, August 28, 2014

Inside old Motorola (Symbol) AP-5131 access point

I found couple Motorola AP-5131 802.11a/g access points today. It's old design from Symbol Technologies dating back to 2005 with manufacturing date from 2010.

Saturday, August 23, 2014

Netdisco2 on Ubuntu 14.04

Netdisco is neat tool to collect layer-2 forwarding database from switches, match MACs with layer-3 ARP table from router and present it over searchable webui.

Old "Netdisco 1" was quite horrible to setup, but it did still do its job. Recently "Netdisco 2" was released making admins life much easier and also bringing fancy new look for webui.

So here's my notes about installing new virtual machine with Netdisco 2.

Tuesday, August 19, 2014

Huapwn - Backdoor on your Huawei B593u

Public Huawei document I linked couple days ago mentioned factory diagnostics tool called "Huawei deviceLocker V0.1" that will grant access to root shell on router. I got curious on how this would actually work and came to conclusion it must be something extremely simple and insecure, it IS Huawei after all. Did some poking around /bin/web process I figured this out - it's all there in clear-text for anyone to read. And that admin password is in Huawei docs, not exactly secret either. In case you didn't realize there's no need for authentication to exploit this. Protip: Try to hide you backdoors a bit better next time.

Persistent customizations to Huawei B593u with stock firmware

Perhaps you're fairly satisfied with Huawei stock firmware but would like to fix some security problems and remove spyware installed by factory. There's fairly easy way to do this.

Saturday, August 16, 2014

Unpacking Huawei B593u compressed Broadcom CFE bootloader

Sorry, one more B593u post but felt this is worth documenting.

While hacking my way into Huawei B593u I had big problem with Huawei crippled CFE bootloader. It was not talking to me and when I finally did get it to talk to me it was only one way. All I could see was CFE> prompt after smashing ^C but nothing else.

Latest modem.bin LTE dongle firmware for Huawei B593u-12

Latest modem.bin firmwares currently available are T-Mobile customized 11.533.03.03.748 (2013-09-30) from SP105 and generic 11.433.61.00.00 (2012-12-04) from Polkomtel SP103. While these are customized for EM920u according to few forum posts I've found they work equally with Huawei USB LTE dongles such as E392 part of same MDM9200 family.

Differences of Huawei B593u and B593s

I got few B593u models and it's pretty straight forward Broadcom BCM5358 based router with Linux. As usual GPL sources were never published by Huawei crooks. LTE modem side is simply Qualcomm MDM9200 based Huawei USB dongle connected internally to Broadcom SoC over USB.

How to capture LTE WAN traffic for diagnostic purposes on Huawei B593u and not so much of security

Found this document on Huawei webpage you might be interested. It's in Microsoft Word .docx format.

http://www.huawei.com/ecommunity/3msimage/download-10060827-10000297-9bca6ae8ffa54796a5245e6650b0e607.bin?type=bbs

Serial console on Huawei B593u

Here's location of Huawei B593u TTL serial console. Settings are usual 115200 8N1.

What's inside Huawei B593u-12 LTE router?

There ain't many pictures showing innards of B593u around and even less ones with any details. This obviously needs to be fixed.

Tuesday, August 12, 2014

Well, that was easy

I think ethernet switch and wireless aren't supported by opensource drivers so even with OpenWrt booting on Huawei B593u-12 it's not much use. USB connected LTE module is not detected, my guess is that some GPIO needs to be toggled to enable it. PCA9555 GPIO expander would need some work too. Also 256MB NAND-flash is missing, only 16MB SPI flash is found.

Monday, August 11, 2014

Teaser on Huawei B539u hacking

CFE> boot -elf -tftp 192.168.1.100:openwrt-brcm47xx-mips74k-vmlinux.elf

Monday, July 28, 2014

Set Excel 2013 cell size in millimeters (or inches for those relics living in US)


  • Open new excel sheet.
  • Select desired paper size (A4 or A3... of course), orientation and set margins.
  • Open View tab.
  • Click Page Layout under Workbook Views.
  • Press Ctrl+A.
  • Open Home tab.
  • Click Format under Cells.
  • Select Row height and enter desired size with mm suffix (or "in" for rednecks)
  • Click Format under Cells
  • Select Column width and enter desired size.
  • Open View tab.
  • Click Normal under Workbook Views.
  • Done.


Saturday, July 19, 2014

SID HISTORY: AD

Last steps with fixing SID history.

SID HISTORY: Fixing file servers

File servers are easy thanks to Microsoft tool.

SID HISTORY: Fixing SQL

SQL server logins may have old SIDs. This doesn't fix them (because we didn't have this particular problem at work) but shows if there's any that need to be fixed.

SID HISTORY: Fixing Exchange

Dumping my notes about fixing SID history at work. Use at your own risk. These worked for me but won't work for you without some adjustments.

Adding aufs support to Ubuntu LTS 14.04 with 3.16-rc5 kernel

Adding aufs support to 3.16-rc5 is little different than what is was for older kernels. Below works for Ubuntu LTS 14.04.

Wednesday, July 16, 2014

Ubuntu Server 14.04 LTS with encrypted md mirrored rootfs and remote ssh unlock

This post is just to let everyone know old process described here in my earlier post still works and also survives upgrade from older Ubuntu version to 14.04 LTS.

Export Bitlocker recovery keys from AD using PowerShell

This exports list of BitLocker recovery keys from AD. Found it somewhere from web.

Wednesday, July 09, 2014

Export out-of-office (OOF) autoreplies from Exchange 2010 with Powershell

Quick and very dirty export out-of-office (OOF) autoreplies from Exchange 2010 with Powershell. 


get-mailbox -resultsize unlimited |
get-mailboxautoreplyconfiguration |
where {$_.autoreplystate -ne "disabled"} |
select identity,autoreplystate,starttime,endtime,@{NAME='InternalMessage';Expression={$_.InternalMessage -replace ("`n") -replace("</p","/<") -replace("<.*?>") -replace("&nbsp;","")  }},@{NAME='ExternalMessage';Expression={$_.InternalMessage -replace ("`n") -replace("</p","/<") -replace("<.*?>") -replace("&nbsp;","")  }} |
Export-Csv -Encoding unicode -NoTypeInformation outofoffice.csv


Collaboration Data Objects (CDO) 1.2.1 with Outlook 2010 and 2013

Many vbscripts use old Outlook / Exchange CDO components for MAPI access. Without CDO you'll get "ERROR: ActiveX component can't create object (MAPI.Session)" error message. Unfortunately CDO works only with 32-bit Outlook 2007. If you're running 32-bit Outlook 2010 or 2013 in either 32-bit or 64-bit OS following might come handy.

Wednesday, May 14, 2014

Flashing BeagleBone Black (rev B, 2GB eMMC) with Ubuntu 14.04

You're supposed to be able to use "BBB-eMMC-flasher" images to flash new OS directly from SD card. For whatever reason this sometimes fails to work. People blame power supplies which probably is one reason but not this time. In my case when trying to use BBB-eMMC-flasher image BBB started flashing all four user leds in sync without ever even attempting to flash image to eMMC.

Saturday, March 22, 2014

Ubuntu 13.10 with TCP-IR (TCP Instant Recovery / FEC) enabled kernel v3.4.83

How would FEC (Forward Error Correction) enabled TCP/IP stack for Linux sound like? Yep, I know you're interested and want it. Start by checking these two links.
http://www.ietf.org/proceedings/87/slides/slides-87-tcpm-8.pdf
http://tools.ietf.org/html/draft-flach-tcpm-fec-00

Wednesday, March 19, 2014

Digi One, PortServer etc. and double enter problem

There's annoying problem with Digi RS232 - Ethernet products (also sold BlackBox branded). Many if not most telnet clients are incompatible with their server implementation and treat single enter press as two enter presses. Incompatible clients are at least SecureCRT, Putty and one Microsoft includes with Windows. Teraterm works ok.

Saturday, January 18, 2014

Measuring temperature with OpenWrt and submitting values to EmonCMS

I'm using OpenWrt with following customizations to send temperature readings to EmonCMS. Hardware is noname Ralink RT3052 router (WR512-3GN) and Dallas DS9097U compatible USB 1-wire adapter. Main reason for going with Image Generator instead of compiling custom firmware was to keep binary and API compatibility with packages from stock OpenWrt repository. Package selection below leaves 168kB free on JFFS2 filesystem. Drop editor, Luci etc. and you'll have a lot more free. If you don't need to patch init scripts like I did due bug in WR512-3GN support you can simply install packages and apply scripts over top of official OpenWrt release flashed to your router.

Saturday, January 04, 2014

Updating Samsung SSD firmware without Windows

My attempts to update Samsung 840 EVO to new EXT0BB6Q firmware kept failing with "WDOSX Win32 subsystem: Abort from unhandled exception" error message. This seems to be due outdated FreeDOS Samsung uses. Old version is probably incompatible with newer motherboard or something.

Tuesday, December 31, 2013

XBMC 12.3, Tvheadend PVR addon, unable to open live transcode settings menu

Can't access Tvheadend "Client specific settings" to enable on-the-fly transcoding on XBMC 12.3 Frodo? 

Saturday, December 14, 2013

Connecting Samsung 9 Series 900X3C running Windows 7 x64 to Onkyo TX-NR626 amplifier using Bluetooth A2DP

After replacing incredible slow Sandisk SSD Samsung ships this model with Crucial CT240M500SSD3 and doing clean bloatware free Win7 install I noticed I couldn't connect to my Onkyo TX-NR626 using bluetooth anymore. Reason was that Microsoft doesn't provide required drivers for A2DP bluetooth profile required.

Friday, November 15, 2013

Ubuntu 13.10 x64 with emoncms

Install Ubuntu 13.10 x64 Server version with default settings and try to follow Emoncms docs. Didn't work that well, right? Well why don't you follow these instructions instead.

Thursday, November 14, 2013

Remote conversion of 32-bit CentOS 6.3 to 64-bit Ubuntu 13.10

Pretty much any Linux should be fine as long as you have suitable scratch partition for temp Ubuntu install, in this example we're re-using 6GB swap partition. Process is two step, first we do minimal 32-bit Ubuntu install over swap partition, boot system, hack it to 64-bit and finally do final 64-bit Ubuntu install over old CentOS rootfs.

Wednesday, November 06, 2013

Changing Windows 7 aero colors on the fly

I needed to change colors of Windows 7 taskbar and window decorations from command line. Quick Googlioplaza search revealed AutoIT3 example, but it was bit lacking. See updated version below.

Friday, October 04, 2013

Creating differential backups with 7-Zip

This is so great I'm shamelessly copying command lines for my own archive (aka this blog) - but also providing link to original.


Tuesday, September 24, 2013

Ubuntu and broken or missing aufs with default kernels

Aufs included in Ubuntu kernels is broken, what a surprise. In addition it has been dropped from newer kernels with claims that overlayfs does exactly same thing. It doesn't and everyone knows it except that one developer who decided it does and can't admit he made mistake. It seems aufs (and overlayfs) in Ubuntu is not really supposed to be used but only be part of install process. If so you guys shouldn't include it outside installer.. WontFix you too.

USB keyboard doesn't work during initramfs with Ubuntu 12.04 / 12.10 / 13.04 after upgrading kernel

Add "ohci-pci" to /etc/initramfs-tools/modules and run "update-initramfs -c -k all". This problem occurs because unlike other USB drivers ohci-pci is compiled as module.

Sunday, September 22, 2013

Updating Seagate ST3000DM001-9YN166 to CC4H firmware while in external USB 3.0 enclosure

Some time ago I purchased external 3TB USB 3.0 hard disks, TrekStor DataStation maxi light 3TB to be exact. It seem disk models and manufactures used by TrekStor vary, which is no surprise. Therefore I have externally identical disk enclosures with three different models of disks due making three separate purchases over few months.

Wednesday, September 18, 2013

Enable TRIM for SSD with ext4, dmcrypt and md

Depending on why you're encrypting your SSDs it might be acceptable to enable TRIM (aka discard). With this configuration observing raw content on SSDs will reveal which blocks are used and which aren't. Doesn't matter for me, but might not be same for you.

Ubuntu Server 12.04.3 / 12.10 / 13.04 / 13.10 with encrypted md mirrored rootfs and remote ssh unlock

My original plan was to boot from ZFS, but combining it with encryption and especially with mirrored disks turned out to be too troublesome. Yes, I did get it working and booting, but resulting configuration required manual fixing each time new kernel was installed. And don't even think about doing upgrade to next Ubuntu version.

Turning Dell PERC H310 to dumb biosless SAS / SATA controller

After realizing that LSI SAS1078 based controller wouldn't do what I want I ended up purchasing card from eBay, 65€ including shipping for unused, new in box Dell PERC H310. Prices are bit higher than I like, but this was acceptable knowing it will do exactly what I need. Despite trying hard card will still show up as DELL after making these changes but it's in IT-mode and accepts generic LSI firmware.

Saturday, September 14, 2013

USB booting on VMware Workstation 9 and 10

While VMware Workstation supports passthru of USB storage devices BIOS used for virtual machines is not USB boot capable.

As a workaround download Plop Boot Manager, extract plpbt.iso, mount it as CD on your VM, boot from CD and then select boot from USB. Blah. Spinning media is so yesterday.


Wednesday, September 11, 2013

Reflashing LSI MegaRAID SAS 8708ELP (SAS1078)

I wanted to use Fujitsu OEM (D2516, "LSI Logic MegaRAID SAS PCI Express(TM) ROMB") of LSI MegaRAID 8708ELP in JBOD mode, which apparently is not possible. Out of MegaRAID products only 9240-4i and 9240-8i support true JBOD. Also 9260 and 9280 series can apparently do it via MegaCLI which is another beast to master. Rest of models can only do single disk RAID0 which isn't the same thing.

Tuesday, September 10, 2013

80GB Intel X25-M G2 SSD and Secure Erase

For whatever reason after updating my Intel X25-M G2 SSD to latest firmware (dated 2011) option to do secure erase disappeared. Yes, I know all about tricks of hot plugging disks etc. Secure erasing another identical X25-M G2 on same PC visible as /dev/sdb works fine. One with latest firmware simply no longer supports it which is also confirmed by hdparm -I.

Wednesday, September 04, 2013

Execute BGInfo when IP address changes

Updates IP on your BGInfo managed desktop background image when new network connection is detected. Notices also Cisco AnyConnect VPN connections. Import XML file with SchTasks.exe.

Sunday, August 11, 2013

Updating HP elite 8200 bios without Windows

Quick dump of notes showing how to use Linux for creating bootable freedos usb stick with required files to upgrade HP elite 8200 bios.

Saturday, August 03, 2013

Gaining root shell on Huawei B593 4G LTE router

Huawei B593 has "few" security issues. If you want to play around here's some tips.

Friday, July 05, 2013

NTFS undelete on Linux

To avoid damaging filesystem with files to be undeleted I created image of entire hard disk by booting live linux on source PC from USB and then making 1:1 copy of HDD with dd.

Monday, June 10, 2013

Fixing non-bootable CentOS 5 after VMware converter P2V

Did P2V for old CentOS 5.5 i686 install and it failed to boot. Recreating initrd helped. Also see thread on VMware support forums.

Wednesday, June 05, 2013

Disappearing show desktop button on Windows quicklaunch

There's bug in some Microsoft hotfixes that causes show desktop button to disappear from Win XP / Win 2003 quicklaunch bar.

Run "regsvr32 /n /i:U shell32" and logoff+logon to get it back.

Saturday, April 20, 2013

Handbrake auto-crop and channel logos

Same as old post except with updated patch for fresh Handbrake SVN version.

Handbrake does good job auto-cropping black bars from source and calculating resulting aspect ratio. However if you're encoding digital TV recordings it's common to have channel logo on otherwise black portion of image.

Saturday, April 13, 2013

Friday, April 12, 2013

Linux and unwanted disk spinups

Some process was spinning my suspended USB disks back up every few minutes which is bad, mmkay. To monitor processes accessing disks I used following commands

Tuesday, April 09, 2013

ZFS using USB3 disks

Intel Core i5-2400, 4GB RAM, 11 x Seagate 3TB USB hard disks connected via 4 x D-Link USB3 hubs to StarTech PEXUSB3S400 PCIe card. Ubuntu 12.04 with ZFS 0.6.1. Disks were configured as RAID-Z3 (triple parity).

write: 137438953472 bytes (137 GB) copied, 250.822 s, 548 MB/s
read:  137438953472 bytes (137 GB) copied, 197.451 s, 696 MB/s

Monday, March 18, 2013

Virtualizing headless Windows on headless Linux server

I have remote Linux server and needed to run some Windows-only utilities. Since Wine is as great as always I decided to virtualize Win7. Since remote Linux is headless not only I needed headless Windows but also headless virtualization.

Wednesday, March 13, 2013

Need faster urandom on Ubuntu?


While burn-in testing my new USB 3.0 ZFS RAID array on Ubuntu 12.04.1 I wanted to fill disks with random data. Not zeroes from /dev/zero, but random data to catch any flakey disks or USB cables. Well it quickly turned out that reading from urandom was slowing process down a lot. Since quality of randomness doesn't matter much in this case frandom was easy solution.

Friday, March 01, 2013

Automatic US / UK VPN connection with XBMC, iPlayer, Hulu and Free Cable

XBMC has addons for various geolocked services, Hulu and iPlayer being among most popular. Switching between VPN connections manually gets boring quick so I hacked following script that will automatically connect and disconnect VPN to US / UK on demand. Tested with XBMCbuntu and XBMC 12.0 Frodo.

Friday, February 22, 2013

Activating extroot on OpenWrt 12.09-rc1

Enabling extroot on OpenWrt 12.09-rc1 is bit tricky. Likely reason you're trying to enable extroot is lack of free space i.e. router with 4MB flash. Problem is that unless you're interested in creating custom firmware images there's no space left for tools to enable extroot using old procedure. Following has been tested with TP-Link MR3220 v1. It's ar71xx with 32MB RAM and 4MB flash being lowest end of currently supported OpenWrt compatible devices.

Tuesday, February 12, 2013

Multipath OLSRd (SEREADMO)

Some years ago patch for OLSRd v0.5.6-r2 surfaced that added support for loadbalancing single flow over multiple paths. Documentation on how to set it up is scarce. I did get it working to some extent. It's somewhat unstable and doesn't really like single mesh node having multiple network interfaces, but it does loadbalance traffic over multiple paths as promised.

Monday, February 11, 2013

Measuring one-way network latency, jitter and packet loss on Linux

Ping can tell you round-trip or two-way latency, but if you want to know if it's upstream of downstream that's slowing down you need something else. You need OWAMP (One-Way Ping).

Compiling ntp v4.2.7 for Ubuntu 12.10

Compiling ntp v4.2.7 for Ubuntu 12.10

Saturday, February 09, 2013

Dumping process memory in Linux

Sometimes when troubleshooting misbehaving applications having complete dump of process memory comes handy. Here's small script that does exactly that on Linux. Run it with pid of process you're interested as parameter.

Wednesday, February 06, 2013

Replacing WLAN card on HP nc6000 laptop


Atheros WLAN card on my hack laptop HP nc6000 died sometime ago. No problem I thought as I had unused Intel 2200BG. After swapping card I was greeted with 104 unsupported wireless network device error. While 2200BG was one of original options for nc6000 one I installed had wrong PCI subsystem ID. Quick googling showed multiple people killing their nc6000 after flashing hacked firmware requiring soldering iron and eeprom programming device to recover. Nothing wrong with that and that most certainly has higher hack value, but not for me this time. Since card itself was ok for BIOS I started thinking if I could somehow change ID supplied by card to one HP BIOS accepts...

Friday, January 18, 2013

Fixing HP LaserJet 600 M602 with error 49.38.03

New HP LaserJets are like Windows PCs. Operating system is bloated and buggy. Recently I had to fix HP LaserJet 600 M602 that said "49.38.03 error, turn power off then on" each time you tried to access network settings via menu - and via ethernet it was completely dead. To fix this turn printer on, press (X) button when all three leds on front illuminate, login as admin, clean entire disk and reload firmware from USB stick.

Wednesday, January 09, 2013

Enable Windows Remote Desktop remotely from command-line using PSEXEC

Need RDP access to remote Windows server or workstation, but forgot to enable it after installing OS? If there's no firewall blocking and required components are installed (as they are by default) run following command as user that has admin rights on target PC.

PSEXEC.EXE -s \\HELSI1136 CMD.EXE /C "REG.EXE add ^"HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server^" /v fDenyTSConnections /t REG_DWORD /d 0 /f"


Sunday, January 06, 2013

XBMC and overlapping subtitles with iPlayer addon

There's often overlapping subtitles with XBMC and BBC iPlayer addon. Rather than modify actual addon and losing changes every time it's updated I hacked up script that edits SRT file after it's downloaded from BBC site but before XBMC reads it.

Friday, January 04, 2013

strongSwan 5.0.1 on Ubuntu 12.04 and 12.10

Could we get any older versions included in distros? kthanksbye

Thursday, December 27, 2012

Setting up XBMCbuntu 12 based HTPC - Part 6 - Configuring XBMC

Close but not quite yet. Next we change some hidden settings via command line and then some more via GUI. Below are settings I prefer. As usual, you probably want to set more than one of these differently.

Setting up XBMCbuntu 12 based HTPC - Part 5 - Recompile XBMC

Now it's getting more interesting. XBMC is notoriously bad in buffering content. There's various patches floating around but none of them really does what I'm looking for:

Setting up XBMCbuntu 12 based HTPC - Part 4 - lightdm

Next we need to fix annoying bug that prevents HDMI audio from working out of the box.

Setting up XBMCbuntu 12 based HTPC - Part 3 - OS tweaks

Since XBMCbuntu is just Ubuntu with some tweaks next we apply my usual Ubuntu fixes over it. Only major difference is that this time we're not removing Network-Damager. And of course bunch of XBMC specific changes.

Setting up XBMCbuntu 12 based HTPC - Part 2 - Install

Installation of XBMCbuntu is fairly straightforward and default settings are fine. Install will take less than half an hour.

Setting up XBMCbuntu 12 based HTPC - Part 1 - The beginning

I had here series of posts, more like notes, of my XBMC install. I've since found out better ways to fix some of problems explained in those posts. To avoid having two set of posts with different instructions I took old ones down and will post new instructions.

Tuesday, December 25, 2012

Shuttle XS35GT v1 and v2 BIOS upgrade without Windows

This post contains mostly same information as earlier WDIDLE / WDTLER post. This time we just create bootable USB stick for XS35 BIOS update instead of playing with HDD parameters.

Monday, December 24, 2012

Wakeup from suspend, wireless Bluetooth / RF keyboard, udev and Ubuntu12.10

Finally got my HTPC wireless controls to wake-up it from suspend. I'm using PS3 BD Bluetooth remote with Trust Bluetooth 3.0 USB receiver (Atheros AR3011) and Logitech Wireless K400r with Logitech Unifying Receiver.

Sunday, December 16, 2012

Recovering Zcom ZCN-1523H and Planet WNAP-7300 from bad firmware flash

OpenWrt Attitude Adjustment Beta2 images for Zcom ZCN-1523H a.k.a Planet WNAP-7300 are broken. You can do recovery by opening case (three hidden screws under label on back) and soldering serial port (115200-8-N-1, TX closest to AR71xx, RX next and then GND, ignore fourth pin). After adding serial port cause of fault was quite obvious (kernel lacks support for ZCN-1523H) and also how to repair it without adding serial port.