Archive for the 'Linux' Category
The GIMP
I really like GIMP, and use it quite frequently, even with Creative Suite 4 Design Premium (licensed legally I might add) installed on my Mac, and with other applications like Paint.NET easily available for Windows. With that said, I thought I would post a few links about it, since I have been using it for… oh I don’t know, since 2002 or 2003 I’m guessing.
Read about it:
- 10 Sweet GIMP Photo Editing Tricks to Wean You Off Photoshop
- GIMP - Tutorials
- GIMP - Wikipedia, the free encyclopedia
Download it:
- GIMP for Windows
- GIMP for Mac OS X (a little odd with X11… have to click once to select windows, and then click to select tools)
- There is also the source and Linux builds… but must Linux distros come with GIMP already.
Posted by Karl Herrick on October 13th, 2009 in Photography, Apple, Windows, Linux | 1 Comment »
The network config
My network setup is going through a transitory phase as I swap parts and move things around. Here’s what I have to work with:
- Desktops:
- Pentium III-800 MHz with 256 MB RAM and two 300 GB PATA hard disks (currently running Apache/WebDAV as well as network backups)
- Pentium III-850 MHz with 256 MB RAM and one 100 GB PATA hard disk (currently running a MythTV backend on the basic cable TV channels)
- Pentium IV-2.4 GHz with 2 GB RAM and two 80 GB SATA hard disks (currently running Ubuntu 8.04, MythTV frontend, development station, etc)
- Intel Core 2 Quad - 2.33 GHz and one 600 GB SATA hard disk (currently running Kubuntu 9.04, MythTV frontend, VirtualBox w/Windows XP, taking the place of the previous MythTV frontend and the XP install on the Compaq Presario)
- Laptops:
- Compaq Presario X1000 - Pentium M - 1.4 GHz with 1.5 GB RAM (this has been mainly used for presentations, wireless development, web development and our cordless Linksys/Skype phone)
- MacBook Pro - Intel Core 2 Duo - 2.53 GHz with 4 GB RAM (this will be the successor to the Compaq laptop)
I also have some other miscellaneous parts/systems that can be used as needed. My thought was to have one MythTV backend, that will also serve as a file share, and backups. This may present some problems with the bandwidth and disk speeds on the Pentium IV box, but that remains to be seen. I am hoping the newest desktop will continue to run some form of Linux, and XP Home virtualized to provide the cordless telephone service. And then finally the two laptops, for all their mobility as well as using XBMC for additional MythTV frontends.
Posted by Karl Herrick on August 20th, 2009 in Microsoft, Windows, Linux | 2 Comments »
DD Backups over SSH
To perform backups of a local workstation’s hard disk over a network, perform the following procedures (adjusted to your particular situation of course):
- Download and boot from a live Linux distro
- Become “root” within a shell
- Run “fdisk -l” (”mac-fdisk -l” I know works on SystemRescueCD 0.2.0 (PPC) for PPC/Macs (what about Intel Macs?)) and note the internal hard disk partition to backup (ex: ‘/dev/hda’)
The rest assumes that (in short, you will probably have to substitute some numbers or devices and you have ssh access somewhere):
- You have network access
- You have access to an SSH server
- Your network is configured with private addresses and you are not assigning one that conflicts with another local IP address
- Your netmask is the same as the one supplied in the following commands
Give an IP address to the workstation you have just booted the live Linux disc on, set the netmask, and bring the network interface up:
Set the default gateway (if you need to reach outside of the LAN that is… normally this is your router’s IP address):
Set a DNS server (if you are in the habit of not strictly using IP addresses):
Execute the backup command:
Obviously, most of the previous is getting the network up… try running “dhclient” if the live Linux disc has it installed, and your network has DHCP setup.
UPDATE (2010-02-09): I just thought I would mention, that Clonezilla Live is a fantastic piece of software that makes this all a little more automated. Their site says, “For [supported] file systems, only used blocks in partition are saved and restored. For unsupported file system, sector-to-sector copy is done by dd in Clonezilla.” Essentially, this translates into much smaller image sizes for the majority of files systems that people work with. See a basic how-to at http://www.howtoforge.com/back-up-restore-hard-drives-and-partitions-with-clonezilla-live.
Posted by Karl Herrick on September 12th, 2008 in Apple, Linux, Bash | 4 Comments »
Goldfish and forged spam
Recently I had the goldfish autoresponder (vacation responses / email auto reply) setup for a user for about one week. Checking their inbox about half way through this time period revealed it having over 47,000 unread messages. What was happening is that spammers were sending email with forged headers. Have you ever received a spam message that apparently has been sent from yourself?
I suppose it can be accomplished via a variety of ways, however I was able to reproduce this particular issue via generating one of these tasty spam mails via the following (all internally of course… I am not a spammer):
and then issuing these commands:
mail from:<emailuser@example.com>
rcpt to:<emailuser@example.com>
data
From: <emailuser@example.com>
To: <emailuser@example.com>
Subject: testing a loop
Message text
.
quit
Notice the mail is being sent to the user… and from the user…
- The server would receive the email addressed to emailuser@example.com
- goldfish would parse the message and notice it needed to respond to… emailuser@example.com
- The mail was delivered
- Rinse, wash, repeat
The source of the message looked something like this:
Return-Path: <emailuser@example.com>
Delivered-To: emailuser@example.com
Received: from localhost (localhost [127.0.0.1]) by server.example.com (Postfix) with ESMTP id 923E9185F7 for <emailuser@example.com>; Thu, 4 Sep 2008 15:37:42 -0400 (EDT)
X-Virus-Scanned: Debian amavisd-new at server.example.com
Received: from server.example.com ([127.0.0.1]) by localhost (server.example.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id q3tScOaitRoS for <emailuser@example.com>; Thu, 4 Sep 2008 15:37:42 -0400 (EDT)
Received: from workstation.example.com (workstation.example.com [xx.xxx.xxx.xx]) by server.example.com (Postfix) with ESMTP id B89E1185EB for <emailuser@example.com>; Thu, 4 Sep 2008 15:37:25 -0400 (EDT)
From: <emailuser@example.com>
To: <emailuser@example.com>
Subject: testing a loop
Message-Id: <20080904193728.B89E1185EB@server.example.com>
Date: Thu, 4 Sep 2008 15:37:25 -0400 (EDT)
Message text
and to prevent goldfish from causing havoc on the particular inbox (or mitigating what was already done… and preventing future issues), I added the following PHP:
$addressCheck = substr($address,0,strlen($address)-1);
if ($addressCheck==$email)
{
$log->addLine("Email address from autoresponder table is the same as the intended recipient! Not sending the mail!");
break;
}
just before letting the mail being sent…
I love goldfish. It’s like a do it yourself autoresponder! Keep in mind, this code works on Version 002, patch level 1, but could very well not work on any future releases (there have been indications that a newer version is in the works). Maybe I will post a few more tweaks in upcoming posts if the latest stable stays around for much longer.
Posted by Karl Herrick on September 9th, 2008 in PHP, Linux, Cron | 2 Comments »
pyLiMaSound
When life gives you lemons, make lemonade. This small application is my first real need to use the python language, and that makes me excited. Furthermore Ubuntu and Debian, in the desktop varieties, appear to come standard with PyGTK (your mileage may vary).
My main issue was that I needed to remotely adjust my OS X workstation’s sound, and I figured a control would be easier than opening a shell and running a script. Basically this will give you a small gtk.VScale widget (a vertical slider widget used to select a value from a range) in a resizable window. When everything is all setup I also run it using AllTray so that it can be docked into the system tray.
When a value is selected using the widget it passes the value off to rsh, which in turn sends the command to a remote workstation (the command I have prefilled into the script works on OS X’s main volume):
The following, in the intended deployment requires password-less key based ssh connections between the workstation intended to remotely adjust the sound (any platform that supports PyGTK) and the Macintosh workstation:
#pyLiMaSound.py
import os
import gtk
import pygtk
pygtk.require("2.0")
user="remote_username"
host="mac_workstation.fqdn"
def scale_set_default_values(scale):
scale.set_update_policy(gtk.UPDATE_DELAYED)
scale.set_digits(1)
scale.set_value_pos(gtk.POS_BOTTOM)
scale.set_draw_value(True)
class pyLiMaSound:
def delete_event(self, widget, event, data=None):
print "delete event occurred"
return False
def destroy(self, widget, data=None):
print "destroy signal occurred"
gtk.main_quit()
def rsh_vol_cmd(self, data):
payload = "rsh -l " + user + " " + host \
+ " \"osascript -e 'set Volume " + \
str(data.value) + "'\""
print payload
os.system(payload);
def __init__(self):
self.window = gtk.Window(gtk.WINDOW_TOPLEVEL)
self.window.set_default_size(50, 200)
self.window.connect("delete_event", self.delete_event)
self.window.connect("destroy", self.destroy)
self.window.set_border_width(10)
adj1 = gtk.Adjustment(0.0, 0.0, 10.1, 0.1, 0.1, 0.1)
adj1.connect("value_changed", self.rsh_vol_cmd)
self.vscale = gtk.VScale(adj1)
scale_set_default_values(self.vscale)
self.window.add(self.vscale)
self.vscale.show()
self.window.show()
def main(self):
gtk.main()
if __name__ == "__main__":
control = pyLiMaSound()
control.main()
Posted by Karl Herrick on August 20th, 2008 in Python, Apple, Linux, Bash | 1 Comment »

