Debian and Ubuntu Networking Configuration /etc/network/interfaces with a Static IP Address

This is easy to find anywhere, and it’s here too. This one includes the dns-* lines that will be read by resolvconf(8).

root@server:/etc/network# cat interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).

# The loopback network interface
auto lo
iface lo inet loopback

# The primary network interface
auto eth0
iface eth0 inet static
dns-search mydomain.local

Also, here’s a cheatsheet for setting that netmask:  /30    2  nodes  /29    6  nodes  /28   14  nodes  /27   30  nodes  /26   62  nodes  /25  126  nodes    /24 "Class C" 254 nodes

Note that the number of nodes is the total number of addresses, less two. It’s less two because the lowest value is the address of the entire network. The highest value is the broadcast address. So if the netmask is 0, then the lowest value is 0, and that’s the address of the network, and the highest value is 255, which is the broadcast address.

Make Meme/LOLCats Text with the GIMP

This tutorial explains how to make the “LOLCats” or “Meme” font so popular with the kids today. You can see a lot of these on the 4Chan /b/ channel, but don’t go there if you have any illusions that our society isn’t full of degenerates. The meme font is Impact Condensed, but to get the right “look”, you need to create a black outline around the regular font letters. Continue reading “Make Meme/LOLCats Text with the GIMP”

Magic Folder to Convert DOC and OpenOffice to PDF

Most of the information in this post is derived from The code’s reposted here as a service, because the code there needs some editing.

Also, a useful thread about executing OOo macros is at

Here’s the code to automate the opening and saving of a file as PDF, using Open Office. Paste this into your standard macros.

Sub ConvertWordToPDF(cFile)
cURL = ConvertToURL(cFile)
‘ Open the document.
‘ Just blindly assume that the document is of a type that OOo will
‘ correctly recognize and open — without specifying an import filter.
oDoc = StarDesktop.loadComponentFromURL(cURL, "_blank", 0, Array(MakePropertyValue("Hidden", True), ))
cFile = Left(cFile, Len(cFile) – 4) + ".pdf"
cURL = ConvertToURL(cFile)
‘ Save the document using a filter.
oDoc.storeToURL(cURL, Array(MakePropertyValue("FilterName", "writer_pdf_Export"), ))
End Sub

Function MakePropertyValue( Optional cName As String, Optional uValue ) As
Dim oPropertyValue As New
If Not IsMissing( cName ) Then
oPropertyValue.Name = cName
If Not IsMissing( uValue ) Then
oPropertyValue.Value = uValue
MakePropertyValue() = oPropertyValue
End Function

sub test()
ConvertWordToPDF("file:///home/johnk/Desktop/cooking websites article.odt")
end sub

To use this macro, you should execute it from the command line. Here’s a shell script that helps.

/user/bin/oowriter-invisible "macro://Standard.Module1.ConvertWordToPDF($DOC)"

And last but not least, my addition – a script that watches a folder called pdeffer and converts DOC files to PDF. The only problem is that only simple, textual files with graphics will work. More complex layouts will fail.

To use it, execute it in the background or start it in a “screen” session. It’s not a full-fledged service (and won’t be).

#! /usr/bin/perl

chdir ‘/home/johnk/pdeffer’;

use Cwd;

%docs = ();
%pdfs = ();

sub main() {
print "checking\n";
opendir DH,’.’;
while( $file = readdir(DH) ) {
if ($file =~ /.doc$/) {
$docs{$file} = 1;
if ($file =~ /.pdf$/) {
$pdfs{$file} = 1;
closedir DH;

foreach $d (keys(%docs)) {
print "$d\n";
$p = $d;
$p =~ s/.doc/.pdf/;
next if ($pdfs{$p});

$filename = getcwd().’/’.$d;
print "$filename\n";

system(‘oowriter -invisible "macro:///Standard.Module1.ConvertWordToPDF(‘.$filename.’)"’);

for(;;) {
sleep 10;