Unix

Linux self-education links.

Script to Turn IP Camera Uploaded Images into Videos (Unix)

This script combines individual photos into a video, and adds a timestamp to each frame. It's a poor mans security camera video maker.

Setting up the HP P1102w with Linux Ubuntu Gnome

The printer stopped working, so I had to look for instructions. Things have changed a lot since I got this printer. Originally, it required the proprietary HP drivers and utilities, because CUPS didn't have any support. It worked, but was a bit of a pain, and required running a program on the workstation, creating an hplip printer, and printing through that. It worked... but then the drivers stopped working. (Since I print so infrequently, I don't know when they stopped working.)

Django, forcing a specific migration

Migrations are awesome magic, until the magic fails. Then it's an awesomely frightening engine of change that threatens to wipe out your entire database.

So, before doing what I say, backup your database.

I had to enforce a "unique=True" constraint on a model. Migrations are supposed to automatically create a constraint in SQL, as well as its implied index. A quick look at the indexes (SHOW INDEXES FROM Model) didn't show the index.

How to SSH Tunnel to a Remote MySQL Server with Python

A demo of how to incorporate SSH tunnels into a Python system administration script.

Like all sysadmins, I write scripts to automate routine operations. Lately, though, I have needed to write scripts that automate routine operations on a remote system, and we need the security barriers to be a little higher than in the "old days".

We're accessing our database through an SSH tunnel, rather than via a regular encrypted socket. (The SSH connection will eventually require key pairs, and disallow regular passwords.)

WSGI, PSGI, Rack - learning some new backend stuff

(This is one of those articles I sometimes fear writing, because it reveals a vast gap in my knowledge. I've spend most of the past decade in PHP programming, with numerous forays into other langauges and frameworks, but mostly in the app dev end. I have to deploy my code and that's made me take forays lower into the stack.)

Mailman SMTPDirect SMTP session failure: 530, Authorization required

I was getting this logline in Mailman:

SMTPDirect SMTP session failure: 530, Authorization required

The problem was that SMTPDirect doesn't do authorization of users.

So you need to add two lines and some configuration to create ASMTPDirect, and use that module, which calls smtplib.login() and logs in before trying to send mail.

Salsa Petition Counts with Scrapy the Python Web Scraper

I was feeling like crap, so after taking the day off and taking a nap, I spent several hours learning Scrapy. Scrapy is a pretty awesome website scraper. This example logs into a website, extracts some data, and stores it locally.

Radeon R5 230 on Ubuntu Linux 13

It works. Haven't bought a graphics card since the mid 1990s, but did this because Gnome 3 feels a lot smoother with some extra cycles and memory. All the eyecandy effects now seem to run at around 20 fps, and the colors are nicer. Before, they were more like 10 fps and jumpy. This shows up in lspci as VGA compatible controller: Advanced Micro Devices, Inc. [AMD/ATI] Caicos [Radeon HD 6450/7450/8450]. Seems to be a bit of a power hog, but it doesn't use a fan, so it's not going to burn too much coal.

Find Your Compromised Email Scripts: Wrapper to Execute sendmail (or qmail-inject) for Web Apps

This is yet another sendmail wrapper to help detect webmail scripts that might be spamming. It's designed for the qmail with the QMAILQUEUE path, and the qmail-qfilter filter framework. You need to write a filter that will scan the mail going out, or use Spamassassin if you want general spam filtering.

What you do is, change the sendmail program setting in php.ini to run this program, which I call metasendmail.

Remote Syslog on Ubuntu for Zywall USG-50

Fire up Linux. I used Ubuntu, but Debian should be similar. Ubuntu comes stock with rsyslogd. It's almost ready to go, except that it doesn't have ports open to accept rsyslog messages.

Courier IMAP and POP3D Certificate Chains in PEM files

It wasn't entirely clear to me how to deal with these low-cost SSL certificates like the Comodo Positive CA SSL certificate. They come to you with several CRT files.

Note on Migrating from Qmail to Postfix

I got this done (i think):
- scanning old email addresses, forwards, and lists, and reconstructing the email and forwards and aliases for lists on a postfix instance

Discover the IP Address of a Cisco Aironet 1200 Series on Linux without IPSU

I got an Aironet 1200 and didn't have the serial cable, so I tried to use IPSU to find the IP address. I ran it in a VM, bridged the ethernet interface, and it failed.

Migrating Addresses from Qmail to Postfix

It should be called "The Nightmare of..."

(I haven't done this yet, but this is a sketch of what I'll try.)

Syndicate content