Replacing OS X with Linux on my Mac Mini 2,1

I still had an old Mac Mini (model 2,1) – which I bought during a period of experimentation with different operating systems –  connected to the TV, running Mac OS X Lion. Not Apple’s finest installment of OS X, truth be told.

The reasons I wanted to get rid of it:

  • Apple stopped providing updates for it. Not fantastic from a security point of view.
  • They also managed to actually break VNC for anything except the OS X client
  • TeamViewer takes up a ridiculous amount of CPU power on OS X
  • You can’t turn off the Mac Mini using the power button, it goes to sleep, and it can’t be reprogrammed.
  • It’s just .. sooo… slooooooooow

The only thing the device is used for is

  • iTunes to manage an iPod classic, and to auto-rip newly bought CD’s
  • Using Videostream to cast movies to our Chromecast
  • Playing music from the audio library to the connected amplifier

Not much, really. So, in the end, being tired of the general slowness of the device, I bit the bullet, exchanged the old 80GB hard disk with a newer and bigger model, and went on the journey to install Debian on it.

So, the road to success was:

  1. download the multiarch network install CD image, burn it to a CD. 1
    Why multi-arch, you might ask? Why not use the x86_64 (64-bit) install image, as the Intel Core2Duo is capable of handling this? Because Apple, in all their wisdom, decided to include a 32-bit EFI with a CPU capable of handling 64-bit code. So you get a bit of a schizophrenic situation. The multiarch CD image supports both 32-bit and 64-bit (U)EFI, and hence, it works for this device.
  2. boot from said CD (press and hold the ALT button as soon as the grey screen appears on your Mac)
  3. profit!

I installed:

All in all it works rather nicely. The only problems I ran into was with respect to the iPod management, which was solved by resetting the iPod with iTunes for windows, which formatted the device as VFAThttps://en.wikipedia.org/wiki/File_Allocation_Table#FAT32, instead of Mac OS’ HFS+.

  1. note that this link points to the daily built CD images, which might or might not be broken at any given day

Connecting your Chromecast to wired networking – DIY

I’ve had a Google Chromecast (1st generation) for a while now, connected over WiFi. Works great, although sometimes the wireless reception cuts out, or the signal gets saturated. Since I’m mostly streaming from a device which sits less than 10 cm away, it is also rather stupid to have all those packets going back and forth to my router, causing unnecessary load.
Google has a nifty solution, the Ethernet Adapter for Chromecast, but it’s 1. rather expensive for what it is (in my opinion), and 2. difficult to get your hands on (in Belgium, where I live).

So, after some digging, enter a DYI solution that works ;) It costs about half, but requires more patience (for delivery).

I ordered following pieces of DealExtreme, and had them ship here:

To install it all: plug the mini-USB power supply (delivered with the Chromecast) into the blue plug, the network dongle into the normal USB plug, and the black connector into the Chromecast. (And an ethernet cable into the network dongle, duh). It should automatically pick up the fact that it’s now connected via ethernet, and other than that… it just works. Enjoy ;)

(Edit: I’ve noticed that this setup does cause plenty of electrical interference… so FM reception becomes nearly impossible. Have to figure out what is real cause)

Managing TP-Link easy smart switches from Linux

I’ve recently acquired some TP-Link ‘Easy Smart’ managed switches – cheap, decently built (metal casing), and a lot of features above the usual unmanaged stuff:

  • Effective network monitoring via Port Mirroring, Loop Prevention and Cable Diagnostics
  • Port and tag-based QoS enable smooth latency-sensitive traffic
  • Abundant VLAN features improve network security via traffic segmentation
  • IGMP Snooping optimizes multicast applications

Unfortunately, it uses a windows application to manage the switches – the 5 and 8 port varieties don’t have a usable built-in web server to manage them. Luckely, there’s a way to make that still work on Linux ;) as it seems that it’s just a JavaFX application. The only thing you’ll ever need a windows installation for (or use Wine) is to install the actual application.

After installation, You’ll find a file called “Easy Smart Configuration Utility.exe” in the installation path. Copy that to your Linux installation, rename to .jar, and you’re good to go.

To run it, you’ll also need the Oracle Java distribution, as JavaFX is not yet part of OpenJDK. Install that in your distribution of choice, and you’ll be able to start the application using java -jar “Easy Smart Configuration Utility.jar” and it’ll start right up.

tplink_easysmart

Unfortunately, it doesn’t work out of the box. The tool doesn’t find any devices on the network, but they are there.
Checking with netstat, the tool bound itself on UDP port 29809, on the local ip address.

$ PID=$(pgrep -f "java -jar Easy Smart Configuration Utility.jar"); netstat -lnput | grep -e Proto -e $PID

Proto  Recv-Q  Send-Q  Local Address            Foreign Address  State  PID/Program name 
udp6   0       0       [your ip address]:29809  :::*                    28529/java

Checking with tcpdump showed that the traffic was returning, but since our tool is only listening on the local ip, and not the UDP broadcast address, it never sees anything.

# tcpdump udp port 29809
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on wlp1s0, link-type EN10MB (Ethernet), capture size 262144 bytes
09:35:48.652235 IP [your ip address].29809 > 255.255.255.255.29808: UDP, length 36
09:35:48.961586 IP [switch ip address].29808 > 255.255.255.255.29809: UDP, length 159

It seems the tool binds to the local IP instead of the ‘any ip’, 0.0.0.0, so you need to locally forward the traffic incoming on the port to your local ip. To do this, execute this command (and/or add it to your local firewall script):

# iptables -t nat -A PREROUTING -p udp -d 255.255.255.255 --dport 29809 -j DNAT --to [your ip address]:29809

And don’t forget to enable IP forwarding

# echo 1 > /proc/sys/net/ipv4/ip_forward

Now you should be able to find and configure the switches in your local network.

OpenWRT, dual routers, dual SSIDs and VLANS

Back in the day I used to have one router in the house: the D-Link DIR-825, flashed with OpenWRT. Configured with two SSIDs – one for internal network use, and one for guest access – the latter being separate from the internal network of the flat.

After moving to our house, I discovered that the house construction materials provide a better shielding for radio signals, which in turn meant that the reach of my WiFi router wasn’t quite what it should be to reach the far corners of the place. I tried increasing the output wattage, but that had only a marginal increase in reach. So in the end I opted getting a new primary router – the TP-Link Archer C5 (though mine has three antennas?), which was promptly reflashed with OpenWRT. The DIR-825 was moved to the opposite corner of the house to increase reach, and at the same time I lowered the output wattage of the radios.
Because of time constraints, I didn’t bother stretching the guest wifi to the second router, as it requires a bit more configuration to properly separate the flows of data between the two networks: vlan configuration.

Continue reading

Using WiiMotes (and classic controllers) on Windows

After the latest lan-party with some friends, where we played a lot of Rocket League, it dawned on me that this game (and numerous others) is probably a lot easier to play with a game controller instead of the mouse/keyboard combination. And as I have the WiiMote and the Wii Classic Controller lying around, I thought I’d have a go at getting these to work on Windows (as opposed to buying something new).

640px-Wii-Classic-Controller-White

Wii Classic Controller

Windows does recognize the WiiMote as some weird bluetooth device, but not as a functional controller. Some digging turned up HID Wiimote driver, the Bachelor Thesis project of Julian Löhr.
For the installation instructions, please see the site of Julian – they’re pretty detailed and tell you everything you need to know.

As for mapping the output of the driver to something games understand, you’ll need yet another tool: x360ce. This translates whatever output you get from a driver, and makes the game/program in question think there’s an Xbox360 controller attached. For details on how x360ce works, check the github site.

x360ce

x360ce main controller mapping screen

One final remark: to make things properly work, make sure you uncheck “Passthrough” in the advanced tab, otherwise it just doesn’t work. And copy the files of x360ce in the game’s binary directory, so that all the necessary libraries will be found.

My history in gadgets – update 2014

An update on the “My history in gadgets” post from a while back, as things have progressed a bit meanwhile ;)

Mobile phone history:

I’ve since sold my Desire, and obtained/sold the following phones:

HTC Desire HD
HTC Desire HD

Bought this phone secondhand, used it for a while. Quite the powerhorse for the specs, the only downside being it’s weight. Was also temporarily used by my girlfriend. Sold it on in 2013.

HTC Desire S
HTC Desire S

Purchased this one also secondhand for my girlfriend. After a while it returned to me and is currently in use as my work phone.

HTC One X
HTC One X

After selling the Desire HD, I got the HTC One X secondhand in 2012. This one features a quadcore Tegra3, and it’s just amazing in speed and display specs. Sold it on in 2014.

LG Nexus 5
LG Nexus 5

This is my current main phone.

LG Nexus 5

I’ve always been a fan of the “stock Google” look of android, also often referred to as AOSP (Android Open Source Project) – a clean look, no bells and whistles added by the vendor of the device in question.
The ‘vendor’ looks usually change the look of the Android OS, add (unneeded?) applications, and add their own launcher. There are several vendor skins, like Samsung’s TouchWiz (pictures), HTC’s Sense (pictures), Motorola’s MOTOBLUR, and numerous others.

I just don’t like them.

Don’t get me wrong – they have their good things too. Usually better integration of all the vendor apps, and a higher degree of userfriendlyness.

Since my old HTC Hero, I’ve been replacing the look set by the vendor by a more stock Google Android look. So it makes only sense that my last phone should be a Google-commissioned Nexus device, namely the LG Nexus 5. In black, ofcourse ;)

So, replacing the HTC One X, here’s my new daily use phone:

LG Nexus 5

(and, before you ask, ofcourse it’s been rooted.)