Kev's Site
  • Home
  • Games
  • Categories
  • Tags
  • About

Using vi as a hex editor

April 21, 2009

Sometimes I find it useful to switch to hex mode when editing a file in vi. The command for switching is not very obvious so thought I’d share… So, open a file in vi as usual. To switch into hex mode hit escape and type: :%!xxd And when your done and want to exit from hex mode hit escape again and type: :%!xxd -r Okay, so this isn’t actaully switching to vi’s ‘hex mode’; vi doesn’t have one.
Read More

Manually creating a Xen DOMU instance

April 13, 2009

If you’ve followed my guide to installing xen from source then you might now be wondering how to create your first VM.
This guide will show you how to manually create and install a VM (known as a DOMU instance in Xen) without any additional tools such as virt-manager, virt-install or virsh. These tools can help the novice, but are quite limiting when it comes to the advance features of xen.

For this example I’ll be installing CentOS5, but this should work for any red-hat based distro (please note there is a bug in fedora10 that stops it booting under xen). This example also uses the paravirtual kernel so it will work even if your CPU does not support AMD-V or intel-VT.

Right, down to business. The first thing we need to do is create a file to user as the hard disk for the DOMU. There are other options for providing hard disks to a DOMU, and I’ll cover some of them in a later guide but for this install I’ll be using a file.

The command below will create an 8GB file that will be used as an 8GB drive. The whole file will be written to disk in one go so may take a short while to complete.
dd if=/dev/zero of=/xenimages/test01/disk1.img oflag=direct bs=1M count=8192

Read More

Installing Xen 3.3.1 from source on Debian 5.0 (Lenny)

April 7, 2009

This is how I built my Xen server.

First install Debian 5.0 (Lenny). This should also work on 4 (Etch) too.

Everything is done on the command line as root.

To build Xen from source you’ll need as fair number of dependencies. The easiest way to install them is by using the apt-get install command as below:
apt-get install bcc bin86 gawk bridge-utils iproute libcurl3 libcurl4-openssl-dev bzip2 module-init-tools transfig tgif texinfo pciutils-dev mercurial build-essential make gcc libc6-dev zlib1g-dev python python-dev python-twisted libncurses5-dev patch libvncserver-dev libsdl-dev libjpeg62-dev

If you installed the 64bit version of Debian then you’ll also need gcc-multilib for the compile to work:
apt-get install gcc-multilib

Read More

LVM how to

April 7, 2009

This is a quick and dirty guide to setting up an LVM based filesystem.

First create some disk partitions. In this example I’ve got two identical unformatted partitions on a couple of hard drives. These appear in /dev as sda4 and sdb4. Please note your partition number will most likely be different.
Also note that it’s easy to break your system with some of these commands. You have been warned, so don’t blame me if you wipe your system out!

First make the partitions available to LVM:
pvcreate /dev/sda4
Physical volume “/dev/sda4″ successfully created

Read More

Copying JVC Everio HDD camcorder recordings with Linux

March 1, 2009

As you might expect, the software that accompanied my Everio HDD camcorder when I bought it was not compatible with Linux. Just as well we don’t actually need any special software to download recordings onto your favourite OS (yes I do mean Linux!)

Plug everything in, USB and the power adapter then switch the camera into PLAY mode.

At this point you should be presented with the usual KDE or GNOME window and be able to view/copy the files in the same way as you would a USB memory stick.

However, there are a couple of drawbacks with this. First, just dragging the files will create a copy on your PC with timestamps of when you copied the videos, not actually filmed them. Second, the video files on your camcorder end in .mod and not .mpg which would be preferable for compatible playback.

So we’ll be using the command line to copy recording and rename them. There’s not much to it really…

Read More

Converting a video file to DVD with ffmpeg

February 22, 2009

There are many GUI programs that allow you to convert avi/divx/xvid files into DVD format, such as DeVeDe, but I somehow prefer to use command line tools. I know, I’m just weird like that!

There are 3 basic steps in creating a simple DVD:

  1. Convert the video files
  2. create the DVD structure
  3. Burn the DVD

So, to convert a file to a DVD compatible format use something like:

ffmpeg -i "non dvd format input video.avi" -y -target pal-dvd -sameq -aspect 16:9 output.mpg

Next we need to create the DVD structure. We’ll use dvdauthor for this.
Rather than pass eveything into dvdauthor via the command line, it’s easier to put the settings into an xml file.

Read More
  • ««
  • «
  • 3
  • 4
  • 5
  • 6
  • 7
  • »
  • »»

 © 2009 - 2025 Kevin Ellis