Posts Tagged ‘How to’

(on Technorati , Del.icio.us)

Hacking the Printer

Look into my eyes, Brother (MFC420-CN)… repeat after me, “I still have ink left.”

This ink never runs out!

This ink never runs out!

I have a Brother MFC420-CN (multifunction printer) and it religiously cleans its heads as long as it is plugged in. This combined with the facts that it will not print unless it has ink and the cost of ink make for a pretty nice business plan for Brother. This is common practice with most budget bubble jets, I suppose, since I’m sure they lose some money on the ~$100 device. Even if you want to print in black, and you’re magenta is empty, it will refuse to print. I’m a little conflicted about how I feel about this, because Brother does provide open support for Linux, which is a good thing. Anyway, the solution is clear: trick the vile thing into thinking it has ink. In fact, all the times I’ve received the “replace ink” message, there has still been a little ink in the cartridge…. and after tricking it, you can still print in that colour (until it actually runs out, of course). Googling resulted in a post on a forum somewhere about applying a strip of black tape to the ink cartridge, but wasn’t very clear. After some trial and error, I hope this picture clarifies things. I guess the tape blocks light of some sort, which it uses to monitor ink level.

(Wasn’t really sure how to classify this post… don’t have a how-to category. I should upgrade to WP 2.3 and use tags….)

How to open a folder with the default file-manager in mono/C#

using System.Diagnostics;

Process.Start (“file:///home/”);

Did a bit of IRC channel ping-pong today. Went over to #f-spot to ask a user-related question about f-spot, and got pulled in by curiosity on a totally unrelated topic: opening a folder with the default file-manager. Initiated some discussion on #mono and discovered this was, in fact, not trivial – which seemed odd. But I’ve never personally written any C#, or much desktop code at all, for that matter. So I started playing around with various suggestions from the good folks in #mono, and writing my very first C# application.

(Yeah, basically a one-liner. You gotta start somewhere! ^_^) Anyway, for something so simple, there seemed to be a lot of uncertainty and discussion about it (even from the man, himself! – He claims his memory is fading…), so I figure it’s worth documenting. More info can be seen here under Process.

On FreeDesktop systems it will use xdg-open, if not, it will try to use gnome-open or kfmclient to open the files.

Not sure if this will work on Windows. The file:// prefix is required.

Update: According to ccoish, this will work on Windows.

Passing this info back to #f-spot resulted in a patch to allow you to open the folder containing your photo. Thanks, Gabriel! Open source is cool. :)

Not sure if I’ll look at C#/Mono much more, was kinda gonna do the Python thing for a while… but this was a fun distraction. :)

Faking MAC Address in Linux

I’m house-sitting for my brother, and I brought my computer over so I didn’t die of boredom, alone, in a house for a week. The problem is the Internet over here is hooked up directly to the modem, and the Internet provider will only provide an Internet address (IP address) to the ethernet card that was registered to them: the one in my brother’s computer. So, I turned on the computer, checked out the advanced properties of the ethernet card to get the MAC (physical) address and wrote it down. In Linux, using ifconfig, you can tell a particular interface to pretend its address is something else. If you’re using a Debian derivative (I’m using Ubuntu), you’ll probably need sudo before the command.

Note: Copy your current MAC address and put it somewhere safe, just in case – I haven’t tested to see if this is permanent, yet.

On the command line:

sudo ifconfig eth0 hw ether xx:xx:xx:xx:xx:xx

Or, to make it permanent, put it in /etc/network/interfaces


...
auto eth0
iface eth0 inet dhcp
...
hw ether xx:xx:xx:xx:xx:xx
...

If you get an error message, saying the “Device or Resource is busy” then you probably have to bring the interface down first: sudo ifconfig eth0 down. Use ifconfig eth0 to check that it worked – it should show the new address if no error was reported. Once that was done, I connected my computer to the modem and the provider was much more cooperative with my DHCP requests. :D Yay, Internet on my computer again! :)

Free Games and Entertainment

UFO2000

So for the last month or so… some friends (one, in particular) have been nagging me to get UFO 2000 to work. If you’re not familiar with XCOM: UFO Defence or XCOM: Terror From the Deep, they’re really awesome turn-based strategy/simulation games originally released by Microprose in 1993, for the PC. My friends and I would huddle around a 15″ CRT and play hotseat with this single-player game by naming and customizing our squad. We would control our own dudes, watch them improve and get better equipment, then plead for the game to be loaded when a favourite takes one for the team. (That got ridiculous, and we eventually had to agree that we would do no loading of saved games for that purpose.) Anyway, UFO 2000 is an open source project based on X-COM, and currently (only) supports 2 player multiplayer. Each player builds a squad according to set rules and money allowed, then places their their team on a randomly generated map, and go at it, exploratory style. The UI is atrocious, and unless you’re running Windows or Gentoo the setup might be a pain, but the game’s pretty awesome.

I documented the steps I went through to get it working on Ubuntu Feisty in the site’s forums here. However, I wasn’t able to see my friend on the server, so I still haven’t been able to play! :’(

Point and Click Adventures

If you’re into dry sarcastic humour and point-and-click adventure games, you might want to check out these (also 100% free!):

I tried using WINE to run them, but the performance wasn’t acceptable, and there was no sound. :( Damn. Even so, I played the first bit of Spooks and it seems well written. I’ve played King’s Quest before and they’re pretty fun. :) Space Quest was my favourite Sierra Adventure game, though….

Some videos

I found these videos entertainingly simple and accurate:

Website

I did take a quick look at a modified kubrick theme I had been working on a while back. One of the main changes is the menu on the right, and when I looked at what I had done in IE… wow, do I have some work to do! hah. Wait, that’s not funny….