It’s not often I write about “meeja” (comedy double-quotes intended). As we all know the dead tree newspapers are dying, spectacularly. They’re having particular trouble fighting the Internet, where any idiot can spark up a tumblelog and start… erm… posting… erm… crap… Never mind. I had a point somewhere. Oh yeah, that was it.
Rupert Murdoch has had enough of this Internet freeloading and is planning on charging for access to his media on the Interwebs. Of course, many have laughed with derision but Rupert Murdoch is not your average tumbler. He’s a multi-millionaire media mogul who has shaped the media and is probably up there with Berlusconi in terms of it’s manipulation, just on a much bigger scale.
Here’s the kicker: Murdoch’s plan will probably work. If you’re reading this, you’re probably used to the Internet being free, but you’re not his target demographic. Murdoch runs Fox News, major newspapers in most of the developed world, TV Networks and MySpace amongst other indulgences. If anyone has the capacity to convince Joe Fox News viewer to pay for Glenn Beck’s blog posts, it’s Murdoch. If anyone has the ability to make your average Sun reader pay for thesun.co.uk, it’s Murdoch.
What you may well see is premium media promoted on TV, Radio and newspapers owned by News Corporation and of course the only way you’ll get to see it is by paying for it (unless you’re one of those copyright infringing downloader types).
I for one welcome it. A Murdoch free Internet is a happy Internet.
My job is so fucking unbelievable. I’ll try to sum it up by first telling you about the folks I work with:
First, there is this supermodel wanna-be chick. Yeah, okay, she is pretty hot, but damn is she completely useless. The girl is constantly fixing her hair or putting on makeup. She is extremely self-centered and has never once considered the needs or wants of anyone but herself. She is as dumb as a box of rocks, and I still find it surprising that she has enough brain power to continue to breathe.
The next chick is completely the opposite. She might even be one of the smartest people on the planet. Her career oppertunities are endless, and yet she is here with us. She is a zero on a scale of 1 to 10. I’m not sure she even showers, much less shaves her “womanly” parts. I think she might be a lesbian, because every time we drive by the hardware store, she moans like a cat in heat.
But the jewel of the crowd has got to be the fucking stoner. And this guy is more than just your average pothead. In fact, he is baked before he comes to work, during work, and I’m sure after work. He probably hasn’t been sober anytime in the last ten years, and he’s only 22. He dresses like a beatnik throwback from the 1960’s, and to make things worse, he brings his big fucking dog to work. Every fucking day I have to look at this huge Great Dane walk around half-stoned from the second-hand smoke. Hell, sometimes I even think it’s trying to talk with its constant bellowing. Also, both of them are constantly hungry, requiring multiple stops to McDonalds and Burger King, every single fucking day.
Anyway, I drive these fucktards around in my van and we solve mysteries and shit.
I’ve been importing my home music library but found iTunes kept importing everything twice. I tracked down the source of the problem to be my .m3u files. When iTunes imports a folder and finds a .m3u instead of importing it as a playlist it imports all the files referenced inside the .m3u even if they’ve already been imported. This is stupid, and one of the many reasons I hate iTunes. iTunes has a show duplicates function, but after importing my entire library twice I didn’t want to go and click every. other. song. ad. nauseum.
It appears that all the iTunes duplicate finding software is shareware. There are demos around but I wanted something free and quick that would automatically remove duplicate files, and thanks to Daniel Choi this iTunes Duplicate Track Remover did the job nicely.
Migrating an SQLite-based Django App to PostgreSQL
This is mainly for my notes, so I’ll apologise now if this doesn’t work for you.
Getting Started The first thing to do is back up our data into an easy to use (mostly) database agnostic (mostly) format. Django provides the dumpdata and loaddata commands to do this. To dump data for the analyse application to a file called dumpdata-desktop.json you do the following (from your project directory):
To dump everything just use dumpdata with no arguments and redirect the output to a file. Make sure you have enough memory to do this as earlier versions of Django don’t stream dumpdata output. I keep a copy of htop running whilst I’m doing this. If it seems really inefficient that’s because it is. The analyse app I’m dumping uses a 45mb sqlite3 database, but dies on anything less than a few gig of memory for dumping. If you’re on a resource constrained system, you can always move the sqlite database over to a django installation with more memory. Another option is to use a large swapfile/partition, but that’s going to slow things down substantially. If you’re really stuck, you can dumpdata individual applications and models. Once that’s done, you should have a serialized file containing all your django goodness ready for import into postgresql, mysql or anything else django can work with.
Configuring PostgreSQL Now we need to set up postgreSQL. The first thing to do is to create a django user. The easiest way of doing this is to sudo -H -s to root and issue the following:
sudo -u postgres createuser -P analys
Replace analys with the username you want to use. Note that I’m using analys, not analyse as this is a reserved keyword for postgreSQL. Now we need to create a database for the user to use. In my case I need two databases (one for two similar but slightly different applications) that will use the same user. It may be better to use separate users for separate databases if some segregation of data is required, but I don’t need it for my two apps.
Once the users and databases are created it’s time to give django access. To do this we’ll need to change the pg_hba.conf file, normally contained within something like /etc/postgresql/8.3/main/pg_hba.conf on Debian-based systems.
Go down to the section that specifies the users and how they connect and add the following:
local analys_desktop analys md5 local analys_server analys md5
Make sure you replace the database and user settings with your own. Restart postgresql. Assuming all goes well, we’re ready to set up Django.
Putting it all together Now all we need to do is configure Django to use the new database and load the database back in. Go into settings.py and change the following settings:
DATABASE_ENGINE = ‘postgresql_psycopg2’ # ‘postgresql_psycopg2’, ‘postgresql’, ‘mysql’, ‘sqlite3’ or ‘ado_mssql’. DATABASE_NAME = ‘analys_desktop’ # Or path to database file if using sqlite3. DATABASE_USER = ‘analys’ # Not used with sqlite3. DATABASE_PASSWORD = ‘password’ # Not used with sqlite3. DATABASE_HOST = ” # Set to empty string for localhost. Not used with sqlite3. DATABASE_PORT = ” # Set to empty string for default. Not used with sqlite3.
Changet the DATABASE_PASSWORD value to the actual database password. Next we need to run python manage.py syncdb. Don’t create a superuser if you did a full dump. Finally we use the loaddata command to restore our data.
"The Associated Press (AP) reported sheriff’s deputies responding to a domestic disturbance call yesterday alleged they saw 20-year-old Acea Schomaker smoking marijuana through a piece of garden hose attached to a duct-taped, plastic glass box in which the cat had been stuffed."