Posts about hacking (old posts, page 1)

Using punctuation entity names in XHTML

This post was originally published at sinewalker.blogspot.com.au on 22 March 2006.


You can use the following XHTML entity names to put propper punctuation symbols into your web pages.


The W3C maintains a complete list, though finding what you need can be a bit tricky. I'm working on a complete list that actually displays the characters together with the other detail from W3C's table, a lot neater coding than this Blogger post too, I hope…


In the mean-time, here's a short-list of common characters that I use quite a lot:


Double quotes: “ ” ⇒ use “ and ”
Single quotes: ‘ ’ ⇒ use ‘ and ’
Ellipsis: ⇒ use …
En-dash: ⇒ use –
Em-dash: ⇒ use —
Minus sign: ⇒ use −
Multiplication: × ⇒ use ×
Division: ÷ ⇒ use ÷
Approximately equal: ⇒ use ≈
Trade Mark: ™ ⇒ use ™
Copyright: © ⇒ use ©
Registered: ® ⇒ use ®
Right-arrow: ⇒ use ⇒

New Printer “Just Works” in SUSE 10

This post was originally published at sinewalker.blogspot.com.au on 22 March 2006.


Well, here's a first for me: go to local Dick Smith's, buy a cheap printer, for my wife (HP Deskjet 3940, AU$66). Because I don't really care about printing from Linux, I didn't care if it works or not on that OS, just bought whatever Windows printer was cheapest.


Brought it home, plugged it into my PC (in Windows) and it works, after installing drivers and software and about 15 mins of setup time.


For the heck of it, I rebooted to Linux to see what would happen. Well lordy “New hardware detected: HPdeskjet3940” and an offer to set it up. After 5 minutes — just accepting all the standard options — out comes a test page, in colour, bi-directional and fast.


Neat. Linux is ready for me....

Emacs dunnet solved

This post was originally published at sinewalker.blogspot.com.au on 8 March 2006, and then updated at sinewalker.wordpress.com on 26 November 2006


I found this in a slashdot post while trawling for my own net handle... a cheat for the Emacs game dunnet:

get shovel, look shovel, e, e, dig, look, get cpu, look cpu, se, get
food, se, look bear, drop food, look, get key, sw, get bracelet, ne, nw,
nw, ne, ne, ne, e, look bins, w, w, put cpu in computer, type, toukmond,
robert, ls, uncompress paper.o.Z, exit, look paper, type, ftp gamma,
anonymous, toukmond, binary, send lamp.o, send shovel.o, send key.o, send
bracelet.o, send paper.o, quit, rlogin gamma, worms, get lamp, get
shovel, get key, get bracelet, get paper, e, n, e, drop shovel, drop key,
drop bracelet, drop paper, get weight, d, drop weight, nw, u, get
statuette, look statuette, get floppy, se, d, nw, ne, drop floppy, w, s,
e, turn dial clockwise, turn dial clockwise, turn dial clockwise, turn
dial counterclockwise, turn dial counterclockwise, turn dial
counterclockwise, w, n, e, get life, get shovel, get key, get bracelet,
get paper, get floppy, d, nw, u, se, d, nw, nw, s, s, s, s, put diamond
in chute, put bracelet in chute, s, get gold, e, e, s, d, look urinal,
put gold in urinal, flush, n, sleep, d, sw, e, u, dig, look, get
platinum, d, w, ne, u, s, put platinum in urinal, flush, n, d, sw, w, d,
e, get towel, look towel, d, s, s, s, look pc, put floppy in pc, reset, ,
dir, type foo.txt => xxx (combination), exit, n, n, n, n, n, u, look box,
put key in box, u, u, ne, ne, get axe, d, n, w, xxx (combination), cut
cable, exit, get key, e, n, get lamp, get license, get silver, w, put
silver in mail, n, n, e, e, e, e, e, get coins, get egg (in rooms 60 to
78), w, w, w, w, w, s, s, put egg in mail, put coins in mail, n, n, n, n,
e, e, e, e, e, look bus, in, s, s, s, w, w, w, w, w, nw, out, n, get
bone, e, e, get nitric, press switch, n, get glycerine, w, look bone, get
jar, get ruby, s, w, s, in, se, out, e, e, e, e, n, n, put nitric in jar,
put glycerine in jar, drop jar, in, n, n, put ruby in disposal, d, get
amethyst, u, put amethyst in disposal, d, ne, sw, u, u, w, w, s, w, s,
se, s, e, s, w, type, rlogin endgame, drop license, drop bone, drop key,
get diamond, get gold, get platinum, get amethyst, n, n, n, n, get bill,
n, get mona, s, drop bill, drop mona, drop diamond, drop gold, drop
platinum, drop amethyst, s, s, s, s, get silver, get egg, get coins, get
ruby, get bracelet, n, n, n, n, n, drop silver, drop egg, drop coins,
drop ruby, drop bracelet, n, quit

So I'll have to play again, and make a map too... 'cause it's the geek thing to do.


UPDATE: 20081126 - Finding the egg

As noted in the cheats above, the egg is in a random spot between rooms 60-78 (inclusive). Here are two stategies (besides peeking at the dunnet.el code) for finding the egg:


  1. In the pokey Unix environment (in-game) do directory listings of all the rooms between Main and Fourth St, intersecting between Maple and Sycamore Ave. If the room contains the egg, it'll be listed as egg.o in the Unix environment. Note where it is, then go and fetch it.
  2. Head along Main St looking for the egg, then up and down First, Second, Third... &c. until you find it.

Another idea to try (theoretical, but interesting, from TimHorse' comment below):


  • Login to pokey as the wizard, then type echo $dun-room-objects to find out where ALL of the objects are, find the egg (item 18, see $dun-objects) then have a look at $dun-rooms...

More ideas to try as the wizard in pokey (from some tips at the Dunnet author's hints page):


  • dun-current-room=tloc to go directly to the room containing the egg
  • dun-items='(append 18 dun-items), to add the egg to your inventory directly (a truely moby hack)

I'm actually motivated to play this game on the train tonight...


I still haven't made a map, maybe one day. It should be fairly simple to use the code as a starting point, but the up/down could be tricky to map.

DVD-CSS in SUSE

This post was origionally published at sinewalker.blogspot.com.au on 7 March 2006


There are excellent instructions for installing/patching SUSE to play commercial (CSS encrypted) DVDs. I had no trouble following them either. Wonder of wonders.


The whole issue of libdvdcss being “illegal” in DMCA-enlisted countries seems to be mute now, from my perspective... so long as your intent is only to watch movies that you have legally obtained (and not fincancial gain), then it should be fine — if it's good enough for the MPAA, then it's good enough for me. This would seem to me to work well with Australia's existing copyright law, which specifically grants fair-use copying and playing anyway, and goes against the dogma of the DMCA.

Problems with my CD recorder

This post was originally posted at sinewalker.blogspot.com.au on 10 February 2006.


I think I may have figured out the issue with my CD recorder. It seems to fail more when the weather is hot (as in, more than 32° C ambient). The internal case temperature would be in the low to mid 40s then, and this is probably close to the maximum operating temperature for the device (a SONY CD-RW CRX140E).


Bummer.


So, either I confine my CD writing to early in the morings on hot nights, or I evaluate some sort of cooling solution.

Linux distro woes

This post was originally posted at sinewalker.blogspot.com.au on 24 January 2006.


Well, my flirtations with gentoo didn't last too long. I'm now trying SuSE 10.0 out, which — yes — is an RPM-based distro!


So, why did I leave gentoo? I suppose that the "distro that doesn't get in your way" got in my way. With the arrival of our first baby, I'm rather short on the hours needed to learn how to configure everything in gentoo. While it's true that I could stand to learn a lot from getting it all to work, I can't afford to be hacking around getting pesky things like the scanner to go, or printing, or figuring out why I suddenly cannot burn a CD anymore. I need a "linux for dummies" that just works, and is more stable than winblows. Of course, if money was no object, I'd get myself a nice shiny new dual G5 Macintosh, but that's just for my dreams.


So, since Novel have decided to open up SuSE a bit more now, I'm trying it out. I downloaded the "Evaluation" version, rather than OpenSuse, since I'm not an OpenSource zealot, and frankly I'd like to visit web sites with flash animations. It has crippled xine/kaffeine and no DVDCSS, but I can live without movies for now until I get that sorted, or build from the source I have, or even (ick!) just boot to Windows (though I know of no free DVD players for win32 that expand a 16:9 movie to fill as much of my 4:3 screen as Kaffeine does).


So, it installed well, I now have working scanner, printer, cd-rw, dhcpd, cvs, mysql, java (yay!), apache, tomcat, kde. No Audacity or Rosegarden (important apps for me), no Eclipse (can wait). Slightly out-of-date jedit (4.1) and about 250MB of patches to upgrade to at some point, or not, since on dial-up I'm not exactly a cracker target...


I'm very happy with SuSE so far. It's as pleasant as I always thought it would be. YaST is nice too. Only problem: sometimes cdrecord bombs, still (!). Pisses me off, it worked once but not again, even as root. It can sit on the back-burner (oops) until after I've got my missing audio software installed


Major projects for linux are:


  • Record old music tapes to OGG and burn to data and audio CDs
  • Get nice video editing software (kino) working for baby and burn to VCDs
  • Java hacking (install Sun Java Studio sharchives)
  • Photo indexing and database, then archive to CDs
  • Produce a CD database
  • Get a working backup solution running

Obviously, I need to get cd-rw sorted as a priority... it's kinda central!

Xine performance

This post was originally published at sinewalker.blogspot.com.au on 31 October 2005


Now playing with Gentoo as my latest Linux of choice (I got fed up with RPM dependancy problems, and Gentoo being source-based solves my other issue with binary-based distributions, where I felt like a 2nd-class citizen when using or accessing source code).


So, I've got Xine working, but can only use shared memory for the video decoding. This is great if I want to capture screen shots, but not for high-speed movies such as The Matrix, or even just reading the credits on The Lord of the Ring. So need to "fix" the performance.


I used to have Mandrake running v4l + xv, but I can't have installed it right in Gentoo because, although xv is loaded, the performance is glacial if I try to use it.


I found this old How-to with some advice to try... but I might also want to look at the FAQ.... probably I haven't built something into the kernel.


Also while reading around, I discovered Mplayer. This looks like it's worth a download...

“Get into the habbit of reading source docs”

This post was originally published at sinewalker.blogspot.com.au on 27 October 2005


The great thing about Linux is that all the definitive documentation (including the source code) comes with the OS.

(Slashdot quote)


You know, I'm finding that for a lot of the “beginner” linux distro's, this is not true. Yes, the source is available but it doesn't come with the OS.


Granted, not everyone wants to fill their harddrives with source tarballs or SRPMs on the off chance they might want to read them, but only a few distro's I know come with source, and those are not necessarily for noob's. the main example that comes to mind is Gentoo (since it's a “ports”-like distribution). This is not to wax lyrical on the benefits of Gentoo for learning Linux (Gentoo has many weaknesses in that regard too, among its inappropriateness as a general OS for noob's), just that it's the only one I've found where the source comes with the OS.


Other distro's with source “available” are Debian and Fedora (on extra CDs you have to download, and Fedora locks the source into SRPMs which is another learning hurdle to leap over, especially bad if all you want to do is read the source comments, or documentation not included in the binary RPM). It makes me feel like a 2nd-class citizen, that the source is somehow “open” but you have to know the secret handshake to get at it.


All of this, just to say: while reading source docs is a laudable habbit and I share your wish to encourage it, I can also see how it is difficult for most Linux noob's to form this habbit so long as the source doesn't actually come with the OS, which for a great many distro's it does not. The extra steps to download (and in many cases extract from SRPMs) the source are probably enough of a deterrent to forming this habit.


unfortunately, hacker habbits require hacker motivation :-(

Mainframe is process-centred, *nix/windoze is not

This post was originally published at sinewalker.blogspot.com.au on 18 July 2005


In reference to this Slashdot question about Mainframe Culture


Appart from the obvious religious stuff about GUI (or lack of) and user-centred interfaces (or lack of), the biggest difference, and the biggest advantage that Mainframe brings is it's culture of process and change control. It is something you should strive to let your Mainframe masters pass on to the *nix/windoze padawans before they die of old age.


I am a *nix padawan, but, crocky technology asside, I'm frequently impressed by my Mainframe elders, their ability to deploy code to Production environments that works *the first time* nearly every time, and their ability to communictate technical changes necessary to fix broken code in the middle of the night in the 0.1% of cases where they failed to get it working first time.


Key values that I have picked up from my masters, and which should be inherrited by both *nix and PC/Mac enclaves are focused around Engineering principles. Mainframe guru's program like a civil engineer builds a bridge. No shortcuts are taken unless it can be proven that it is safe to do so. Testing is carried out in stages and test results must be submitted with the change request before a program migrates to Production. If a program must “abend” (Abnormal End) then it should do so noisily and with as much information as possible. If it finishes cleanly, little information is needed other than this fact.


These closely follow the advice Raymond has encoded in his book, but there is probably much more that your Mainframe gurus know that you should cherrish and extend to your newer team members.


Forget about the religious wars, the technology changes and the “focus” of your programmers on users or other programmers. Get the real truth from your Mainframe masters who have seen it all pass before them but have learned the hard way how to make a stable computer environment that stays up, even on cruddy mainframe technology. If their attitudes were adopted by people fluent in today's fantastic systems, all people would benefit.


The sad fact is that, in today's environment, especially after the dot-com cowboys set Upper Management expectations, following Process is just too slow, or too expensive. Convincing management that a bigger cost up front will result in a lower cost in the long run is also futile when mgt sees it as “normal” for computer systems to break. After all, their Windows machine on their desk has been doing that for 20 years now, so it must be normal, right?


What matters most to managers or clients when deploying new systems these days seems to be “time to market”, and the only consent to quality is that the IT dept/company follows check-list processes like CMMI or ISO9000 which do not address the real issues and put too much into the Process rather than the Result. Also, when the system breaks, it's typically at the expense of the IT company that built it, or was stupid enough to agree to use the off-the-shelf product in the first place, so there is nothing to drive a change of behaviour from the clients.

Radeon Performance Enhancement

This post was originally published at sinewalker.blogspot.com.au on 30 March 2005


Place these settings in your xorg.conf:


The RADEON driver (man radeon) supports the following options for the RV280 chip (which is found on RADEON 9200 boards). The default values are in red:


  • Option "AGPMode" "1" (driver currently supports up to x4)
  • Option "AGPFastWrite" "off" (only used when DRI is enabled)
  • Option "BusType" "AGP" (if driver's bus type detection is wrong)
  • Option "DisplayPriority" "AUTO" (set to "BIOS" or "HIGH" to fix tearing)
  • Option "EnablePageFlip" "off" (turn "on" 3D page flipping for better performance)

The biggest wins would come from APGMode and EnablePageFlip. APGFastWrite may help DRI. DisplayPriority may help KDE. Don't use BusType unless the log shows the driver has selected a PCI bus for the card...


Note:- when playing with Xorg 6.5 I got X crashes with EnablePageFlip turned on.