2007-12-25

Connecting a Nintendo DS/Wii to an Airport Express

I was trying to do this, and it was driving me up the wall. I put it in WEP mode, but the DS/Wii wouldn't take the password.

The trick is you need to use the HEX password, which is not what Apple uses by default.



You need to use "Equivalent Network Password" to see the WEP code the DS/Wii will want. Once you have this, it'll connect quite easily.

Of course if you're only using a Wii, you should use WPA2.

2007-12-21

VMWare Server USB on Ubuntu 7.10

If you want to use USB devices with VMWare Server on Ubuntu 7.10 you need to do the following:


Shutdown VMWare

sudo mount -t usbfs usbfs /proc/bus/usb/

Start VMware, and load your virtual machine.
Select the USB device in VM -> Removable Devices -> USB


Note that if you want usbfs to be mounted at boot, you'll want to add this line to /etc/fstab:


usbfs /proc/bus/usb usbfs defaults 0 0


I put it directly under the proc entry.

Awesome desktop images

I was looking for some 1080p images, and found them at InterfaceLIFT.org. If you edit the URL a bit, you can directly search for 1080p. There are some very nice ones; now I only need to find some uncompressed TIFFs.

2007-12-19

Remotely waking up a Mac

I had forgotten to change a cronjob on my Mac Book Pro at home, but by the time I got to work and sshed back in, it was asleep.

The server was on Gentoo, so I looked at the Gentoo wiki and found that "emerge wakeonlan" would get me the tool to wake up the Mac.

But now I needed the MAC address, and it was asleep! But I remembered dhcp, and looked in /var/lib/dhcp/dhcp.leases and sure enough, there was the MAC address of the Mac.

Running wakeonlan, waiting for it to come alive, and sshing in worked great.

2007-11-21

Paladin Song

I'm a dwarven pally,
Short and stout,
Here is my hammer,
Here is my mount,
When I see a Horde,
I scream and shout,
'Bubble shield and hearthstone out!'

2007-11-19

Phoenix LOL

Here is a flickr set of Phoenix Wright in a LOLCats theme.

2007-11-18

Simply rsync command

If you want to simply copy the contents of one directory to another using rsync (so you can resume if copying to an SMB mounted filesystem on a wireless link, for example):


rsync -av --size-only /Volumes/Source Directory/ /Volumes/data/Destination Directory


-av tells rsync to archive and be verbose, --size-only tells it only to compare file sizes (as it is a local link, it's faster to just copy the file than to read it up and determine differences). The trailing slash should be on the source directory, but not on the destination directory.

Iron Soccer Ball

The rest of the world is just as messed up as we are, if not worse.

Proof is presented. QED

Cowbell Hero

Cowbell Hero!

2007-11-15

Design Problems?

Awesome spam follows.

design problems, and better design problems, and better you don't want
to , and how to exploit put you to sleep! We think But you don't just
so you look to Design

words, in real world his stunningly clever use of Command, Head First
Design Patterns you get to take (and impress cocktail party guests)
environment. In other it struggling with academic
when he casually mentions , and how to exploit matter--why to use
them, and why everything In a way that lets you put

challenging. Something look "in the wild". in between sips of a
martini. you want to learn the them to work immediately. more complex.
used in the Java API

and why everything you want to learn the You want to learn about , and
how to exploit brain in a way that sticks.

applications. You up a creek without NOT to use them). how patterns
are real OO design principles "secret language"

Patterns--the lessons Best of all, in a way that won't you don't want
to Singleton isn't as simple as it
deep understanding of why at speaking the language
Java's built-in pattern

be wrong (and what




about inheritance might (and impress cocktail party guests) Best of
all, in a way that won't your boss told you
look "in the wild". (and impress cocktail party guests)
your time is too important

brain in a way that sticks.




advantage someone struggles Patterns--the lessons advantage
better at solving software it struggling with academic
format designed for the way

challenging. Something



the patterns that with of patterns with others you get to take
his stunningly clever use of Command, "secret language" science, and
learning theory,
the latest research in about inheritance might matter--why to use them,


also want to learn , and how to exploit (and impress cocktail party
guests) (or worse, a flat tire), But you don't just to know how they
Head First Design Patterns
deep understanding of why
about inheritance might about inheritance might
principles will help
what to expect--a visually-rich Design Patterns, you'll avoid
challenging. Something

will load patterns into your to use them (and when to learn how those
Decorator is something from at speaking the language
to do instead). You want format designed for the way applications. You
you have. You know
who've faced the them to work immediately. or on the real relationship
to know how they about inheritance might
You want to learn the
used in the Java API
used in the Java API more complex. his stunningly clever use of
Command, at speaking the language that you can hold your

at speaking the language sounds, how the Factory In a way that makes you

Head First Design Patterns principles will help

better at solving software will load patterns into your what to
expect--a visually-rich In a way that lets you put
challenging. Something it struggling with academic
be wrong (and what

and Adapter. With Head First

2007-11-12

Entrance Essays for Graduate School

Imagine the graduate school of your dreams. Consider it as a woman. Now the essays, you must seduce the woman with the entrance essays.

And if you're accepted, she'll take all your money and dump you in a ditch in 2-4 years.

Please don't write LOL to me

Go to http://www.basshunter.se/guestbook.htm

Read post 21066. It's epic.

@ linda;Hi Linda you don’t understand the text... The girl he is kissing oh the photo is not me!!!!!!! It is not my way to be a bitch and plese look at the photos again. Iam the girl on the first two pictures, and the other three pictures is a old friend of mine and she fuck with the photograph to be allowed to stay at the vip-longe!! so i think i have the right to say, that she is a bitch.. or what would you say? of course i think jonas is a "player" ( I think you know what it means and what I want to say). so please don’t write "lol" to me, because I am not like you told me... thx. have a good time ayla

2007-08-27

Running the DOS TIE Fighter on a Mac

I was digging through my old files (some are almost 20 years old!) and I found my original copy of TIE Fighter for DOS.


A quick download of the latest DOSBox (in this case, 0.72) and I was on my way. I opened DOSBox directly from the disk image, and didn't bother copying it over, yet.

I mounted the directory where TIE Fighter was (in this case, on my network server):

mount C "/Volumes/programs/PC/Tie Fighter/dostie/"
C:
setmuse
tie

Those were the only commands I needed to run, and it was up and working. ALT+Enter made it full screen, and CTRL+F10 releases the mouse.

The only problem I ran into was that while I had my copy of the game, I no longer had the manual, and couldn't get past the copy protection. A quick Google search for "The Patcher v6.5" solved those problems - it ran directly in DOSBox with the greatest of ease.

Next step will be to find a joystick and see how well I still play. I also fired up Sim City 2000 and DOOM, all from a copy of a disk that hasn't been accessed in eight years or so.

Note, I have an Intel Mac, and I'm not certain DOSBox would run the same on a PPC Mac.

Using fail2ban to reduce attacks on Gentoo

You can use fail2ban to reduce the amount of time your servers spend dealing with spam, ssh attacks, and more.

Installation is simple. First we check the dependencies and what will be installed:

emerge -uDpv fail2ban

If everything looks normal, install fail2ban. In my case, 0.8.0-r1 was the version installed.

emerge -uDv fail2ban

Then it's simply a matter of configuring it. In my case, I'm using shorewall on a 2.6 kernel, so I modified the files as follows. As I agreed with Uno_Code's opinion I edited /etc/fail2ban/fail2ban.conf so that it used /var/run/fail2ban.sock instead of /tmp/fail2ban.sock.

The next step is editing /etc/fail2ban/jail.conf for your setup. I changed the default bantime to 6000 seconds:

bantime = 6000

This is 100 minutes, 10 times the default, which should give enough time for whoever is bothering your server to give up and go away. You'll probably want to modify the ignoreip line to contain and fixed IP addresses you control (so that you can never be locked out via SSH, for example).

ignoreip = 127.0.0.1 10.0.0.2

After configuring the defaults, we need to setup the jails for each service. You'll notice many sections like this in jail.conf:

[ssh-iptables]

enabled  = false
filter   = sshd
action   = iptables[name=SSH, port=ssh, protocol=tcp]
           mail-whois[name=SSH, dest=yourmail@example.com]
logpath  = /var/log/sshd.log
maxretry = 5

Notice the enabled = false on each one. We'll edit them for our purposes, and then change it enabled = true.

The most important lines are filter = sshd and the action = iptables. Since we're using shorewall as our firewall, we'll need to change it to use shorewall instead of using iptables directly. The filter = sshd line refers to the /etc/fail2ban/sshd.conf file, which is where the regular expression that detects the log failure (in this case, an SSH authentication failure) is defined. In this case, the default sshd.conf is usable, so we won't need to edit it.

However, we do need to change the section as follows. I've renamed it to ssh-shorewall to keep with the default naming pattern.

[ssh-shorewall]

enabled  = true
filter   = sshd
action   = shorewall
           mail[name=SSH, dest=yourmail@example.com]
logpath  = /var/log/messages
maxretry = 3


We've changed from mail-whois to mail (mail-whois simply does some reverse lookup on the IP before mailing you), and replaced iptables with shorewall. You need to change logpath to point to /var/log/messages, as that's where sshd reports login failures (at least in my Gentoo installation). I've changed maxretry to 3. The number you pick is basically based on how often you think you may mistype your password or forget to load your SSH key.

The next thing I enabled was a filter that would drop connections from mail servers that are greylisted 5 times in 5 minutes. This is a bit extreme, but based on log perusal of my server I don't have any valid people trying to send me 5 emails in a 5 minute time-span. Depending on how many users you have, you may need to change these numbers. Currently these mainly seem to be Storm virus emails. To create this filter is a two step process. First we edit /etc/fail2ban/jail.conf as shown:

[greylisting-shorewall]

enabled  = true
filter   = postfix-greylisting
action   = shorewall
           mail[name=greylisting, dest=yourmail@example.com]
logpath  = /var/log/messages
maxretry = 5
bantime  = 60000
findtime = 300

You can see that I've overridden the default bantime and findtime, banning the servers for 1000 minutes. Then we need to create a new filter for this in /etc/fail2ban/filter.d that contains the regex that will catch these servers. I copied it from /etc/fail2ban/filter.d/postfix.conf and called it postfix-greylisting.conf. The important line changed is the failregex line:

failregex = reject: DATA from (.*)\[\]: 450.*Greylisted

The regular expression has been changed to capture greylisting notices from the messages file. When editing the regular expression, you can use fail2ban-regex to test them, as seen here:

fail2ban-regex /var/log/messages "reject: DATA from (.*)\[\]: 450.*Greylisted"

Note that the above line is one command. The regular expression catches all 450 rejects that have Greylisted in the text.

The next filter we'll setup is one that is designed to block servers that try to update against named when they're not authorized to. I copied one of the filters to /etc/fail2ban/filter.d/named.conf and changed failregex to:

failregex = named\[\d*\]: client .* denied

This catches servers that are hitting your named server, such as seen here:

Aug 27 09:48:45 server named[19283]: client 148.160.29.6#33116: query (cache) 'example.com/NS/IN' denied

We then need a configuration section in jail.conf for named:

[named-shorewall]

enabled  = true
filter   = named
action   = shorewall
           mail[name=named, dest=yourmail@example.com]
logpath  = /var/log/messages
maxretry = 2

Now we just need to start fail2ban:

/etc/init.d/fail2ban start

If you're editing jail.conf you can cause a reload easily:

fail2ban-client reload

Once you're satisified that everything is working, you can add fail2ban to your default runlevel:

rc-update add fail2ban default

You'll notice that every one of our setups has a mail command attached. Until you're certain that you no longer need to monitor what's being blocked, I'd recommend leaving them. All action is logged in /var/log/fail2ban.log, so you can use that to check what is happening after you disable the mail commands.

Further information can be found at the fail2ban wiki.