BigSmoke

Smokes your problems, coughs fresh air.

Page 34 of 52

Pazera Free MOV to AVI Converter 1.2

Ewald wants to be able to make video/photo montages of his life at la Boucoule. While there last month, I helped him along with Windows Movie Maker (WMM) a bit. WMM doesn’t like Quicktime video’s (as outputted by his camera), so I found a simple Windows program that wraps around ffmpeg to convert these movies to AVI format: Pazera Free MOV to AVI Converter 1.2.

Pazera Free MOV to AVI Converter 1.2

To make the generated AVI work in WMM, a few settings need to be changed away from the default. For this purpose I added a custom profile. Here’s the INI file, “00 - Geschikt voor Windows Movie Maker.ini”:

[MAIN]
AppName=Pazera Free MOV to AVI Converter
AppVer=1.2
OutputFormat=AVI
[AVI]
VideoCodec=1
VideoBitrate=Auto
VideoFPS=Auto
Video2Pass=0
DoNotCopyVideo=0
[MPG]
VideoFormat=0
MPEGVersion=0
VideoBitrate=Auto
VideoFPS=Auto
Video2Pass=0
DoNotCopyVideo=0
[AUDIO]
AudioCodec=0
AudioBitrate=Auto
AudioSampling=Auto
AudioChannels=0
DoNotCopyAudio=0
Volume=100
[ADVANCED]
Resolution=0
ResWidth=320
ResHeight=240
ForceVideoTag=0
VideoTag=XVID
CropTop=0
CropBottom=0
CropLeft=0
CropRight=0
AdditionalParams=

Now, Ewald will only need to select the right profile if he wants to prepare his Quicktime movies for editing with Windows Movie Maker:

Profile selection in Pazera MOV to AVI Converter

AJAX comment preview for WordPress

Yesterday night, after mucking around with my Subversion repo for this blog for way too long, I finally stopped annoying the designer of my new theme and uploaded it, one and a half year after the last major redesign. Anyway, while implementing the new design for the comment list , I decided it was time to have comment previews.

At some time, I had already installed (but not activated) the Live Comment Preview plugin, but that’s client-side only. I removed it because I want the comment to show as it would after being piped through all the hooks and filters that comments normally get piped through. Enter the AJAX Comment Preview plugin:

Other preview plugins don’t know what sort of changes WordPress will make to a visitor’s comment, but this plugin uses AJAX and other buzzwords to send each previewed comment through WordPress’ inner voodoo.

The result? With the click of a button, your site’s visitors can preview their comments exactly as they will appear when they submit them for realies.

You just gotta love their phrasing. 🙂 Enjoy the new preview feature.

First steps with Subversion’s new merge tracking

A while ago we succeeded in upgrading the Debian server where I keep many of my SVN repositories. (The server was running on “testing”, but we hadn’t dared to upgrade it for a long time until it came time to make it “stable” again with Lenny.) On of the upgraded packages in Lenny is Subversion, now at 1.5.1, which means that I can finally start using subversions new merge tracking features.

To be able to use merge tracking for my existing repositories, I first have to upgrade these. From the svn 1.5 release notes:

The Subversion 1.5 server works with 1.4 and older repositories, and it will not upgrade such repositories to 1.5 unless specifically requested to via the svnadmin upgrade command. This means that some of the new 1.5 features will not become available simply by upgrading your server: you will also have to upgrade your repositories. (We decided not to auto-upgrade repositories because we didn’t want 1.5 to silently make repositories unusable by 1.4 — that step should be a conscious decision on the part of the repository admin.)

The only other machine I’m using these repos from is my laptop, which, running Gentoo, is already at Subversion 1.6.2. So, how do I upgrade?

First, I made a backup of all our SVN repos using a script that Halfgaar made to run from cron. After running that script, I initialized the upgrade procedure:

/var/svn
svnadmin upgrade blog.bigsmoke.us
svn-populate-node-origins-index blog.bigsmoke.us

The last command is unimportant, but may speed up the next few operations. The release notes again:

After running svnadmin upgrade, you may wish to also run the svn-populate-node-origins-index program on the repository. Subversion 1.5 maintains a node-origins index for each repository, and builds the index lazily as the information is needed. But for old repositories with lots of revisions, it’s better to create the index in one step, using the aforementioned tool, than to have live queries be slower until the index has built itself. See issue #3024 for details.

With my data safe and the repo upgraded, it’s time to actually test the new merge tracking features:

~/blog.bigsmoke.us # Enter working copy (on the same server)
 
# I'm now in the lichtgekruid branch.
svn switch file:///var/svn/blog.bigsmoke.us/trunk
svn add wp-content/plugins/openid
svn ci -m "I was convinced this was a change which didn't belong to my feature branch" wp-content/plugins/openid
 
svn switch file:///var/svn/blog.bigsmoke.us/branches/lichtgekruid
svn merge file:///var/svn/blog.bigsmoke.us/trunk
# The last command was a real kicker, not having to find and specify the correct range of revision numbers.
 
svn ci -m "Merged changes from trunk to 'lichtgekruid' branch."
svn switch file:///var/svn/blog.bigsmoke.us/trunk
svn merge file:///var/svn/blog.bigsmoke.us/branches/lichtgekruid
# (Another spontaneous orgasm.)
 
svn ci -m "Merged 'lichtgekruid' branch back into trunk."

Ok, I know I could have simply changed all these projects to use Git, and I like Git. I love its simplicity and flexibility. But, call me old-fashioned; I have an SVN fetish, and so far I find its merge tracking quite convincing.

Besides all the gotchas and pointers in the 1.5 release notes, there’s a lot more info about merge tracking in the SVN redbook.

HP LaserJet 6P under Ubuntu

Because Arnold Pilon is migrating his workplace to Apple, I could get his old PC and peripherals for free. Among its peripherals was an old HP LaserJet 6P, still perfectly working.

My sister didn’t have a printer yet. I was surprised that installing it on her Ubuntu machine was simply a matter of selecting the printer type from a list. I wonder: is this thanks to CUPS? Can I expect this to work in all distros that include CUPS these days?

Anyway, the printer works and the scanner too (of which I forgot to jot down the type). The scanner was supported by Xane without requiring any configuration. When it comes to hardware configuration, open source operating systems often beat those from Redmond.

Configuring VPN server and client on Linux

Basically, there are two types of VPN’s: IP route and ethernet bridge. I configured an IP route VPN, based on this document.

First you need to generate certicifcates. The example scripts for that are located in “/usr/share/doc/openvpn/examples/easy-rsa/2.0”. I copied these to /etc/openvpn/easy-rsa for convenience.

Cd to /etc/openvpn/easy-rsa and edit vars to enter the data that is going to be included in your certifcates. You can also set the expiration time and key size here. Then do:

source ./vars
./clean-all
./build-ca
./build-key-server server
./build-key client1
./build-key client2
./build-key client3 (repeat as necessary. You can also name the keys properly, of course)
./build-dh

Then I’d copy the keys dir to /etc/openvpn.

You need to copy the ca.crt file to each client, as well as the clientx.crt and clientx.key, but then per client.

The server conf is this:

port 1194
proto udp
dev tun0
ca keys/ca.crt
cert keys/server.crt
key keys/server.key  # This file should be kept secret
dh dh2048.pem
server 10.66.0.0 255.255.0.0
ifconfig-pool-persist ipp.txt
client-to-client
keepalive 10 120
comp-lzo
persist-key
persist-tun
status openvpn-status.log
verb 3
# Redirect all traffic through VPN by setting 'almost default' gateway
push 'redirect-gateway def1'
# Replace DNS config with a server you specify, which can be access on the VPN.
push "dhcp-option DNS 10.66.0.1"

Then on the server, you need to configure SNAT (I don’t know if you also need to put “net.ipv4.ip_forward = 0” in /etc/sysctl.conf). If I understand correctly, you need to have such a rule per eth device you have. If you have a machine that has both a WAN and LAN and you want them to allow access on both the local net and internet, you need a rule like this for both ports.

iptables -t nat -A POSTROUTING -s 10.66.0.0/24 -o lan-eth-device -j MASQUERADE --match comment --comment "Allow VPN users to connect to things on this LAN."

Then on the client:

client
dev tun0
proto udp
remote <serveraddress> 1194
resolv-retry infinite
nobind
persist-key
persist-tun
ca keys/ca.crt
cert keys/client.crt
key keys/client.key
comp-lzo
verb 3

You should then be able to connect. Remember to allow IPtables access on all the machines. Configuring a proper firewall can be tricky. You can’t just use simple connection tracking; you must allow certain forward rules on the server (and client as well, I believe). On the client, you must allow everything on the input with UDP source port 1194. On the server, you must open incoming UDP target port 1194 as well, of course

It depends on the distro you’re using how to include the config into the boot procedure. Debian starts all config files per default (which can be configured in /etc/default/openvpn), Gentoo needs a specially named symlink in /etc/init.d.

Configuring Nagios to check a HTTP host

Nagios is an elaborate piece of software to monitor hosts and services. I will explain a bit how you can configure nagios to monitor an HTTP service. I’m assuming your nagios setup already has the default config files generic-host_nagios2.cfg and generic-service_nagios2.cfg, which tell nagios how to monitor hosts and services.

Most configuration is done in /etc/nagios3/conf.d. For some reason, the standard config files all end with _nagios2.cfg, so I guess this is old syntax. But, I don’t really know why these files are named that way.

Nagios comes with a bunch of default files to which you can add your hosts, services, etc.

First you have to define a host. If you’re monitoring on the machine itself, you could add a host to localhost_nagios2.cfg. Using the default localhost doesn’t work, because you need to access the machine using the address of the virtual host.

define host{
        use                     generic-host            ; Name of host template to use
        host_name               my-site
        address                 www.halfgaar.net
}

Then you need to define a hostgroup for your HTTP servers. A default HTTP hostgroup is probably already defined, so you can add your host to http-servers in hostgroups_nagios2.cfg

define hostgroup {
        hostgroup_name  http-servers        
        members         localhost, my-site # comma separated
}

Lastly, you need to configure a service. Nagios comes with a default one for the hostgroup http-servers so you should be done, but just in case:

define service {
        hostgroup_name                  http-servers
        service_description             HTTP
        check_command                   check_http
        use                             generic-service
        notification_interval           0 ; set > 0 if you want to be renotified
}

Disable Zimbra’s duplicate mail detection

Zimbra can discard duplicates of incoming mail. This has certain advantages, but for us, where different people use the same account with different identities, this prevents a message from being delivered to multiple virtual inboxes.

To disable this, do this as user zimbra:

zmprov mcf zimbraMessageIdDedupeCacheSize 0
zmmailboxdctl restart

Unfortunately, this has the annoying problem that conversations aren’t detected for duplicates of a message. See this forum thread for more info.

Lowering Bayes score for Zimbra’s Spamassassin config

The Spamassassin config in Zimbra has a very high default score for bayes matching of 99, 95, 90, etc, percent. A mail with subject and body “test” or “asdfaewf a” is often marked as 99% bayes, even though the spamfilter has seen no training mail. This is absurd.

To amend this, I put this in /opt/zimbra/conf/spamassassin/local.cf:

score BAYES_99 2.500
score BAYES_95 2.000
score BAYES_90 1.500
score BAYES_85 1.000
score BAYES_80 0.500
« Older posts Newer posts »

© 2024 BigSmoke

Theme by Anders NorenUp ↑