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.

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.

    Automate login to Cisco and Aruba controller based Guest WLAN

    Tired of logging manually to Cisco or Aruba controller based guest wlans with captive portal?

    Wednesday, August 22, 2012

    Send-to-self on Linux

    Just copy-paste of script and link to mailing-list archives. This will allow sending traffic to self on linux over physical or virtual wire. This is seriously cool trick and required patches are now included in kernel so it works out of the box on Ubuntu 12.04.

    Sunday, August 19, 2012

    Recovering Buffalo WZR-HP-AG300H from bad firmware upgrade

    Recently I managed to flash bad custom build of OpenWrt to my Buffalo WZR-HP-AG300H rendering it unbootable. See below for tips how to flash latest OpenWrt over TFTP from Windows XP client.

    Saturday, August 18, 2012

    Compiling Strongswan 4.6.4 for Ubuntu 12.04

    Debian and Ubuntu are still shipping ancient Strongswan packages. Today I wanted to do some testing with kernel crypto algorithms (af-alg) but Ubuntu Stronsgwan package had them disabled.

    Friday, July 13, 2012

    Tagging and fingerprinting MP3 files on Linux and Windows

    Now that Spotify is shutting down their free (ad supported) service people are forced back to building own MP3 collections. As usual filenames are total mess and ID3 tags missing.

    Installing Nomachine NX Free Edition on Lubuntu 12.04 x64

    Usually docs for *buntu are identical, but not this time. This works for Lubuntu. It does not work for Ubuntu. See http://magiksys.blogspot.com/2012/05/ubuntu-1204-and-nomachine-nx.html for tips how to get NX working on Ubuntu.

    Thursday, July 12, 2012

    Convert Outlook 2010 PST to mbox to maildir to Gmail

    Officially this is easy. Configure Gmail IMAP on Outlook client and do drag-and-drop. Great unless you have 10GB of emails from over 15 years to transfer. Besides all of your emails will be to/from "undisclosed recipients" on Gmail. Finding some ancient email is already difficult, but stripping sender and recipient info makes it next to impossible.

    Monday, July 09, 2012

    Running WDIDLE3 and WDTLER from USB stick

    I wanted to re-use few old WD disk on RAID. Since these were "green" versions and old enough I could fix their RAID incompatibility issues with WDIDLE3 and WDTLER.

    Fixing manufacturer name, model and serial number on clone hardware

    Soon after setting up fancy new asset management tool you realized that all your clone PCs show up with identical info. Fixable, but requires a lot of work. One more reason to go with name brand instead.

    Sunday, July 08, 2012

    Convert Linux ext3 from ISO-8859-1 to UTF-8

    There's supposedly no character set issues with ext3 on Linux. Bet you already guessed how it really is. Yep, there is very real problems with it.

    Saturday, July 07, 2012

    Creating bootable ESXi 5.0.0 Update 1 USB install media in Linux

    VMware is weird company. They provide only Windows based management tools, but yet installing their products requires manual fiddling with Linux. Notes below are based on info from http://www.r71.nl/kb/technical/327-install-vsphere5-esxi-from-usb.

    Quick and dirty OpenVPN bridge configuration

    Quick and dirty configuration to bridge two ethernet segments using OpenVPN. With this setup you need two ethernet interfaces per host or alternatively one ethernet and wireless access to Internet.

    Restoring full capacity of SATA disk on Linux with hdparm

    For some reason some of my 2TB Hitachi SATA disks report 2000000000000 bytes instead of 2000396697600 2TB disk from all other manufacturer do. Even some Hitachi’s show 2000396697600 bytes.

    Converting Ubuntu Linux with GPT system disk back to MBR

    GPT and EFI. Worst. Idea. Ever. At least with WTF-8 aka UTF-8 your system boots while looking funny, but with GPT all you get is black screen with blinking cursor at best. Sometimes even your cursor is taken away.

    Wednesday, June 20, 2012

    HP Compaq 8200 Elite SFF won't boot from USB drive

    After spending way too much time trying to figure out why new HP's can't boot from USB I finally spotted this.

    Sunday, June 10, 2012

    Tracking execution of Perl program

    Install Devel::Trace (libdevel-trace-perl in Ubuntu) and launch your program using "perl -d:Trace ./xx.pl" like syntax. This gives you tracing similar to "set -x" on shell scripts.



    Monday, June 04, 2012

    Manually adding tracker to torrent with rtorrent 0.9.2

    Until recently rtorrent didn't support adding new trackers to torrent except by editing actual .torrent. Either manually, with some tool or via online service such as http://www.torrenteditor.com.

    Recently support to add trackers on the fly to active torrent was added, but documentation seems to be little thin.

    Thursday, May 17, 2012

    Intel Turbo Boost and Linux

    "Usual" places on Linux will show wrong CPU frequency for Intel Turbo Boost enabled CPUs. You can check actual frequency used with "i7z". It works with i3, i5 and i7 series processors.

    Tuesday, February 07, 2012

    Adding custom entries to Windows 7 start menu with Group PolicyPreferences

    Been bit quiet lately. I might as well document another hack to entertain my very small audience. This time post is about how to add custom entries to Windows 7 start menu. Not under all programs, but directly to same level as other options such as Control Panel, My Computer etc.

    Sunday, January 22, 2012

    SMTP NAT with Sendmail

    This post is closely related to my previous one. Big difference is that in this case company we bought had Lotus Notes based email system that had to be kept running concurrently with new common email platform for several months. Well, actually it is still running to some extent over 4 years later but that's another story.

    Simple fetchmail config

    Few hours ago you got called to meeting with your boss. You were told that company you're working for just bought another firm and everything needs to be integrated ASAP starting with unifying email addresses.

    Thursday, January 19, 2012

    Reliable IP over multiple unrealiable IP links with Linux and Strongswan

    Some time ago I wrote about how to make multiple unreliable Internet connections function like single reliable Internet connection. That was done using OpenVPN and some iptables trickery. This time we're going to do same without OpenVPN and without iptables.

    Wednesday, January 18, 2012

    Linux multipoint GRE tunneling

    Here's another interesting little known feature of Linux kernel GRE support.

    Layer 2 over Layer 3 using Linux built-in features

    Often it's not necessary to encrypt traffic when tunneling L2 network over L3 in corporate environment. I hear, you say use OpenVPN, tinc, gvpe, n2n etc. Now, did you know that there's easy built-in solution that has been part of Linux kernel since 2.6.29? If you need encryption just use IPsec to protect GRE traffic.

    Tuesday, January 10, 2012

    Fixing broken VMware vSphere 5 VMDK disk image

    These are kind of "last resort" fixes if all normal ways fail to resolve problem. No guarantees. Worked for me...

      Monday, January 09, 2012

      Planet WNAP-7300 (Zcomax ZCN-1523H-5) with OpenWrt r29664

      It turned out to be just like I suspected, Planet WNAP-7300 (at least with firmware "2.0.3(PL)4") is exactly same device as Zcomax ZCN-1523H-5. Atheros AR7240 rev. 2 at 350MHz, Atheros AR9280 rev 2 5GHz radio, 32MB RAM, 8MB Flash and two 10/100 Ethernet ports. Therefore it works with Zcomax OpenWrt firmware. Bridge performance seems acceptable, around 70Mbit/s real world in bridged mode and 60Mbit/s if OpenWrt is doing NAT. With around 25 meters nearly line-of-sight performance is ~40Mbit/s. All tests uni-directional TCP (FTP/HTTP) with no other traffic than ICMP echo going on at the same time.

      Using dy.fi dynamic DNS with OpenWrt

      Didn't see this documented anywhere so here it is. How to use Finnish dy.fi dynamic DNS service with OpenWrt router.

      Sunday, January 08, 2012

      Running Mac OSX Lion 10.7.2 with VMware Workstation 8.0.1 for Linux

      Host system configuration:
      Intel Core2Duo 6300 w/VT
      CentOS 5.7 x64
      VMware Workstation 8.0.1


      Saturday, January 07, 2012

      Strongswan 4.6.2dr3 on Ubuntu 12.04 alpha 1

      For some reason latest Strongswan version for Ubuntu is still 4.5.1. See below how to compile and package latest 4.6.2dr3. Not pretty, but works for me when testing new version.

      Thursday, January 05, 2012

      Bridging networks with OpenWrt (r29611) using L2TPv3

      As OpenWrt Wiki lacks this particular example (there's other L2TPv3 examples) I guess better I document it somewhere.

      Unpacking Planet Tech. Corp. WNAP-7200 and WNAP-7300 wireless APfirmware

      Instructions were tested with Ubuntu 11.04.

      Friday, December 30, 2011

      (Ab)using OpenVPN to make two unrealiable Internet connections act asone reliable connection (Success!)

      Hi, I'm Troy McClure. You might remember me from such posts as Failure #1 and Failure #2. Today I'm here to tell you about "OpenVPN inside OpenVPN".

      (Ab)using OpenVPN to make two unrealiable Internet connections act asone reliable connection (Failure #2)

      We mirror our hard disks, we mirror RAM on servers. Why not mirror network traffic as well? 

      (Ab)using OpenVPN to make two unrealiable Internet connections act asone reliable connection (Failure #1)

      Got packet loss? Got two or more connections? Got server somewhere to route packets thru?

      Friday, December 23, 2011

      Extroot on USB with OpenWrt

      My notes on setting up extroot on USB memory stick with OpenWrt on TP-Link MR3220 v1.