Category: Debian

HowTo: Mount Bin/Cue files in Linux

HowTo: Mount Bin/Cue files in Linux

Okay, so I I lied a little bit. I’m not sure how to mount a straight bin/cue file combination in Linux, but I do know that it’s really easy to convert them into an ISO file, and then mount the ISO in debian based linux.

sudo apt-get install bchunk

The syntax from bchunk is as follows:
bchunk [-v] [-p] [-r] [-w] [-s]

So if i wanted to convert image,bin and image.cue into image.iso, I’d run the command:
bchunk image.bin image.cue image.iso

Then to mount the ISO in linux you run the command:
mount -o loop -t iso9660 image.iso /mnt/image, where image.iso is the iso is the image that you want to mount and /mnt/image is the mount directory.

Hopefully you’ll find a use for this like I did. If it doesnt work feel free to leave me an email at howe -dot- jon -at- gmail -dot- com and I’ll respond as quick as I can.

Later,
Jon Howe

Howto: Set Up Your Own Snort Intrusion Detection System with a Database Backend

Howto: Set Up Your Own Snort Intrusion Detection System with a Database Backend

Okay, truth told, I’m completely bored, so I’m going to write a quick tutorial on how to install and set up the Snort IDS on a Debian Sarge System (although it should work on other distros as well).

Download and Install Snort
apt-get install snort-mysql

Enter values in the following screen, but forget about the part about the database
cd /usr/share/doc/snort-mysql
mysqladmin -u -p create
zcat create_mysql.gz | mysql -u -p

Howto: Get a Movie from a DVD to your Sony Clie (and probably other PDAโ€™s as well)

Howto: Get a Movie from a DVD to your Sony Clie (and probably other PDAโ€™s as well)

I’ll try to make this as simple as possible.

I’m going to assume that you’re using Linux (and that you are not a complete noob at it) for this tutorial. I will assume that you’re using a Sony Clie.

Here’s an overview of what we’re going to do:

  1. Rip dvd using DVD:Rip
  2. Convert ripped movie into a clie compatible format
  3. Download and install TCPMP (free media player)
  4. (optional) Install Memory Stick Pro fix
  5. Copy Movie to the Memory Stick

Step 1: Download and Install Files
apt-get install dvdrip
apt-get install pilot-link
Download TCMP (for palm)
Download all attachments

Step 2: Rip DVD
Encode with the xvid4 codec
Set file size to One CD at 700Mb
The only reason that I have this step is because I like to watch the video in high quality on my desktop

Step 3: Convert ripped DVD to Palm Readable Format
Put the following into a script called vid2palm and make it executable


#!/bin/sh
#Change 480:320 to the size of your PDA screen
#480:320 works for the Sony Clie

nice mencoder $1 -vf scale=480:320 -ovc xvid -xvidencopts bitrate=300 -oac mp3lame -lameopts cbr:br=64 -o $2
So, if dvdrip created the file MyMovie.avi you’d run the command vid2palm MyMovie.avi MyMovie_Palm_Format.avi

Step 4: Install files on your Clie
This can be a little tricky for someone doing it for the first time, but after a couple of times it works great.

The syntax for installing a palm file is:
pilot-xfer /dev/pilot -i [File to be installed]

However, If you just run this command it won’t work. You first need to hit the hotsync button and then quickly run the previous command.

If you do this and the console says to press the hotsync button, just hit cancel on your clie, and terminate the command, and try again. It’s been a bit of hit-and-miss for me.

Files to install on the PDA from the TCPMP Archive:

  • pilot-xfer /dev/pilot -i tcpmp_ffmpeg_plugin.prc
  • pilot-xfer /dev/pilot -i tcpmp_mp3_plugin.prc
  • pilot-xfer /dev/pilot -i tcpmp_mpeg4_plugin.prc
  • pilot-xfer /dev/pilot -i tcpmp.prc
  • As well as the attached tcpmp_aac_plugin.prc
  • If your memory card is a memory stick pro it will not work by default with the clie, so you have to install a fix for it (it’s the MSPRONX_ENUS.PRC one):
    pilot-xfer /dev/pilot -i MSPRONX_ENUS.PRC

    Sound doesn’t work by default on mine either, I had to install the following patch (again, an attachment: MCA2_05_TEST.prc):
    pilot-xfer /dev/pilot -i MCA2_05_TEST.prc

    You need to set up this plugin by going to prefrences and then in the drop down menu select MCA2, and check the button “auto install after reset”. It will restart, then go back to the same area and select “DEFAULT is ON (normal)”.

    Step 5: Moving the finished product to your Memory Stick (pro)
    First, goto MS Import. If you have a newer distro / kde it will mount the flash drive as a local directory. If it doesnt, use the “mount” command to mount it. I assume that you know how to do this (if you don’t try “man mount”).

    Now it’s a bit of a waiting game. Once it looks like it’s done copying unmount the device in linux first, wait a minute, and then disconnect in MS Import.

    Step 6: Play the Movie
    Goto TCPMP, open, and play your movie!

    This is how I did it, after a week or so of trying.

    If you have any questions leave a comment or email me (howe -dot- jon -at- gmail -dot- com.

    Later,
    Jon Howe

    Howto: Kernel Building in Debian Sarge (3.1)

    Howto: Kernel Building in Debian Sarge (3.1)

    I’ve tried and tried to build my own custom kernel over the past year or so, usually only to stop in frustration because of some small part of the process not working.

    This is all different now.

    I found out that using the took make-kpkg makes things way easier. In fact I configured, compiled, and installed kernel 2.6.15 in about 30 minutes including the time that it took me to build it.

    Here’s the process that I followed to achieve this:

    1. Get required packages apt-get install libncurses5-dev fakeroot bzip2 kernel-package
    2. Get latest kernel package from Kernel.org. The latest one at the time of this post is linux-2.6.15.tar.bz2.
    3. Decompress the kernel archive (tar -xjvf linux-2.6.15.tar.bz2)
    4. Start the kernel configuration tool (make menuconfig)
    5. I should mention that it was way easier for me to load my existing kernel configuration, which was located at /boot/config-(kernel version here).

    6. make-kpkg clean
    7. fakeroot make-kpkg –initrd –revision=myfirstkernelbuild_v.0.1 kernel_image
    8. This runs make-kpkg as root, while making it so that initrd can load the kernekl. –revision is just the revision of the kernel, and kernel_image is just the name of the kernel that you’re building.

      The output of this command is kernel-image-2.6.15_myfirstkernelbuild_v.0.1.deb

    9. Install the kernel (dpkg -i kernel-image-2.6.15_myfirstkernelbuild_v.0.1.deb)
    10. Restart the computer (init 6)
    11. If this process worked the output of uname -r should be 2.6.15.

      Let me know if you have any problems.

      Later,
      Jon Howe

    Convert RPM to Deb + News

    Convert RPM to Deb + News

    I found a few cool things this morning.

    The first being a way to install a rpm file in Debian. You do this using the alien command (apt-get install alien).

    To convert a package from an rpm to a deb run the following command:
    alias --to-deb

    To just install a rpm use the following command:
    alias -i

    It's that easy.

    Also, I was looking at some stories on the front page of Digg, and found a Great New Library for use with Google Maps. It has the features of the one that I was messing around with earlier (I forgot the name of it). It even includes the features that I had to add inot the other library.

    Who knows, you might be getting a little tutorial on how to use this library soon.

    Later,
    Jon Howe

    How To Cache Apt Packages On A Network Using Apt-Cacher

    How To Cache Apt Packages On A Network Using Apt-Cacher

    If you’ve got more than one computer running Debian that packages are downloaded through apt, then apt-cacher should help you a lot.

    Apt-cacher is actually a cgi script that is run by apache. Using apt-cacher is very easy, and installing it is even easier.

    Step 1: Install apt-cacher.
    (Run this on the proxy computer)

    apt-get install apt-cacher

    Enter the webpage : http://localhost/apt-cacher
    to see that the proxy is running.

    Step 2: Backup and Convert Clients sources.list.
    (Do this on the computers that you want to access the cache.)

    cp /etc/apt/sources.list /etc/apt/sources.list.backup

    vi /etc/apt/sources.list

    Press ‘:’ while in vi.

    Enter “%s/http:///http://[Your Proxy IP]/apt-cacher?//g

    This searches through your sources and adds http://[Your Proxy IP]/apt-cacher?/ before every repository.

    An example from my sources.list looks like this:

    deb http://192.168.3.2/apt-cacher?/www.backports.org/debian/ sarge-backports main

    Step 3: Update Clients

    apt-get update

    Optional Step 4: Import Existing packages into the apt-cacher cache

    Copy the desired packages to the proxy directory /var/cache/apt-cacher/import

    Run the import script to make it so that apt-cacher can use them.
    perl /usr/share/apt-cacher/apt-cacher-import.pl

    Step 5: Use apt-get

    If the required previous steps completed successfully you should now be able to use apt with it’s connection proxied through your apt-cacher proxy.

    Questions / Comments, leave me a comment, and I’ll reply.

    Later,
    Jon Howe

    Chkconfig like program in Debian

    Chkconfig like program in Debian

    I started out in Linux using Fedora, which is Redhat based. One of the indespensible tools that I used was called chkconfig. Basically what chkconfig does in Redhat based systems is allow the user to control what daemons start at boot time. This is useful for starting that annoying daemon that you always need or stopping the pesky one that always bothers you.

    I used this a ton, and then I switched to Debian, and my whole world turned upside down. (some exaggeration intended)

    Until recently I had no idea how to do this, until I found out about a little gem called ‘rcconf’.

    Rcconf even has a little optional graphical display that you can use to manually select things to autostart or stop, which is helpful if you don’t know what it is you’re looking for.

    If you’re on a pretty new installation of Debian you probably don’t have this yet, but you can get it by entering apt-get install rcconf into the console as root.

    More Later,
    Jon Howe

    Problems when running apt-get on Debian

    Problems when running apt-get on Debian

    I’ve been having some problems using apt-get lately which led me to doing an apt-get dist-upgrade.

    Smart me found this command on the internet and decided to use it. It worked just fine, except for the fact that when I restarted my computer the graphical display manager that I use didn’t start.

    Here’s the steps that I took to diagnose the problem.

    1. I tried to start gdm instead of kdm by editing'/etc/X11/default-display-manager'. This file contains the path to your display manager, for me it was '/usr/bin/kdm'
    2. I tried changing that to '/usr/bin/gdm' and I received an X server error saying that my chosen X server (XFree86) was not found.I thought that this was a little funny because I didn’t think that I used XFree86, but Xorg instead.
    3. So, I looked at the file '/etc/X11/X', which is a symbolic link (which is like a shortcut in windows) and found out that in the upgrade it changed the link to point to a nonexistent file.
    4. After that I changed the link to point to '/usr/bin/X11/Xorg' and voila, kdm started up just fine.More Later,
      Jon Howe
    Copyright VirtJunkie.com ยฉ 2024