Showing posts with label geek. Show all posts
Showing posts with label geek. Show all posts

Thursday, August 5, 2010

NanoDNS updated

I’ve updated NanoDNS to work (in theory) on 64-bit machines, and to handle EDNS packets a little better:

/*Placed in the public domain by Sam Trenholme*/
#include <arpa/inet.h>
#include <string.h>
#include <stdint.h>
#define Z struct sockaddr
#define Y sizeof(d)
int main(int a,char **b){uint32_t i;char q[512]
,p[17]="\xc0\f\0\x01\0\x01\0\0\0\0\0\x04";if(a>
1){struct sockaddr_in d;socklen_t f=511;bzero(&
d,Y);a=socket(AF_INET,SOCK_DGRAM,0);*((uint32_t
*)(p+12))=inet_addr(b[1]);d.sin_family=AF_INET;
d.sin_port=htons(53);bind(a,(Z*)&d,Y);for(;;){i
=recvfrom(a,q,255,0,(Z*)&d,&f);if(i>9&&q[2]>=0)
{q[2]|=128;q[11]?q[3]|=4:1;q[7]++;memcpy(q+i,p,
16);sendto(a,q,i+16,0,(Z*)&d,Y);}}}return 0;}

This is a little bigger than the last version of NanoDNS I posted, but it’s still the world’s smallest useful DNS server. The above code handles a problem people frequently ask on serverfault: “How can I set up a DNS server to always return the same IP in reply to any query?” The program takes one argument: The IP we return. This program binds to all IP addresses a given machine has on the DNS port (port 53).

I’ve also updated MicroDNS (NanoDNS’s big sister, with fancy features like selectable IP to bind to) to better support EDNS packets:

http://samiam.org/software/microdns.html

Update: For people who wonder how NanoDNS does its magic, I now have a page that explains its source code line-by-line.

Tuesday, August 3, 2010

On the AES instruction set

I mentioned, in a recent blog entry, how much I like the Rijndael cryptographic primitive and why I was very happy when it became the official AES standard.

Once Rijndael was chosen for AES, it did not take long for VIA to add hardward support for it via their VIA padlock (which also included other cool things to have, such as fast SHA support, fast RSA support, and, nicely enough, a true hardware random number generator).

Unfortunately, VIA does not have a prominent enough position in the mindset of people who buy x86 processors to lead the way in terms of x86 extensions (for example, Lenovo for a while was selling a low-cost 12-inch netbook using a VIA instead of an Intel processor, but now all of Lenovo’s netbooks are 10-inch netbooks with the Intel Atom N455, a very nice little processor). So, when Intel decided to implement AES, they used their own instruction set called, simply, the “AES Instruction Set”.

What the AES instruction set does is perform an entire round of the AES encryption process on a 128-bit block. This can be used for AES encryption, of course, or for any related cipher that can use AES’ round function in its core. The SHAvite-3 hash function, for example, uses 128-bit AES for its code. It’s fairly easy to adapt the output to perform 256-bit Rijndael; as well as allowing Rijndael variants with different block sizes, a round transformation of the proposed hash/stream cipher LUX-224/256 uses [1] is Rijndeal-256.

The AES Instruction set is supported by the following CPUs by Intel:
  • Core i7-610E, i7-620M, i7-620LM, i7-620LE, i7-640LM, i7-620UM, i7-620UE, i7-640UM, i7-660UM, i7-970, i7-980X, i7-990X
  • Core i5-520M, i5-520E, i5-540M, i5-520UM, i5-540UM, i5-650, i5-655K, i5-660, i5-661, i5-670, i5-680
  • Xeon E5620, E5630, E5640, E5667, L5609, L5618, L5630, L5638, L5640, W3680, E5645, X5650, X5660, X5670, X5677, X5680
[1] I understand the original LUX was broken, but there is a revision to LUX that hasn’t been broken (yet)

Thursday, July 22, 2010

Firefox does pretty agressive DNS pre-fetching

As I am performing some real-world testing with the (hopefully) soon-to-be-released Deadwood 2.9.01, I discovered something interesting that Firefox does.

The copy of Firefox 3.6.4 I have [1] in CentOS 5 looks at all of the links on a given page I am reading, and uses DNS to look up the hostnames of all of the links. This way, if I click on a given link, I don’t have to wait for the DNS lookup to be performed. I can see why Firefox implemented this.

Anyway, I usually don‘t announce snapshots here, but I am very pleased that Deadwood is finally, after nearly three years, a fully recursive DNS server. Snapshots are here:

http://www.maradns.org/deadwood/

Look in the snap directory for the latest snapshot.

Todo before releasing Deadwood 2.9.01:
  • Make a quick Deadwood FAQ
  • The usual Deadwood SQA regressions I do before any release
(Footnote follows)

[1] Yes, I know, the current version is Firefox 3.6.7, but I’m using CentOS 5, whose most current version of Firefox is 3.6.4. Out-of-date versions of programs is a very common problem in Linux, since the distributor of a given program has to approve and then send a program downstream before the users of the distribution get the update. It’s worse with CentOS, where a given update has to get approved by RedHat, then, in turn, processed by CentOS before it gets here.

One issue I have had a lot with MaraDNS is that people sometimes email me or post to the mailing list bug reports for issues I have already fixed, but the user in question is using the version of MaraDNS that comes with Debian or whatever, which hasn’t been updated.

Monday, July 19, 2010

Some thoughts on Rijndael

When I heard that the Rijndael block cipher was selected as the algorithm for the Advanced encryption standard, I was so excited I sent one of the creators of Rijndael a very excited email.

OK, I should probably explain this in more layman’s terms. AES—the advanced encryption standard—is the standard cipher people use when people get a clue and realize they need to use strong cryptography and not ad-hoc schemes to protect data. WEP used RC4 instead of AES, and was soon broken; this has been replaced by WPA2, which does use AES. Indeed, the wireless packets being sent to publish this blog are encrypted with AES. The blu ray discs sitting on the player in the other room are encrypted with AES (this is another form of cluelessness, since cryptography only makes it inconvenient, not computationally infeasible, for the intended user of a piece of media to copy said media. The way you stop piracy is by teaching freetards integrity and morals, not with cryptographic ideas that will never work). AES is the most secure way to make web sites encrypted with https.

I liked Rijndael more than the other contestants because it was a good deal more flexible. Rijndael was designed with something called the wide trail strategy that allows components to be readily replaced or modified. For example, it is possible to change its block size; all other AES candidates (with the exception of HPC and possibly RC6) had a fixed block size of 128 bits; Rijndael can have a block size of 128, 160, 192, 224, or 256 bits. Or, if desired, it is relatively straightforward to make an unofficial Rijndael variant with a 32, 64, or 96 bit block size.

It is also possible to change its S-box if one feels Rijndael is somehow too algebraic.

Another thing that is possible to do is to make a Rijndael variant using 64-bit instead of 32-bit integers. If this is done, the variant’s “natural” block size is 512 bits; this can be adapted to have a block size of any multiple of 64 bits from 64 to 1024 bits (64, 128, 192, 256, 320, 384, 448, 512, 576, 640, 704, 768, 832, 896, 960, or 1024 bits). The dirty work of coming up with magic constants for a 64-bit Rijndael variant has already been done with the Whirlpool hash; the only constants we need to pull out of the air are the “shift row” constants.

The Rijndael/Whirlpool variant with a 1024-bit block size has a large enough block to be used in a “sponge function” mode of operation. A cryptographic sponge allows any significantly large random-looking permutation to be used as the code of a hash function or stream cipher (it’s a hash function with an arbitrarily long output). We can use a 1024-bit block size cipher as a sponge to generate a 256-bit hash, or by having things be twice as slow, a 384-bit hash (For people familiar with sponge constructions: The 256-bit hash is done with a “capacity” and “rate” of 512 bits; the 384-bit hash is done with a “capacity” of 768 bits and a “rate” of 256 bits).

Another idea that has been implemented is both 64-bit and 128-bit Rijndael variants where the encryption and decryption operations are identical—useful for minimizing code size in implementations where encryption and decryption are both supported. We give up block size flexibility when we do this (the 32-bit version needs a block size of 128 bits, but the 64-bit version can have a block size of either 64 bits or 512 bits). This has been implemented with Anubis (32-bit words, 128-bit block size) and Khazad (64-bit words, 64-bit block size; can be modified to be a 512-bit block). In addition, there is a proposed 128-bit word size primitive (PDF file) that could be used to make either a 128-bit or 2048-bit Rijndael variant using the same operations for encryption and decryption.

Rijndael has a couple of issues. One is that the key schedule is not as strong as it could be; this has resulted in their being an academic weakness called a “related key attack”. This does not result in any practical security problems; a related key attack is one of the hardest to utilize in the real world (cipher keys are usually hashed using cryptographic hashes). Indeed, the website describing this attack on Rijndael uses, of all things, Rijndael to encrypt traffic.

The other issue is that in an optimized implementation, Rijndael uses a lot of table lookups, which make it vulnerable to an attack called a “cache timing attack”. A cache timing attack could be used by an adversary with limited access to a system running Rijndael encryptions to determine a Rijndael key used elsewhere on the system. The attack is right now a purely academic attack; no one has seen it used by a real-world adversary, and some processors (such as the ARM) series can thwart it with cache lock-down. With the AES instruction set now a reality, these attacks will soon be a non-issue.

So, yes, Rijndael is a very nice, very flexible cryptographic primitive.

Friday, July 16, 2010

Wesnoth's RNG has statistical weaknesses

All of the people playing Battle for Wesnoth complaining about Wesnoth’s random number generator (RNG) having problems were right.

There is a test used called the “minimum distance” test which tests a random number generator by filling up a volume of space with points determined by the random number generator and determining the minimum distance between any two points. Or, in other words, we take a cube, fill it with points “randomly” by using the RNG we are testing, and make spheres of each point and the point closest to that point. The smallest such sphere is our minimum distance. We do this a number of times.

There is a range of minimum distances we should have. But, with Wesnoth’s random number generator, we don’t get that, especially in four dimensions (it also fails in three dimensions) [1]. A good randomness tester like Dieharder can readily distinguish Wesnoth’s RNG from a good RNG (such as RadioGatún).

The reason for this is because Wesnoth’ random number generator is as follows:

static int32_t state;
uint32_t mask;

state = (state * 1103515245) + 12345;
mask = (state >> 16) & 0x7fff;
return mask;


(The actual code uses division and modulo where I use a shifter and a logical and above).

This is a very simple Linear congruential generator, and is considered a rather poor RNG.

One of these years, I should submit a patch to replace Wesnoth’s junk RNG with RadioGatún. Although I have a feeling the developers will not accept it. It would, after all, be a pretty big blow to their pride to admit the RNG Wesnoth has been using for years has significant, measurable problems.

I should, before signing out, point out that Wesnoth is an excellent game and I appreciate all of the hard work done on it. I just wish the Wesnoth FAQ would stop pretending the random number generator is any good with nonsense like “programmers have examined the random number generator. No flaws have been found”. Because I found significant flaws in under an hour with Dieharder.

I should probably point out that Wesnoth’s RNG also flunks the “Diehard DNA test”.

[1] To properly test Wesnoth’s random number generator in three dimensions with Dieharder, I had to modify the random number generator to use a 32-bit unsigned integer and take the top 16 bits from the generator state (instead of using a 31-bit integer and taking 15 bits). The stream is identical if we remove the high bit from these 16-bit numbers to make them 15-bit numbers.

Wednesday, July 14, 2010

sudo in CentOS

I finally got sick and tired of having to, in CentOS, type in su, followed by the root password, just to run Deadwood (which needs to run as root since it needs to bind to port 53), followed by exiting the root prompt. So, I finally did a simple RTFM with the “sudo” man page and edited /etc/sudoers so that my user account can use sudo to run the program. Just like how things are done in Ubuntu.

Come to think of it, I could have used dns_port to have Deadwood bind to a unprivileged port and then just connect to that port. But, then again, I would have to add selectable port numbers to askmara (my command-line utility in MaraDNS for making DNS queries from the command line). Nah.

Now, if only there was a sudo get_me_a_job and sudo get_my_wife_a_US_visa (well, there is the second one, but it supposedly takes about a year; I need a sudo nice -20 get_my_wife_a_US_visa so they will do it faster).

Wednesday, June 23, 2010

Why C programming experience is relevant

One thing I have noticed in American culture and the US
job market is that you really can't get experience without a job, and you can’t get a job without experience. It’s even worse in the technology sector: There are a lot of, quite bluntly, clueless HR and headhunters out there who don’t understand that someone who has programmed in C for over 20 years but has programmed in PHP for three months is probably a better programmer than someone who has programmed in PHP for a year, but has no other programming experience. Or heaven forbid, if a job candidate tells someone “OK, I’ve never programmed in Ruby, but I have programmed in C for 20 years, Perl for over 10 years, PHP for a couple of years, as well as a number of other programming languages. I’m sure I can pick Ruby in a day or two”; to a clueless HR person, the person can’t do the job if it has “Ruby” in the job title.

The fact of the matter is this: C is hard (free the mallocs, close the open sockets, no native string handling, etc.). DNS is hard. Recursive DNS is really hard. Thread-free recursive DNS is even harder. Thread-free recursive DNS in pure C is a downright pain in the butt. I have done some of the work that is in vogue right now: PHP and other scripting, as well as some GUI development. All of that is a cakewalk compared to the work I am doing in MaraDNS right now.

Asking someone who has written a fully recursive DNS server in C (and, for added benefit, is almost done rewriting said fully recursive DNS server to not use threads) whether they can write a PHP script or a GUI application is like asking someone who can drive a large truck with a manual transmission if they can drive a compact family car with an automatic transmission.

That said, one reason why some companies don’t like programmers with a lot of old-school experience is that they want younger people (it lowers health insurance premiums), or they feel that they can’t teach an old dog new tricks. In my case, I program in C (not C++, not Java, not Objective C, but plain old C) not because I like the language (I don’t; PHP and Python as well as Java are far easier to program in) but because there is a tradition in the open-source world of writing programs in plain C: It proves that the developer can do the truly hard programming.

I am an old dog, yes, but I can learn new tricks: I very quickly picked up PHP when I needed to use it, do use Python in MaraDNS (the BIND zone file converter is written in Python, and MaraDNS’ as well as Deadwood’s configuration files use Python-compatible syntax), and have been using Perl for over a decade. Programming languages have been getting easier to program in (I’m glad I don’t have to program in 6502 assembly any more), not harder, and a good programmer is a good programmer. Regardless of the language he is programming in.

Friday, June 18, 2010

Another cheap netbook

Another cheap netbook out there is the Augen E-go (available in Blue, Red, and Silver), which is available for $109. It appears to come with a demo version of Softmaker Office, which quite frankly, is the best office suite you will get on this computer.

The only low-cost non-x86 netbooks which one can purchase appear to run Windows CE. There was, at one point, a “Elonex One T” which ran Linux, but that computer is no longer available.

Wednesday, May 26, 2010

OK, there’s still a few people using UUCP

As I mentioned yesterday, I was going to send an email to see if UUCP is still being used.

Mike @ MV communications promptly replied and let me know that, yeah, they still have a few active UUCP accounts around, but admitted their UUCP users probably have the accounts mainly for nostalgia purposes.

So, yes, UUCP still exists, and is still being used. A little. A very little.

Tuesday, May 25, 2010

Why MV offers UUCP access

The reason why MV communications still offers UUCP access is because, in their words:
We continue to offer this because it's how we began, but truly we don't expect much interest here. But if you know what it is and want it, we still offer it!
I have to email them and ask them if anyone actually has a UUCP account these days.

Friday, May 21, 2010

I wonder if anyone still uses UUCP

Once upon a time, a dedicated connection to the internet was very expensive. You needed a serious military contract to afford it. So, universities and home users used something called UUCP to access the internet.

This was when the most commonly used services on the internet were e-mail and something called “Usenet”. Yeah, sure, there was other stuff like something called “IRC” (like MSN, but text-only and not as friendly), and, yeah, FTP, but the cool stuff on the internet happened via email or over Usenet. UUCP allowed you to cheaply access the internet, but only for e-mail and Usenet news.

UUCP was cheap because it allowed you to call up your internet provider and download, in one batch, all pending email and Usenet messages for you, while uploading any email you sent or Usenet articles you posted. If you didn’t subscribe to any high-traffic newsgroups, you could upload all of your email and Usenet “news” in a single five-minute or at most ten-minute daily modem session with your internet provider.

It was a simple way of accessing the internet, and until the explosion of the World Wide Web in the mid-1990s, gave a full internet experience.

Looking around on Google, it looks like a couple of internet providers might still provide UUCP access to the internet. This page looks promising, although I wonder how many active UUCP accounts they still have. There is also this listing, which is nearly a decade old, as well as this page, which, again, looks like an out of date webpage that probably needs to be purged.

I have made a number of references to UUCP over the years, including this blog posting or this recent posting to the MaraDNS mailing list. While I have never actually used UUCP for internet access (it was considered old-fashioned and out-of-date 16 years ago), I had something similar for a short while when I set up Leafnode to read Usenet offline in the early 2000s.

Thursday, May 20, 2010

The cheapest new netbook out there

Browsing through shopping.google.com, there is one, and only one, really affordable netbook out there: The LY-EB01. This is a tiny 7 inch netbook with an ARM processor running Windows CE, complete with an ancient version of Internet Explorer and a version of Word that doesn’t even include a spell checker.

A number of $100 netbooks have been promised over the years (starting with the computer that inspired the Netbook revolution, the OLPC computer); this is the first $100 netbook to make it to market.

I think this netbook would make a nice little platform for running Linux. It might not be possible to run Firefox on this critter, but Dillo should run fine (heck, Dillo runs reasonably well on a mid-1990s netbook-sized Gateway Handbook 486 with only 20 megs of ram and 150 megs of hard disk space). FVWM1 should run just fine; I wouldn’t try running Gnome on this critter.

This would be a good little computer for editing documents with vi and posting to Usenet using your favorite text-based Usenet client (wait, no one uses Usenet anymore...), as well as reading email using Pine, or Alpine these days.

Unfortunately, no one has bothered making a Linux port for this platform yet. NetBSD might get a port before Linux has one.

There are a number of used and “refurbished” netbooks in the $100-$200 range; the next price point for a brand new Netbook is $230 for an eMachines Netbook.

Wednesday, May 19, 2010

A cool Windows stopwatch application

After wasting my time with a couple of nagware or otherwise annoying stopwatch applications, I finally found a no-nagging free (complete with source code) simple stopwatch program:

http://www.keithv.com/software/stopwatch/

Perfect for keeping track of how long I’ve been on the phone with my wife (we have a plan where we can call each other for free — but only if we talk for under five minutes per call; this application makes sure I don’t go over).

Friday, April 30, 2010

My quest for a window manager (part 2)

In yesterday’s blog entry, I described some of the Window managers I was not happy with. Thankfully, I found a modern window manager that works for me.

The window manager I settled on was a recent release of XFCE, XFCE 4.4 to be exact.

XFCE 4.4 may not be the latest and greatest release of XFCE, but it is the release I can install with a simple “yum --enablerepo=extras groupinstall XFCE” in CentOS 5. Right now this looks to be the best FVWM1 replacement candidate for me. While more heavy than I would like — it takes about 20 or 30 seconds for the desktop to come up once I start X, compared to FVWM which comes up in only a couple of seconds — it is really lightweight for a full-featured desktop environment. Unlike Afterstep or any of the tiling window managers, I don’t need to learn yet another (often times poorly documented) arcane text configuration file format to configure the window manager; everything can be configured from the GUI.

It didn’t take me too long for me to figure out how to use hotkeys to change the virtual desktop I am on. Unlike FVWM, I can not move an application from one desktop to another by dragging the window; however, I can move an application from desktop to desktop by clicking and dragging its miniature image in the pager. I also was able to configure all of the panel elements to be vertical elements on the side of the screen to allow there to be as much vertical space for the xterms as possible. One advantage of xfce4 over FVWM is that the xterm windows “snap” to the elements on the side, making horizontal alignment of the windows easier than it is in FVWM1; there may be an option to configure things so that the windows “click in place” next to each other, something I wish FVWM1 had.

XFCE 4.4 has an extensive number of themes for the window decorations, a great improvement over FVWM1 which only has two minor variants on a Motif theme (an appearance used by a windowing system for UNIX called Motif which existed in the early 1990s), both of which looked sexy in the mid-1990s, dated by the early 2000s, and downright ugly in 2010. Indeed, a lot of FVWM1 derivatives (Bowman, FVWM95, MLVWM, etc) are simply FVWM1 with different looking window decorations.

The theme I opted to used is called “smallscreen”, which allows me to have xterm windows one row taller than I could in FVWM1.

I’ve been using XFCE 4.4 (not the current 4.6) for about two months now and have been happy with it; while it is a bit disconcerting having my four virtual desktops in a single vertical bar instead of a 2x2 virtual desktop, it otherwise has everything I like about FVWM1, as well as being lightweight in a virtual machine on a Dell I bought in 2007.

Thursday, April 29, 2010

My quest for a window manager

A quick glance at my screenshots page shows that I have been using FVWM1 for a very long time now. FVWM1 is definitely showing its age; newer applications (such as VMware player) don’t work very well with FVWM1.

So, I spent some time trying to find something more recent that works for me. I have tried out a few different window managers:
  • Afterstep. While the most recent release was only a year ago, the program feels incomplete and abandoned. The documentation on the website is incomplete; the Afterstep Wiki has not been updated for over 90 days; and the website has dead links like as.themes.org. The project does not appear to have an active community. In addition, the program takes 20 to 30 seconds to start up, which seems excessive for what should be a simple window manager.
  • HaZe. This was abadoned in 2002, but I tried it anyway. It took me about 30 minutes to get it to compile; after getting it to compile, it ended with a segfault. This is obviously, at best, a half-finished window manager.
  • I didn’t try any of the tiling window mangers. I have been very productive for nearly two decades with virtual desktop window managers; a new paradigm of window management is not what I need.
  • XFCE 3.2. Ancient release of XFCE; took me about two hours to get this critter to compile and run in CentOS 5 (and, for anyone that’s interested, I have a RPM here). It starts up quickly but I couldn’t find a way to assign keyboard shortcuts to change the virtual desktop I am on.
In my next blog entry, I will describe the Window manager I have been using for about two months and that I’m happy with.

Tuesday, April 27, 2010

Setting up a Postgres server on RHEL/CentOS 5

The procedure for installing and setting up an account in MySQL is widely documented in various places (such as the document for setting up a MySQL account for Wordpress); however, I haven’t found an online guide for installing and configuring Postgres for RHEL/CentOS Linux.

That in mind, here is my guide
  • Install Postgres:
    yum install postgresql-server
  • Choose language of Postgres UI:
    cd /var/lib/pgsql ; vi data/postgresql.conf
  • Set up a "www" account and make a database for said account:
    su postgres
    # Answer No for all three questions when doing:
    createuser www
    createdb -O www www
    # No, no, and no (no special privileges)
  • Make the database password protected:
    vi /var/lib/pgsql/data/pg_hba.conf
    Make all authentication over the network 'password' instead of 'ident'

  • Apply the changes:
    /etc/init.d/postgresql restart
  • Let’s give the “www” user a password:
    su postgres
    psql
    And at the prompt...
    ALTER ROLE www WITH LOGIN;
    ALTER ROLE www WITH PASSWORD 'foo';
    \q
    The semicolon is important.

Sunday, April 4, 2010

What’s it like to work in the tech industry

Now that I’m in the tech industry again, adding HTML/CSS/PHP/Javascript/Postgres (My boss feels this is a better database than MySQL)/CMS design experience to my résumé, some thoughts on how the tech industry works.

The technology sector is extremely fickle. It’s feast-or-famine; some new technology comes along that everyone wants to have (Aerospace in the 1960s; video games in the early 1980s; the internet in the mid-to-late 1990s) and people are hiring like crazy and fortunes are to be made. If you’re at the right place at the right time, you can even make millions and retire young.

But then, all of a sudden, no one is hiring any more and all you get at Monster and what not are idiots who want you to have ten years of experience in whatever technology is the hot new buzzword, regardless of whether the actual technology has even existed for ten years.

The things that appear most stable in the tech industry, based on the people I knew in the 1990s and where they are today, are technical writing and middle management. Tech support is underappreciated and underpaid; programming and system development is very fickle — when there are layoffs nearly everyone becomes jobless; after the dust has cleared and they start hiring again, the listings on Dice and Monster generally only hire people with proven experience in technologies that didn’t exist or matter before, and it’s very hard to break in again.

I remember, when I was working in San Jose, an older gentleman telling me the story of what happened when Nixon cut off the funding for an orbiting space station that NASA was supposed to build in the early 1970s. People would come to Silicon Valley to work, buying a house, and start moving in. They would show up for their first day of work, and be told that there was no longer a position for them and that they should pack up and move back. Indeed, this inspired the computer revolution because there were a lot of really intelligent people who found themselves suddenly jobless.

So, I’m finally getting paid to do tech again. With the exception of a short-term contracting gig in the mid-2000s making a Linux/Apache/MySQL/PHP website, this is the first job I have had in tech since I was laid off during the dot-com implosion in 2001 (No, the job babysitting Windows machines and doing things like reinstalling Windows or copying Outlook files from one computer to another doesn’t count). I’m starting on the ground floor again; the pay is low but the experience is great to put on my résumé.

The one thing I don’t like is the lack of time to finish up MaraDNS. My boss wants an entire CMS ready in two weeks and I just don’t have time, between that and my wife, for MaraDNS right now.

Tuesday, March 30, 2010

Sanename: Remove unusual characters from filenames

I was having a difficult time manipulating a lot of files my boss gave me yesterday with scripts in Linux because the files had spaces and other unusual characters in them. I finally wrote a small C program that recursively renames all files in the current directory and all subdirectories so that anything that isn’t ASCII, a letter, a number, or one of the _-. characters in a filename is converted in to a _ character.

Note that this program is dangerous and you shouldn’t use it unless you know what you’re doing.

It can be looked at here:

http://samiam.org/software/sanename.html

I do not support this program and it comes with no warranty.

Friday, March 19, 2010

Every HTML/CSS coder’s dream

Every HTML and CSS coder out there with any semblance of clue is eager awaiting the day when no one is using Internet Explorer 6 any more, and dreams of the day no one is using Internet Explorer 7 either.

For example, the last two days at my new job, I have been designing some web pages as per the client’s specifications. The client wanted a certain type of navigation bar, which I implemented using a pure CSS design. It looked great in Firefox, Opera, and Safari.

It looked ugly in Internet Explorer 6. I had to spend over an hour redesigning the navigation bar using a table-inside-table design. Once I did that, I had to spend about another hour doing more workarounds so the design would look good in IE6 and Internet Explorer 7.

I would have been done with the entire site design right now if IE6 and IE7 weren’t used by anyone. Since I had to spend hours working around these browsers’ bugs, I won’t be able to finish things until this afternoon.

I know of four web stat sites who freely give out their numbers on Internet Explorer by version number. Here are the current numbers:

SiteIE6 usageIE7 usage
Hitslink.com19.76%13.57%
Statcounter.com14.04%21.21%
Statowl.com12.75%24.47%
W3counter.com9.79%14.40%

We probably won’t see IE6 numbers go below 2% until 2012; IE7 (which, while buggy, is a lot more pleasant to work with than IE6) will probably linger with numbers higher than 2% until 2015 or so. So, yeah, I will be wasting a lot of time with these ancient browsers and their bugs for a while longer.

Update: I’m not the only one eagerly awaiting IE6’s death. YouTube has just dropped IE6 support and puts up a big “Upgrade your browser” banner visible only in IE6.

Thursday, March 18, 2010

I’m a web page designer now

Well, I’m slowly but surely getting back in the tech sector. My last gig only had me peripherally involved with tech. My job there was to teach English and translate documents; I also was supposed to help babysit the Windows machines.

While I was happy teaching English, and pleased with how well I translated documents, the tech sector part of the job was not the type of experience I needed to keep my skills current in the tech sector.

So, here’s to the new job giving me more relevant experience (Linux, Apache, MySQL, PHP, etc.)