Building custom kernels for Ubuntu

Tags:

I’ve been building kernels for a very long time. In fact, I even wrote my own kernel HOWTO describing how to do it.

When I install a new Linux distribution from original media, the first thing I do, is replace the stock kernel with my own custom build, which is optimized for my own environment (tuning HZ, removing unused drivers, patching some other interfaces, etc.).

When I moved from Debian to Ubuntu, building kernels became a problem. All of the kernels I’d try to build from the upstream source would fail to complete a boot. At first, I thought it was something with mkinitrd(1). I tried to fix that and it would still fail to complete a boot.

So I started looking for some better options, and came up with this very small HOWTO:
Read the rest of this entry »

Won’t someone ELSE think about the children?

This is what we’ve become. We’ve taken one step closer to becoming a society that takes no responsibility for anything our children do.

Think of the Children

The powers-that-be are looking to enforce a Super V-Chip to not only screen and filter television content, but content on all sources of media ranging from mobile phones to the Internet.

What is a “V-Chip“? I’m glad you asked!

V-chip is a generic term used for television receivers allowing the blocking of programs based on their ratings category. It is intended for use by parents to manage their children’s television viewing. Most 13-inch and larger televisions manufactured for the United States market since 1999 and all units as of January 2000 are required to have the V-chip technology. Many devices similar to the V-chip have been produced.

The rated programs’ signals are encoded according to the rating, on line 21 of the broadcast signal’s vertical blanking interval using the XDS protocol, and this is detected by the television set’s V-chip. If the program’s rating is outside the level configured as acceptable on that particular television, the program is blocked.

As with all technology, there are simple, non-technology solutions around it. Children are smart, I know my daughter is. If I put a lock on the television or her mobile phone, she’ll just go to a friend’s house and watch the “forbidden” show there, or on her friends’ cellphones.

Luckily for my daughter, she has parents who care about her upbringing, and she knows what is wrong and right, and she’ll make the decisions that are best for her. Telling a child that they’re not allowed to do something, is a sure-fire way to get them to figure out a way to do that exact thing without your knowledge.

At what point did we stop becoming parents, and start blaming everyone else for the poor habits and upbringing of our own children?

Another glaring flaw in the iPod

I use my iPod quite a bit for relaxing, cycling, listening to podcasts, thousands of songs ripped from my extensive CD collection and carrying bootable Linux ISO images to install Linux on other machines via my iPod. I use it a LOT!

iPod 5th Generation podcast bugs

One of the most annoying things about the iPod, which still hasn’t been addressed, is the ability to play podcasts in series. Let me explain…

I use AmaroK on Linux and iTunes on Windows to manage the music and files on my iPod. I subscribe to several weekly podcasts, and I keep several of each podcast on my iPod at once, so I can listen to several weeks in a row in one sitting.

When I choose to listen to these podcasts, I would like to listen to these in reverse chronological order (oldest one first), which helps me catch up on news, latest trends and so on.

The major flaw in how the iPod handles these, is that there is no grouping of these podcasts, other than the title.

When I listen to one podcast in one group and it completes, I am brought back to the main iPod screen, and I have to scroll all the way back from Music → (scroll down 5 entries) Podcasts → (scroll down to my podcast title) → (scroll down to my intended date entry) → -> Select.

Every podcast I want to listen to, requires me to directly interact with it at least 10 steps. This is not exactly wise, especially if you listen during a morning commute to work.

When I’m playing an album of music, it will play Track 1 .. Track n, until the album is completed. Why aren’t podcasts treated the same way? Why not make each podcast “group” (“Ask a Ninja”, for example) treated like an album, and play each track until all tracks are played?

There are millions of iPod users out there. I can’t believe that this hasn’t been requested at least a thousand times from the users.

Does nobody listen to podcasts with their iPod?

Humorous Help of the Day

I was trying to play a .mid file from a webpage (thanks to Firefox not being able to handle that correctly, sigh), and stumbled upon xplaymidi.

$ xplaymidi 
Playmidi 2.4 Copyright (C) 1994-1997 Nathan I. Laredo, AWE32 by Takashi Iwai
This is free software with ABSOLUTELY NO WARRANTY.
For details please see the file COPYING.
usage: xplaymidi [-options] file1 [file2 ...]
type 'xplaymidi --help' for more details

Oh, I’ll try to find out what options it supports:

$ xplaymidi --help
Playmidi 2.4 Copyright (C) 1994-1997 Nathan I. Laredo, AWE32 by Takashi Iwai
This is free software with ABSOLUTELY NO WARRANTY.
For details please see the file COPYING.
usage: xplaymidi [-options] file1 [file2 ...]
type 'xplaymidi --help' for more details

Well that was mighty useful.

A simple one-line patch fixes all:

--- playmidi-2.4.old/playmidi.c       2007-08-01 10:08:04.000000000 -0400
+++ playmidi-2.4.new/playmidi.c   2007-08-01 10:04:45.000000000 -0400
@@ -481,7 +481,7 @@
 
     if (error || optind >= argc) {
        printf( "usage: %s [-options] file1 [file2 ...]\n", argv[0]);
-       if (error >= 0)
+       if (error == 0)
          printf ("type '%s --help' for more details\n", argv[0]);
        else
        printf( "  -v       verbosity (additive)\n"

Sacrifice my morals, or work for Primerica

Primerica, a Multi-level Marketing companyIt is now 6:49:21pm on a Sunday night. I am sitting at home on the couch, writing up some code for my Wikipedia projects when I receive a call on my mobile phone, from a local number in the 860 area code.

The nice woman tells me she’s found my resume online and thinks I’d be interested in a position she has.

She then tells me she is from “..a division of CITI Group”. She asks me if I’m still looking for work. I tell her that I am still actively considering positions. Then she asks me…

“..do you ever consider doing something unlike anything you’ve ever done before.”

I say “Sure, every day.”

Then she restates that she’s is from “…a division of CITI Group, a major financial services group”, and asks me if I’d like to hear more. I say “Yes, go on…” and then she says she works for a company called “Primerica”.

I think to myself… “Primerica… Primerica… I’ve heard that name before.”

DING! Primerica is an MLM company!

So I ask her…

“If this opportunity has anything to do with Sales, Marketing or Direct Marketing… I’m sorry, but I’m not interested.”

She said something very nice in return, even though I just killed her referral bonus right there. She said something like “I guess we conclude our call here. Good luck in the future.” and I said the same.

CLICK!

A quick Google revealed this post that has some detailed information on the scam:

There will always be a huge drop out rate and while you may have made a $100,000 by recruiting x amount of people… it’s really cheap change compared to the money Primerica made off of you and it’s short term money in that eventually you won’t be able to find new recruits and/or new people to sign up for their finanical programs.

So what happens at this point is the pyramid collapses bottom up and eventually you will find yourself having no recruits to capitalize on and be forced to drop out yourself.

A refreshing view from a refreshing candidate, Ron Paul

If you’re sick of the standard Doublespeak rhetoric from the Republicans and Democrats currently coming to the center in the current administration, take a listen to Ron Paul’s speeches.

I’m looking for a candidate that supports what the Constitution says, NOT what they THINK the Constitution says.

Let’s get back to the way we’re supposed to be running this country. The current front-runners in the 2008 campaign are not getting my vote, because they haven’t expressed that they’ll support my personal views, or the views of the rest of the country.

Ron Paul so far, seems to be the closest one to my personal views from what I’ve seen and read so far.

Squid + Privoxy + Tor for secure, transparent web browsing

With the advent of the new illegal monitoring going on in the USA, and ISPs being actively forced to log and snoop on their own customer’s behaviors, I’ve been advocating the use of Privoxy + Tor to help anonymize some of your browsing behavior and characteristics.

Privoxy is a web proxy with advanced filtering capabilities for protecting privacy, modifying web page data, managing cookies, controlling access, and removing ads, banners, pop-ups and other obnoxious Internet junk.

Tor is a toolset for a wide range of organizations and people that want to improve their safety and security on the Internet. Using Tor can help you anonymize web browsing and publishing, instant messaging, IRC, SSH, and other applications that use the TCP protocol.

To configure them to work in concert, just install privoxy and tor using your standard package management tools. Open up Privoxy’s configuration file (normally /etc/privoxy/config) and add the following line:

forward-socks4a / localhost:9050 .

The ending dot is significant, don’t forget to include it. You can put this anywhere in the file you want, but the most-likely place is around line 1064 or so in the standard configuration. Restart privoxy using whatever scripts or service management tools your host operating system provides.

Now there’s an additional tweak you can do to use Squid to pool and cache the sites you visit locally. To do that, you’ll need to change a few things in Squid’s configuration (normally /etc/squid/squid.conf):

http_port 8888
cache_peer localhost parent 8118 7 no-query default

# Some basic ACLs to allow local traffic, forbid outside traffic
http_access allow purge localhost
http_access allow localhost
http_access deny all

# Make sure we're ALWAYS using Privoxy and Tor, and not bypassing the cache
never_direct allow all

# And let's remove some headers which can be used to divulge some of our personal info
header_access From deny all
header_access Server deny all
header_access User-Agent deny all
header_access WWW-Authenticate deny all
header_access Link deny all

Restart Squid and you should be all set. In your application (for example, Firefox), you can set up your proxy server to be:

localhost:8888

Browsing will be slightly slower, but very clean and anonymized. If you want, you can also run pre-fetch pages with Squid to speed up access to lateral pages and links on sites you visit.

Using Firefox, I have an extension called SwitchProxy installed which lets me change my proxy configuration with a simple click, from “None” to “Squid (localhost)” to “Squid + Privoxy + Tor”, and so on. I highly recommend it.

In my personal configuration, I have a router which is configured to send every outbound request on port 80, and every incoming reply, to a Squid server running on FreeBSD. No client configuration is necessary at all.

With Squid on the BSD machine, I can set up Privoxy and Tor there, and transparently cache, secure, and anonymize that traffic without burdening the clients at all, no matter how many there are, or what OS they happen to run.

My router’s iptables configuration for that looks like this:

iptables -t nat -A PREROUTING -i br0 -s ! 10.0.1.3 -p tcp --dport 80 -j DNAT --to 10.0.1.3:8888
iptables -t nat -A POSTROUTING -o br0 -s 10.0.1.0/24 -d 10.0.1.3 -j SNAT --to 10.0.1.1 
iptables -A FORWARD -s 10.0.1.0/24 -d 10.0.1.3 -i br0 -o br0 -p tcp --dport 8888 -j ACCEPT

10.0.1.1 is my router, and 10.0.1.3 happens to be the FreeBSD machine running a very large Squid cache.

It works great, and clients behind my LAN never know the difference.

If you’re afraid of The Oracle taking too much of your personal browsing history for their own purposes, you can install the CustomizeGoogle extension and filter some of that out.

CustomizeGoogle lets you anonymize your Google UserID, filter out spammy websites, block Google Analytics cookies, and much more.

dspam Hackery 101, converting messages to mbox

dspam; go ahead, send me Viagra

I’ve been running dspam for many years here at gnu-designs, inc. We replaced SpamAssassin with it several years ago, because SA was just not getting any better at filtering spam away from user’s mailboxes.

After a few weeks of using dspam, our filtering performance was over 95%, and rising steadily. 3 years later, we weren’t seeing a single spam slip through to any user’s mailbox. It was very impressive.

Later, I added graymilter in front of dspam to thwart off even more spam. You can see the difference it made:

graymilter results

After a few years, Jonathan A. Zdiarski (author/maintainer of dspam) sold the dspam project to Sensory Networks, and it still continues to be updated on a regular basis today.

But there’s one thing that has always bugged me about dspam… the catchall for messages is stored in $DSPAM_HOME/dspam.messages, and it contains a concatenated list of all messages processed by dspam.

So far, so good… until you need to retrieve one back out of there.

The file is actually a literal concatenation of every message. With the amount of mail we receive, that file grows very large, very fast. I stumbled across a bug today with dspam where messages in the web interface were just vanishing after being forwarded back into the user’s mailbox as non-spam. I needed a way to go back in and retrieve the messages.

Enter the Swiss-Army Chainsaw again; Perl!

With a simple perl one-liner, I was able to turn this “useless text file” of concatenated messages into an mbox-format file I could load up in pine and read like a normal mailbox. From there, I could forward the false-positives back to the users, when the webui eats them for lunch. It looks like this:

perl -pi.$$ -e '$time=scalar(gmtime); s,^(Return-Path: .*)$,From dspam $time\n$1,g' dspam.messages

In simple terms, all this does is take the “Return-Path” line that appears at the start of each message, and pre-pends the “From ” line on the line right before it. Note that this is the “From ” (space after) line, not the “From:” (colon after) line. They are different.

That’s it. Now I can just do:

pine -f $DSPAM_HOME/dspam.messages -i

And away we go!

I’ll end up patching the source to produce this output at some point, but for now, this solved an immediate need I had to fix a critical problem.

I love dspam for what it does. The installation is not for the feint of heart, but after you get it set up, what it does is pure magic, and your users will love you for it. The web interface removes the bulk of the work of maintaining whitelists, filtering scores and other things, and delegates it to each user, where they can customize their own filtering however they choose.

Ending Spam, by Jonathan A. Zdiarski

Jonathan also wrote a book on dspam and filtering, and I highly recommend picking up a copy if you can.

We no longer pass laws, we sign Executive Orders

Its no surprise that the current Administration has taken it upon itself to continue to break the law in hundreds of ways and disassemble the oversight committees that are there to ensure those laws are enforced, but now we’ve reached a new low.

Bush Fucks the Country, again.

We no longer have to pass laws. Those pesky laws are always getting in the way of the real goal: A totalitarian, police state. We can’t have those annoying checks and balances getting involved here. We can’t get anything done, if they keep shooting down our great ideas!

So now we just sign Executive Orders instead. Without judicial oversight, no way to contradict the orders, they just get passed, and that is that.

Don’t continue to fall for this abuse of our way of life, a way of life our forefathers died to uphold and protect!

There are four boxes to use in the defense of liberty: soap, ballot, jury and ammo. Use in that order. Starting now.

But wait, there’s more about Cheney

Moments after I posted the last entry about Cheney claiming he’s not a part of the Executive Branch of government, and therefore not subject to the subpoenas, I found this interesting story that hints at Cheney about to invoke Executive Privilege to keep his secrets, well… secret.

Bush and Cheney are both liars

I’m sorry Dick, you can’t have it both ways. Either you are a member of the Executive Branch of government, and subject to the subpoenas, or you are not, and you cannot invoke Executive Privilege.

Every day, this government gets more and more unstable. Are we seeing the beginnings of Newspeak here?

Bad Behavior has blocked 867 access attempts in the last 7 days.