VMWare 4.5 Install on Debian 2.6.9 0

Posted by ryan
at 2:27 PM on Tuesday, December 28, 2004



This is more a how-to for myself than a great post, but I’ve recently struggled through getting VMWare installed on my Debian 2.6.9 laptop and thought this would be a good place to post the steps I took so I can recreate the installation in the future.

Step 1: Download and extract the VMWare evaluation binary:

Step 2: Install VMWare:

  • cd vmware-distrib
  • ./vmware-install.pl
  • do not run the vmware-config.pl script that the installer prompts you for

Step 3: Install VMWare any-any update

Step 4: Configure VMWare

  • /path/to/vmware/bin/vmware-config.pl
  • compile the modules when prompted and go about normal configuration for your machine

VMware is now runnable as /path/to/vmware/bin/vmware.

Clarification: Thanks to Mr. Frosti for this: You need to install “module-init-tools” to insert the modules into the kernel.

Todo: On reboot VMware needs to be reconfigured w/ vmware-config.pl. Why?
This didn’t work for me either: See this thread (http://www.vmware.com/community/thread.jspa?threadID=8531&tstart=60) on the edit you need to make on your /etc/init.d/vmware script. Running the any-any update as suggested in the thread didn’t fix it for me.

Changing PostgreSQL's Data Directory in Ubuntu 0

Posted by ryan
at 4:46 PM on Tuesday, June 06, 2006



When installing PostgreSQL on debian the install process asks you what directory you want to contain your actual table data – which is nice when you want to use a dedicated partition instead of the default /var/lib/postgresql/data. However, in Ubuntu (Dapper Drake and Breezy Badger) the install process doesn’t give you the option of changing the default directory. Here are some quick notes on how to change the data directory to an existing non-default data dir (specifically for postgresql 7.4):

  1. remove the /etc/postgresql/7.4/main/pgdata symlink
  2. create a new pgdata symlink that points to your desired data directory.
  3. Make sure the pg_hba.conf, pg_ident.conf, postgresql.conf and root.crt symlinks in the data dir point back to the originals in /etc/postgresql/7.4/main

Restart postgres and you should now be running from you desired, non-default data directory.

tags: postgresql,postgres,ubuntu

Dapper Drake is my Friend. And so is Jim

Posted by ryan
at 5:36 AM on Thursday, June 08, 2006



I’ve been a deb guy for as long as I’ve been using linux as my littany of various howtos can attest. While deb is great I’ve always had to go through a few kernel compiles and what not to get hibernate/suspend and MS VPN support working on my Latitude laptop.

On a tip from my co-worker, Jim, I tried Ubuntu’s latest offering, Dapper Drake.

Wow

An effortless install with full serial IDE support, suspend, hibernate, MS VPN, a stable gnome WM – you name it. I am really impressed.

Check it out

tags: ubuntu,debian

Exporting Evolution Contacts to Thunderbird

Posted by ryan
at 3:19 AM on Tuesday, May 16, 2006



Here’s a quick howto on a process that doesn’t seem to be very well supported or documented: Getting your contacts and addresses out of Novell Evolution and into Mozilla Thunderbird (or any other similar mail client like Yahoo Mail etc…)

Exporting from Evolution is not something that’s very apparent. Unless you want to export your contacts as a VCard (by highlighting all and doing a save as vcard) you’re going to have to call upon the obscure evolution-addressbook-export command. For some reason this utility wasn’t in my path, so I had to call it directly.

On Debian Sarge, the basic sequence goes like this:

  1. Export the evolution address book with the evolution-addressbook-export utility in csv format
  2. Import it into Mozilla Thunderbird
  3. Export as needed in other formats to other mail clients (LDIF seems to work well for Yahoo! Mail…)

It’s really simple once you know what to use and where to find it:


/usr/lib/evolution/2.X/evolution-addressbook-export --format=csv > contacts.csv

Now just import it into Mozilla Thunderbird (Addressbook – Tools – Import).

I don’t know why it’s hard to find references to Evolution’s addressbook export utility – it seems to address a pretty big need. Hope this helps somebody…

tags: , ,

Started work on my Tivo-like MythTV on RedHat 9

Posted by ryan
at 9:14 AM on Wednesday, January 07, 2004



My long awaited project of building my own Tivo-like device has finally started. I’ve just put together the box and have RedHat 9 installed. I plan to use MythTV as my PVR software. It seems to be the most active and feature filled of the bunch (Freevo seems to be the other popular choice).

At this point I’m having trouble getting the NVidia driver loaded (for TV-out). I’m using the install guide here (and am even using the exact hardware of Jarod’s system) but my XFree config doesn’t want to work. The log keeps saying something to the effect of “can’t load NVIDIA module”. I know Jarod’s setup uses a seperate NVidia video card instead of the TV-out functionality of the Chaintech 7NIF2 motherboard (which is what I’m trying to use), but I was hoping I could get it to work.

Here’s my setup:

  • Coolermaster ATC case
  • Chaintech 7NIF2 MB w/ onboard ethernet/video/TV-out/sound
  • Athlon XP 2500+ (Barton)
  • 200 GB HD

How frustrating linux still is, but I knew this was a real possibility before I started, or else I would gotten a Tivo…

Finally... Free of Outlook. Thank you Mozilla!

Posted by ryan
at 4:08 PM on Friday, November 19, 2004



<a href=”http://www.mozilla.org/products/thunderbird/” title=”Get Thunderbird – Reclaim Your Inbox”><img src=”http://www.mozilla.org/products/thunderbird/buttons/reclaimyourinbox_small.png” width=”125” height=”80” border=”0” alt=”Get Thunderbird”>

I have made it my mission for the past few months to remove myself from the dependency on Microsoft Outlook I have had for the past 6 or so years. Don’t get me wrong, Outlook is a great tool for email, contacts and calendaring and I have used it enjoyably ever since college. However, as I’ve recently wanted to migrate ALL my machines (about 5 of them) to Linux, I ran into a problem. How do I migrate my years of emails and appointments/tasks to a Linux/open platform?

Initially I was content with running Outlook (2003) in Crossover Office – but what’s the point of running Linux if you still have to pay for a $400 office suite AND are tied into proprietary formats. As I started thinking more and more about my goals I also realized I wanted all my data available to me no matter which machine I was on – and without any messy synchronization process.

An ex-coworker of mine suggested using IMAP for my email store and iCal over WebDAV for my calendaring. At the time he originally suggested this I wasn’t too impressed with the iCal calendaring clients for non-Mac machines. However, with the latest release of Mozilla Sunbird I’ve found that it’s at least functional for the minimal time I will be spending in Windows and that Evolution 2.0 now supports iCal over webDAV. Ah hah! All the pieces are all in place now.

Here’s what I’ve done:

  • Got a VPS plan from Linode.com
  • Installed the Debian image
  • Set up Courier email server w/ IMAP
  • Copied my email from Outlook to the IMAP store (Outlook supports IMAP – so it’s just a matter of copy over)
  • Installed Apache2 w/ webDAV & SSL on my VPS
  • Set up a private calendar folder for my iCals
  • Using Mozilla Sunbird, imported my calendar appointments from Outlook’s CSV format (not perfect but certainly acceptable) to my iCal share
  • Using Outport, exported my Outlook tasks to Evolution tasks (which appears to be iCal) and imported them into Sunbird and my iCal share
  • Used Mozilla Thunderbird to import my contacts and connect to my IMAP store

I have been running this hybrid Thunderbird/Sunbird setup for a few days now and find it to be perfectly functional. I have really come to appreciate Thunderbird, and Sunbird is a start for calendaring. Most of all I can rest easy knowing that I am free to switch to machines and operatins systems at a whim and have all my essential data available to me with no conversion. I definitely won’t be making the same mistake I did 6 years ago – choosing a product that ties your information up in a proprietary format. Thank god for Mozilla and the open-source movement in general.

Some impressions so far:

  • Linode.com is sitting on some fat pipes and has a great, easy to use console – but my support tickets (non-urgent) have either gone unanswered or not answered for days. It’s only for those who can administer their own sites or are willing to put in the time to learn the stuff yourself.
  • Mozilla Sunbird is a bit quirky to say the least. If you need predictable, accurate behavior from your reminders and tasks, it may not be ready for you yet.
  • Definitely check out the Thunderbird extensions out there, they will really enhance your email experience. My favorites are the contacts sidebar, quick reply and foxy tunes

Setting up MPPE VPN support in Debian Linux 1

Posted by ryan
at 6:45 PM on Sunday, September 11, 2005



Awhile ago I posted this howto for compiling a kernel with MPPE support to be able to connect to a Microsoft VPN. Now that I’m going through this process again for a new Dell Latitude D610 I thought it might be time to document the next step, which is setting up the scripts to connect to an actual VPN.

Most of these steps were taken pretty directly from http://www.adamhooper.com:4242/mcgill-vpn-mppe/#config, but it can’t hurt to have more than one howto out there, right?

Steps to connect to a Microsoft VPN from a Debian linux client:

  1. Install ppp: apt-get install pptpd pptp-linux
  2. Create and edit ”/etc/ppp/options.your_vpn_abrev” to contain:
    lock
    noauth
    nobsdcomp
    nodeflate
    persist
    
  3. Create and edit ”/etc/ppp/peers/your_vpn_abrev” to contain:
    pty "pptp <i>your_vpn_url</i> --nolaunchpppd"  # i.e. vpn.domain.com
    name "<i>your_login_username</i>" 
    remotename <i>your_vpn_abrev</i>
    require-mppe-128
    file /etc/ppp/options.<i>your_vpn_abrev</i>
    ipparam <i>your_vpn_abrev</i>
    
  4. Update ”/etc/ppp/chap-secrets” to contain:
    <i>your_login_username</i>  <i>your_vpn_abrev</i>  <i>your_login_password</i>  *
    <i>your_vpn_abrev</i>  <i>your_login_username</i>  <i>your_login_password</i>  *
    
  5. Create and edit ”/etc/ppp/ip-up.d/your_vpn_abrev” to contain (add one line per ip range that needs to go through the VPN):
    route add -net <i>vpn_ip_range</i> ppp0  # i.e. 192.168.20.0/24 or 132.216.0.0/16
    
  6. Make the ip-up script executable: chmod +x /etc/ppp/ip-up.d/your_vpn_abrev

Try to connect:
At this point you should be able to execute the following command to bring up the VPN:

pon <i>your_vpn_abrev</i> debug dump logfd 2 updetach persist && /etc/ppp/ip-up.d/<i>your_vpn_abrev</i>
You should see something similar to this:
pppd options in effect:
debug           # (from command line)
updetach                # (from command line)
persist         # (from command line)
logfd 2         # (from command line)
dump            # (from command line)
noauth          # (from /etc/ppp/options.<i>your_vpn_abrev</i>)
name ryan               # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
remotename tribeca              # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
                # (from /etc/ppp/options.<i>your_vpn_abrev</i>)
pty pptp <i>your_vpn_url</i> --nolaunchpppd            # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
crtscts         # (from /etc/ppp/options)
                # (from /etc/ppp/options)
asyncmap 0              # (from /etc/ppp/options)
lcp-echo-failure 4              # (from /etc/ppp/options)
lcp-echo-interval 30            # (from /etc/ppp/options)
hide-password           # (from /etc/ppp/options)
ipparam tribeca         # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
proxyarp                # (from /etc/ppp/options)
nobsdcomp               # (from /etc/ppp/options.<i>your_vpn_abrev</i>)
nodeflate               # (from /etc/ppp/options.<i>your_vpn_abrev</i>)
require-mppe-128                # (from /etc/ppp/peers/<i>your_vpn_abrev</i>)
noipx           # (from /etc/ppp/options)
using channel 2
Using interface ppp0
Connect: ppp0 <--> /dev/pts/2
sent [LCP ConfReq id=0x1 <asyncmap 0x0> <magic 0xbd67cf7f> <pcomp> <accomp>]
rcvd [LCP ConfReq id=0x1 <asyncmap 0x0> <auth chap MS-v2> <magic 0x359da88e> <pcomp> <accomp>]
sent [LCP ConfAck id=0x1 <asyncmap 0x0> <auth chap MS-v2> <magic 0x359da88e> <pcomp> <accomp>]
rcvd [LCP ConfAck id=0x1 <asyncmap 0x0> <magic 0xbd67cf7f> <pcomp> <accomp>]
sent [LCP EchoReq id=0x0 magic=0xbd67cf7f]
rcvd [CHAP Challenge id=0x1 <db473bebd9077d4f59295aa64932f573>, name = "nas"]
sent [CHAP Response id=0x1 <9c3606e62374744e490d7305f3050a3784090810000000e057efca0fc6216021088d786cb800533ccce2d92e1b17819500>, name = "<i>your_vpn_username</i>"]
rcvd [LCP EchoRep id=0x0 magic=0x359da88e]
rcvd [CHAP Success id=0x1 "S=46E4685DE0338610FF22D2CA53DE41F9310424AF"]
sent [CCP ConfReq id=0x1 <mppe +H -M +S -L -D -C>]
rcvd [IPCP ConfReq id=0x1 <addr 192.168.20.230> <compress VJ 0f 01>]
sent [IPCP TermAck id=0x1]
rcvd [CCP ConfReq id=0x1 <deflate 15> <deflate(old#) 15> <mppe +H -M +S +L -D -C>]
sent [CCP ConfRej id=0x1 <deflate 15> <deflate(old#) 15>]
rcvd [CCP ConfAck id=0x1 <mppe +H -M +S -L -D -C>]
rcvd [CCP ConfReq id=0x2 <mppe +H -M +S +L -D -C>]
sent [CCP ConfNak id=0x2 <mppe +H -M +S -L -D -C>]
rcvd [CCP ConfReq id=0x3 <mppe +H -M +S -L -D -C>]
sent [CCP ConfAck id=0x3 <mppe +H -M +S -L -D -C>]
MPPE 128-bit stateless compression enabled
sent [IPCP ConfReq id=0x1 <compress VJ 0f 01> <addr 0.0.0.0>]
rcvd [IPCP ConfNak id=0x1 <addr 192.168.20.233>]
sent [IPCP ConfReq id=0x2 <compress VJ 0f 01> <addr 192.168.20.233>]
rcvd [IPCP ConfAck id=0x2 <compress VJ 0f 01> <addr 192.168.20.233>]
rcvd [IPCP ConfReq id=0x1 <addr 192.168.20.230> <compress VJ 0f 01>]
sent [IPCP ConfAck id=0x1 <addr 192.168.20.230> <compress VJ 0f 01>]
Cannot determine ethernet address for proxy ARP
local  IP address 192.168.20.233
remote IP address 192.168.20.230
Note: I could never get the automatic execution of the ip-up script to work after the vpn connects which is why it’s explicitly being executed here (the “&& /etc/ppp/ip-up.d/your_vpn_abrev” part)

After this is done, you should be able to ping the remote ip address (the last line of the log above) and you should see “ppp0” now listed in “ifconfig”:

# ifconfig
eth0      ...

lo        ...

ppp0      Link encap:Point-to-Point Protocol
          inet addr:192.168.20.233  P-t-P:192.168.20.230  Mask:255.255.255.255
          UP POINTOPOINT RUNNING NOARP MULTICAST  MTU:1496  Metric:1
          RX packets:8 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:3
          RX bytes:106 (106.0 b)  TX bytes:94 (94.0 b)
If you see this chances are you’ve got it all up and running! And to stop the VPN, just execute this command:
poff <i>your_vpn_abrev</i>

And that’s all there is to it (well, and this minor step that you should have done before hand). Let me know if you have any issues and I’ll see what I can come up with. Keep in mind I am by no means an expert, I’ll just see if I can help up as I’ve run into setup problems myself that you may find yourself confronted with.

Install Ndiswrapper on Debian 2.6.9 for wireless (802.11G) access 0

Posted by ryan
at 8:51 PM on Tuesday, December 28, 2004



Howto install Ndiswrapper on a Debian Dell D500 laptop for wireless 802.11G access for the embedded Dell Truemobile 1300 nini PCI card:

Step 1:Download and install ndiswrapper from source (assumes you have kernel-headers installed [apt-get install kernel-headers-2.6.9-1-686]):

Step 2: Download and extract the windows drivers file (list of other chipsets can be found at: http://ndiswrapper.sourceforge.net/phpwiki/index.php/List)

  • download for truemobile 1300: http://ftp.us.dell.com/network/R81433.EXE
  • unzip R81433.EXE
  • mkdir /lib/windrivers/ /lib/windrivers/net/
  • cp AR/bcmw5a.inf /lib/windrivers/net/
  • cp AR/bcmw5.sys /lib/windrivers/net/

Step 3: Load the ndiswrapper module and windriver

  • modprobe ndiswrapper
  • Verify module loading by: lsmod | grep ndiswrapper
  • ndiswrapper -i /lib/windrivers/net/bcmw5a.inf
  • Verify driver loading: ndiswrapper -l
  • Verify module/driver loading: dmesg | grep ndiswrapper

Step 4: install wireless tools and settings (raw netconfig file can be found at http://www.linux-wireless.org/Wireless/Drivers/Install-HOWTO/Drivers/BroadCom/Old/netconfig.sh):

  • apt-get -t testing install wireless-tools
  • netconfig scan
  • netconfig home

Resources:
- My edited netconfig file (hard coded for dhclient and BCM4306 chipset)

Software Suspend support on Dell Latitude D500 w/ Debian kernel v2.6.9

Posted by ryan
at 3:57 PM on Monday, January 17, 2005



Getting suspend functionality was probably the most challenging part of setting up my laptop so far. You’d be surprised how annoying it is to have to shutdown everytime you want to close your laptop lid and take it on a 10 minute journey home. A big thanks goes out to Nigel Cunningham who actually responded to my direct email when the mailing lists were down (Nigel is one of the software suspend developers, and I found his name while searching for an error message that I was receiving – his name was on the commit for the file with that error message. Despite his friendly help, I’m sure he curses Google daily.) So here are the steps I took to get software suspend working on my laptop:

Make sure you have the kernel sources, headers and initrd-tools installed:

  • apt-get install kernel-source-2.6.9 kernel-headers-2.6.9-x-686 initrd-tools
  • cd /usr/src
  • (If “linux” already exists): unlink linux
  • ln -s kernel-source-2.6.9 linux

Patch the kernel with software suspend support (http://softwaresuspend.berlios.de/HOWTO-2.html#ss2.3)

Now that the patch has been applied, you need to download the debian specific script as outlined here: http://swsusp.sourceforge.net/wiki/DebianInitrd

  • copy the script from the above URL into a new file called ”/etc/mkinitrd/scripts/swsusp2”

Compile your kernel and make the kernel and initrd images:

  • cd /usr/src/linux
  • make-kpkg clean
  • make-kpkg —append-to-version -swsuspend—config menuconfig—initrd kernel_image kernel_headers

In the kernel menu config make sure of the following selections (I only had success building them as modules (M))

  • Power management options —> Software Suspend 2 --> Software Suspend 2
  • Swap Writer
  • LZF image compression
  • Text mode console support

Install your kernel

  • dpkg -i kernel-headers-2.6.9-swsuspend.deb kernel-image-2.6.9-swsuspend.deb

After installing your kernel, you will need to edit your grub configuration for your new kernel to include the swap space that software suspend uses to suspend to. While there’s a blurb on the software suspend wiki where you downloaded the swsusp2 script that the script made you not need this parameter, I still had to include it:

  • cd /boot/grub/
  • nano (or your fav editor) menu.lst
  • Look for the entry representing your new kernel (this should be the first entry) and add “resume2=swap:/dev/hda3” to the “kernel” line. Mine looks like this:

    “kernel /vmlinuz-2.6.9-mppe-swsuspend root=/dev/hda6 resume2=swap:/dev/hda3”

    The ”/dev/hda3” is your swap space device. To find out what yours is run this command: “cat /etc/fstab | grep swap”.

Now you need to install the hibernate script that actually invokes the suspend functionality. It’s available as a debian package “hibernate”, but I downloaded and installed from the package available on the software suspend site. If any steps differ here it’s probably b/c of that:

The default hibernate configuration didn’t work for me out of the box b/c while the software suspend script you included earlier in /etc/mkinitrd/scripts/ loads the necessary suspend modules, it also unloads them – serving just to make sure the proper modules are available. The hibernate support needs these modules loaded to function so it has to re-load them when hibernate is invoked. Fortunately, it’s an easy update the hibernate.conf file that will make this happen:

  • cd /etc/hibernate
  • nano (or your fav editor) hibernate.conf
  • Uncomment the line starting with “LoadSuspendModules”
  • Add “suspend_core” to the list of modules. My line looks like this:

    “LoadSuspendModules suspend_core suspend_swap suspend_lzf suspend_text”

At this point, all should be ready for a reboot into your new kernel. Go ahead and reboot and select your new kernel from the list (again, it should be the first in the list). If everything goes well, you should see the following scroll by (also retrievable once logged in w/ “dmesg”:

Software Suspend Core.
Software Suspend text mode support loaded.
Software Suspend LZF Compression Driver registered.
Software Suspend Swap Writer registered.
Looking for first block of swap header at block 0.
Setting logical block size of resume device to 4096.
Software Suspend 2.1.5: Swap space signature found.
Software Suspend 2.1.5: Suspending enabled.
Software Suspend 2.1.5: This is normal swap space.
Software Suspend Swap Writer unloading.
Software Suspend 2.1.5: No writers have been registered.
Software Suspend LZF Compression Driver unloading.
Software Suspend text mode support unloading.
Software Suspend Core unloading.

If you see something like: “BIG FAT WARNING!!!”, then a double check that the “resume2=swap:/dev/hdx” option on the kernel boot line (in /boot/grub/menu.lst) is there and points to your swap space device. If you don’t see any errors, and do see the Software Suspend module messages on startup, then things are looking pretty good for you.

After your reboot, go ahead and login as root. Run the “hibernate” command and your machine should switch to text mode where it shows a progress bar saving your memory to disk. Press the power on button to startup again, choosing the same kernel you were in when you suspended, and your applications etc… should be loaded back into memory – including X.

This process was frought with many errors and messages that I didn’t record while I was figuring them out, so if you run into an error, let me know (using the comments), there’s a good chance I’ve seen it before. Good luck!

When following this guide on my work D600 I ran across the following error. After doing a complete build etc… and booting into the new kernel I was getting this error:

=== Software Suspend ===

BIG FAT WARNING!! Can't check whether to resume. Suspend's core module isn't loaded.

If you continue booting, note that any image WILL NOT BE REMOVED.
Suspend is unable to do so because the appropriate modules aren't
loaded. You should manually remove the image to avoid any
possibility of corrupting your filesystem(s) later.
Press SPACE to reboot or C to continue booting with this kernel

After scratching my head for awhile I noticed that when I copied and pasted the script from http://download.berlios.de/softwaresuspend/software-suspend-2.1.5-for-2.6.9.tar.bz2 to ”/etc/mkinitrd/scripts/swsusp2” I didn’t change the file to be executable. So…, I restarted from that point and did a “chmod +x /etc/mkinitrd/scripts/swsusp2”. After recompiling again, etc…, the reboot still had the same problem. Crap! I ended up just copying and pasting my vmlinuz and initrd image from my working D500 laptop onto the laptop where I was having these issues (my work D600). Luckily, that worked! I still think that the swsusp2 script wasn’t getting picked up when the initrd image was built (I think this b/c after one of the faulty boots, there was no /proc/software_suspend dir – which the swsusp2 initrd script creates?) For those that think it might be useful, I’ve uploaded both my working kernel and my image – you may only need the image?. (Note: this kernel and image include both mppe support and swsuspend2 support)

Listing & Downgrading Unstable/Testing Debian Packages

Posted by ryan
at 2:44 PM on Monday, October 31, 2005



I like to keep my debian machines pretty true to the stable release – but every once and awhile I’ll make an exception for some piece of software I really feel I need and install from the testing or unstable repository. Most of the time I end up not really needing or using that application, but that’s besides the point. The point is that I like to take a quick monthly inventory of what installed packages are not from the stable source, and usually downgrade to the stable if not completely remove the unstable package. Here’s how I do it:

  1. Install the apt-show-versions command:
    apt-get install apt-show-versions
  2. List the stable and testing packages:
    apt-show-versions | grep /testing
    apt-show-versions | grep /unstable
At this point I usually go through and remove individual packages making sure that there’s nothing important in their dependencies. However, this is pretty inconvenient and when I’m feeling particularly saucy I will downgrade my whole machine to stable. This is much easier and you can always cancel when apt-get confirms what packages are being downgraded:
  1. Edit your /etc/apt/preferences file and change the “Pin-Priority” value of the stable section to 1001. Some of you may not already have this file, so I’ll just put the contents of mine (the majority of which comes from the apt-pinning guide):
    <b>Package: *
    Pin: release a=stable
    Pin-Priority: 1001</b>
    
    Package: *
    Pin: release a=testing
    Pin-Priority: 650
    
    Package: *
    Pin: release a=unstable
    Pin-Priority: 600
  2. Do an upgrade to perform the downgrade (somewhat oxy-moronish, but you do go the start menu to stop Windows too…):
    apt-get upgrade
    Reading Package Lists... Done
    Building Dependency Tree... Done
    The following packages will be DOWNGRADED:
      binfmt-support ...

Basically, to downgrade debian packages, set the pin-priority to 1001 for the stable packages in your /etc/apt/preferences. Similarly, to downgrade an individual package you can set up a similar section in your preferences file for that package. Let’s say I want to downgrade the “libxrender1” package from unstable to stable. I could do this by adding this section to my /etc/apt/preferences file:
Package: libxrender1
Pin: release a=stable
Pin-Priority: 700
This says to ensure (or “pin”) that the libxrender1 package is a stable package w/ priority 700 (this number just needs to be above the unstable and testing priorities if you’re apt-pinning). Now an upgrade will make sure this package is downgraded to the stable version:
apt-get upgrade
Reading Package Lists... Done
Building Dependency Tree... Done
The following packages will be DOWNGRADED:
  libxrender1
0 upgraded, 0 newly installed, 1 downgraded, 0 to remove and ...

At this point you may see that you still have some unstable or testing packages still installed (using apt-show-versions | grep /unstable). This occurs either when there are no stable versions of these packages available OR another package that cannot be downgraded depends on that version of the package. After doing the mass downgrade I will usually go through and remove a remaining individual unstable package and do a downgrade again. Often removing one of the remaining unstable packages will resolve the bottle neck and a subsequent downgrade will clear out a lot of stuff.

For the more sinister amongst us here is any easy way to remove ALL packages of a certain package:

apt-get remove `apt-show-versions -b | grep testing`
or
apt-get remove `apt-show-versions -b | grep unstable`
If you’re knee-deep in non-stable packages this will often want to remove your whole system, so it is only helpful if you have a few packages with minimal dependencies to remove.

Remember that when push comes to shove you can always remove and re-install a particularly stubborn package – apt-get will keep the config files for a package unless told otherwise so you don’t lose any of your data or setup files.

Howto Install the "lame" mp3 ripper on Debian Linux 8

Posted by ryan
at 3:33 PM on Sunday, September 25, 2005



I recently bought a new CD (can’t tell you the last time I did that was…) and was trying to rip it onto my Debian linux machine use “grip”. Long story short, I couldn’t figure out to install a proper mp3 ripping library – the two I know of being mp3encode and lame. Grip kept giving me “Invalid encoder executable Check your encoder config” errors on the encode step. What I eventually figured out was that neither of them have a debian package anymore (due to mp3 license issues?) – so you have to compile it on your machine if you want it.

I chose to install the lame library since that’s what I first ran across. Here’s how I went about that:

  1. Download the source tar from: http://lame.sourceforge.net/download/download.html
  2. Extract the source: tar -xvzf lame-3.X.tar.gz
  3. Change into the lame dir: cd lame-3.X
  4. Compile and install: ./configure && make && make install
And there you have it. After this you should have a “lame” executable in /usr/local/bin/lame that you can now reference in your mp3 ripper – such as Grip or RipperX.

If anybody knows how to do the equivalent for mp3encode, definitely let me know.

MythWeb: Howto fix "fsockopen() [function.fsockopen]: unable to connect to 127.0.0.1:6543 (Permission denied)" error 4

Posted by ryan
at 9:32 AM on Tuesday, September 27, 2005



I’ve recently embarked on the resurrection of my mythtv project that had been reclaimed for other uses. This time around I’m using Fedora Core 4 and Jarod’s still very authoritative tutorial, which got me completely up and running. However, when I tried to run mythweb I kept getting this error:

Warning at /var/www/html/mythweb/includes/mythbackend.php, line 102:
fsockopen() [function.fsockopen]: unable to connect to 127.0.0.1:6543 (Permission denied)

After digging around a little bit I figured out that this occurs when you have SELinux installed – which prevents the opening of a socket to the backend from mythweb. To fix this I simply followed these instructions, which say to set the following config value in ”/etc/selinux/config”:

SELINUX=disabled

After a reboot, all is well.

Debian 2.6.9 Kernel Compile w/ MPPE support 0

Posted by ryan
at 12:20 PM on Tuesday, December 28, 2004



This is just a place for me to jot down my own personal HOWTO for compiling my Debian 2.6.9 kernel with MPPE support (which will allow me to connect to a Microsoft VPN)

Step 1: Install the latest kernel image to get a base config

  • apt-get install kernel-image-2.6.9-1-686
  • reboot into the kernel

Step 2: Get the latest kernel source, ncurses and kernel-headers

  • apt-get -t testing install kernel-source-2.6.9 libncurses5-dev kernel-headers-2.6.9-1-686 kernel-package
  • cd /usr/src
  • tar -xvjf kernel-source-2.6.9.tar.bz2
  • ln -s ./kernel-source-2.6.9 ./linux

Step 3: Install and apply the MPPE kernel patch:

  • apt-get install kernel-patch-mppe
  • cd /usr/src/linux
  • ../kernel-patch/all/apply/mppe

Step 4: Build the kernel packages (<a href=”http://pptpclient.sourceforge.net/howto-debian-build.phtml”>http://pptpclient.sourceforge.net/howto-debian-build.phtml, <a href=”http://www.adamhooper.com:4242/mcgill-vpn-mppe/#kernel”>http://www.adamhooper.com:4242/mcgill-vpn-mppe/#kernel):

  • cd /usr/src/linux
  • make-kpkg clean
  • cp /boot/config-2.6.9 ./.config
  • make-kpkg —append-to-version -mppe—config menuconfig—initrd kernel_image kernel_headers

In the kernel menu config make sure of the following selections

  • Device drivers —> Networking support --> PPP support (M)
  • Device drivers —> Networking support --> PPP support -> PPP MPPE compression (M)
  • Processor type and features —> Processor family --> Pentium M (This is obviously for me only as I’m on a Centrino laptop – Dell d500 & d600)

Step 5: Install the kernel and kernel header packages

  • cd ..
  • dpkg -i kernel-image* kernel-headers*

Step 6: Verify MPPE support

  • reboot into new kernel
  • test mppe support via: > modprobe ppp-compress-18 && echo success

And the next step is actually setting up the scripts to connect to your VPN


MS Office / MS Money in Crossover Office 0

Posted by ryan
at 10:53 PM on Tuesday, January 11, 2005



I recently purchased Crossover Office 4.1 after having a great experience with their 3.x version. While OpenOffice.org has been doing great for me, there’s always that need to natively open and edit a Word or Excel doc (although I miss the export to PDF button that OO has). I just got the install of Office done tonight, and it always amazes me how much faster Microsoft’s own apps run on Linux than on Windoze. Crossover is definitely worth the $30 if you have the need (it has great Outlook support too for those of you still chained to that app).

What really surprised me is that I got MS Money 2004 to install. Crossover doesn’t have “certified” support for Money, but a few people have gotten it to work – I guess I’m now among those lucky few. As somebody who is absolutely reliant on my personal finance package, this rocks. I did stumble across a little hack that made the install function though… When I did a normal install it hung on me. As part of my attempt to kill the processes I killed what appeared to be the main process (wine-server?) that seemed to un-hang the install. Anyway, I’m a happy man and have no problem paying for software like Crossover Office.

Mounting All Partitions in Read Only Mode - How to Recover 0

Posted by ryan
at 9:24 AM on Sunday, April 24, 2005



Thanks to the untimely crash of my work Dell Latitude D600’s hard drive (the 3rd or 4th time this has happened in our office in the last few months – what has happened to Dell?) – I’ve had to recover my Debian laptop. In the process of doing so (explained below), I ended up mounting all my drives in read only mode for the filesystem to be rebuilt. Great – now how do I get back so that they’re mounted read/write?

I first noticed that my machine my be on the fritz when it started freezing up on me a few times in the last few weeks. Joking to my coworker I said it must be faulty hardware b/c there’s no way it was Linux that was freezing. How true that was…

Friday night, I got home, fired up the machine and left it on my desk. I come back to it after about an hour and the damn thing was frozen. I hard shutdown the machine and when it starts up again it says something like:

/sbin/init - Permission denied
Kernel panic! Error XXXX

After googling around it was clear this wasn’t a recoverable error – and after seeing that filesystem checks were failing on startup I figured the hard drive had gone on me. Since I couldn’t even get to the prompt to run any commands I had to reinstall Debian and reformat my root partition to get the base install – and even then the files in my home partition weren’t accessible and all sorts of other weird errors. Enter reiserfsck.

Seeing these file errors prompted me to run fsck on my partitions (all reiserfs partitions) – and doing so mandates that your partitions are mounted in read only mode. Ok, no problem I think. I go into my /etc/fstab and change “default” to “ro” for all partitions so I can do the check on all partitions.

I boot into the command prompt and do the following to recover:

reiserfsck --check /dev/hda5
reiserfsck --fix-fixable /dev/hda5
reiserfsck --check /dev/hda6
reiserfsck --fix-fixable /dev/hda6
reiserfsck --check /dev/hda7
reiserfsck --rebuild-tree /dev/hda7

I had to “rebuild-tree” on my /home partition as it had errors that couldn’t be fixed with a simple “fix-fixable”. I lost a few files, but in general I was pretty pleased with the recovery. But now I had a system that could only be mounted in read only mode (b/c I couldn’t go back and edit /etc/fstab since it was on a read only partition). The command that saved me and allows you to remount an already mounted partition was:

mount -o remount,rw /dev/hda5

After that I was able to edit (and save) my read/write version of /etc/fstab and be on my way. Thanks to reiserfs for recovering my data and Dell for a crappy product – I will never doubt Linux again …