Encrypting your /home and swap on Ubuntu Linux v8.04 (Hardy Heron)

As an ongoing effort for work, IT has deemed it necessary to encrypt our laptops.  No problem I say, but one issue:  the encryption software they chose only works on Windows 2000/XP and certainly not on OSX or Linux.  My chosen platform for work is Ubuntu 8.04 with the bling of compiz to show it off 😉 In order to comply, I did a little googling and ran across an excellent article by Lars Strand on how to encrypt your /home directory and swap space on Ubuntu 8.04 (should work with 6.04 and higher).

Encrypted swap and home partition in Ubuntu 8.04

I really would like to have an encrypted swap and home partition on my laptop. In case it gets stolen or if I should forget it somewhere, I can be sure that no-one would be able to read my private files. In this mini-howto I set my home partition using LVM, but using a regular partition should work just fine. This howto should also work, with minor modification, if you use another distribution than Ubuntu.
By using Linux Unified Key Setup (LUKS) setting up encrypted partition in Linux is done in no time.

read more

I’m totally impressed by the article – the instructions are step by step and are easy to follow.  I’d create a new user belonging to the admin group with its home directory outside of ‘/home’ and use that user to perform the steps.

Initially I attempted to use an USB thumb drive to hold a key file but it proved unreliable because it wasn’t being mounted consistantly before the /etc/init.d/cryptdisks & /etc/init.d/cryptdisks.early were being executed on boot up.  This issue would cause the key file to be unavailable and therefore the encrypted home from being attached to (/etc/crypttab).  However, when if I inserted the thumbdrive after the system booted, the usb thumb drive would be auto-mounted and performing ‘mount /home’ would mount the encrypted home directory.

Share Button

GeekBrief.tv episode 361: Brian Albert of My Home 2.0

There are several people at work that Brian Albert remind me of My Home 2.0

Share Button

Combining multiple Adobe PDF files into a single PDF file

After I downloaded a few eBooks from Bruce Perens’ Open Source Series, I noticed that several of the books were zip files containing the chapters as individual PDF files.  I don’t know about you, but I would rather hava a single monolithic PDF file for each book.

By using Ghostscript and pdftk, we are able to create the PDF file with no problem:

gs -dNOPAUSE -sDEVICE=pdfwrite -sOUTPUTFILE="Implementing CIFS The Common Internet File System.pdf" -dBATCH frontmatter.pdf content.pdf foreword.pdf intro.pdf ch01.pdf  ch02.pdf  ch03.pdf  ch04.pdf  ch05.pdf  ch06.pdf  ch07.pdf  ch08.pdf  ch09.pdf  ch10.pdf  ch11.pdf ch12.pdf  ch13.pdf  ch14.pdf  ch15.pdf  ch16.pdf  ch17.pdf  ch18.pdf  ch19.pdf  ch20.pdf  ch21.pdf  ch22.pdf ch23.pdf  ch24.pdf  ch25.pdf  ch26.pdf apa.pdf apb.pdf apc.pdf apd.pdf glossary.pdf references.pdf index.pdf 

On Ubuntu Linux, you can quickly install these two tools with a single command:

aptitude install gs pdftk
Share Button

ubuntu server 7.10 as a vmware guest on an ubuntu 8.04 host, requires ‘clock=pit’

In order to avoid a drifting time clock in “ubuntu server 7.10” vmware guest machine on an ubuntu 8.04 host, you need to do a few things:

  • /etc/vmware/config
  • host.cpukHz = 2000000  <– replace # with speed of your cpu (2GHz listed here)
  • host.noTSC = TRUE
  • ptsc.noTSC = TRUE
  • ‘clock=pit’ added to the kernel line in /boot/grub/menu.lst
  • tools.syncTime = “TRUE” in the (vmware_guest).vmx file
Share Button

Synchronize a Sybase ASE database sysusers with master..syslogins

Update: Thanks goes to Jeroen Rijnbergen for finding an issue with this script 🙂

suid can be negative (valid values between -32768 and 2147483647) your script only checks for suid > 1, should be: between -32768 and -3 or > 1. With 15.7 and higher where you can specify suid manually with create login, it’s getting more likely to have negative suid for logins. — Jeroen Rijnbergen

isql -Usa -S server -D my_db -i sync_users.sql
exec sp_configure "allow updates", 1
go

/* delete names not found in master syslogins */
delete from sysusers
  where (suid between -32768 and -3 OR suid > 1) and uid < = 16383 and uid > 1
  and name not in (select name from master..syslogins)
go

/* update sysusers and resync all uids from the existing suids */
if exists(select 1 from sysobjects where name = "sysusers_holding" and type = "U")
  drop table sysusers_holding
go

create table sysusers_holding (
  id numeric(6,0) identity primary key,
  oldsuid int null,
  suid int null,
  uid int null,
  gid int null,
  name char(30) null,
  environ varchar(255) null
)
go

/* populate the holding table */
insert into sysusers_holding (oldsuid, gid, name, environ)
  select suid, gid, name, environ 
  from sysusers
  where (suid between -32768 and -3 OR suid > 1) and uid < = 16383 and uid > 1
go

/* update the uids. */
declare syncuser cursor for
 select name, uid from sysusers_holding for update of uid, suid
go

declare @name char(30), @uid int, @suid int
select @suid = 9999

open syncuser
fetch syncuser into @name, @uid

while (@@sqlstatus != 2)
begin
  if exists(select 1 from master..syslogins where name = @name)
  /* got the name update the uid */
  begin
     select @suid = suid
     from master..syslogins
     where name = @name

     -- update sysusers_holding set uid = @suid, suid = @suid where current of syncuser
     update sysusers_holding set suid = @suid where current of syncuser

     if @@error != 0
     begin
       rollback transaction
       break
     end

     select @suid = 9999
  end

  fetch syncuser into @name, @uid
end

close syncuser
go

deallocate cursor syncuser
go

/* now move records over */
delete from sysusers
  where (suid between -32768 and -3 OR suid > 1)
  and uid < = 16383 and uid > 1
go

insert into sysusers
select suid, uid, gid, name, environ
  from sysusers_holding
go

/* sp_helpuser will show any mis-matches) */
exec sp_helpuser
go

exec sp_configure "allow updates", 0
go
Share Button

Introducing….. SweeperBot!

SweeperBot is an application written by Paul Fenwick that plays Windows minesweeper for you automatically. It’s based upon code orignally written by Matt Sparks.

Get it at SweeperBot.org!

Share Button

Google Video: Introduction to SQLite


We are currently using SQLite in production for some smaller projects.

Share Button

I had one! I sold it! I want it back! Amiga 500 promo video (circa 1987)


Apparently my wife programmed in Turtle on the Amiga 500 when she was in elementary school (she’s 7 years younger than me).

Share Button

The Sybase TechWave 2008 Presentation Acceptance/Rejection letters are being sent now!

I submitted two presentations, which I didn’t think would get accepted due to their subject matter… they didn’t get accepted. Please don’t think I’m disappointed or upset.  Personally, I’m rather pleased as I can make them into proper magazine articles.  🙂  Yes, there is a new magazine in the works.

21200: Understanding RepAgent to Replication Server Communication by Creating Your Very Own RepAgent

21201: Running Sybase ASE in a Virtual Environment

Dear Jason,

Thank you for your Sybase TechWave 2008 abstract submission. There were a
tremendous number of excellent presentation ideas, and it was extremely
difficult to decide among the submissions.

We greatly appreciate the effort you made to develop your presentation and
to submit the application, but we are unable to include your suggested
session(s) in the agenda at this time. We encourage you to submit an entry
again next year.

The TechWave registration site is now live. Please visit the site at
http://www.sybase.com/techwave/registrationinfo by June 29th, to register
and to receive the early bird discount $1,295.00 rate.

We look forward to seeing you in Las Vegas this August. If you have any
questions, please contact Michele Shannon at (781) 251-7705 or at
SybaseSpeakers@experient-inc.com.

Sincerely,

Michele Shannon
Sybase TechWave Speaker Manager

Share Button

Canon Pixma MP150 printer maintenance codes

I have a Canon Pixma MP150 printer that works quite well but the maintenance codes are not very intuitive.

Taken from the Canon Pixma MP150 manual but here in a nice convenient place:

Press the Maintenance button (icon of a pliers & screwdriver) until the code you want shows up then press the Color or Black button:

Code Meaning
A Print nozzle check pattern (prints nozzle patterns on paper)
H Cartridge cleaning (uses a little bit of ink)
F Deep cleaning (uses a lot more ink – use rarely)
P Align print head (prints alignment lines on paper)
U Read in print head alignment sheet (P) and auto aligns print heads
B Clean print rollers (can prematurely wear out the rollers – use rarely)
J Clean bottom plate
1 ????

Does any one know that the “1” code is?
If you’re looking for photo ink cartridges .. there aren’t any specifically for photos. You will need to use the standard CL40 B&W and CL41 Color cartridges. You can probably save a little money and use the high capacity ink cartridges, CL50 B&W, CL51 Color instead.

Share Button