Tag Archives: linux

Checking video codec information via the command-line

Here are a couple of commands to get he information about a video file in Linux (bitrate etc): -

 ffmpeg -i foo.avi 
 mplayer -vo null -ao null -identify -frames 0 foo.avi 

VirtualBox piix4_smbus Error

VirtualBox 3.2.10 gives me the following error message when booting Ubuntu 10.10: -

piix4_smbus 0000.00.07.0: SMBus base address uninitialized - upgrade bios or use force_addr=0xaddr

This error is caused by VM having no smbus but Ubuntu always trying to load the module. It doesn’t affect anything but is a bit annoying – to fix: -

1. Check module is being loaded: -

lsmod | grep i2c_piix4

2. If so, blacklist it in /etc/modprobe.d/blacklist.conf, by adding the following to the end of the file :-

blacklist i2c_piix4

3. Update the initramfs

update-initramfs -u -k all

Windows 7 and Samba Shares

This is a quick guide to setting up Samba file sharing on my Viglen MPC-L server which is running Ubuntu 8.04.3 LTS. The client is a Windows 7 machine – no changes to the registry or local security policy were needed. The following applies to the version of samba from the repositories –   smbd version 3.0.28a.

1. Install Samba

sudo apt-get install samba smbfs

2. Edit Samba Configuration File

Find the line which is commented out – “;   security=user” and change it to: -

security = user
username map = /etc/samba/smbusers

Find the line “encrypt passwords = no” and change it to “encrypt passwords = true”

Add a section for each share that you want to be available: -

[data]
browseable = yes
comment = Data
path = /data
force user = viglen
force group = users
read only = No
guest ok = Yes

3. Add “smbusers” file

A new file is now needed to map smb users onto local linux users. Create the file: -

sudo vi /etc/samba/smbusers

and add the following to it: -

viglen = "viglen"

4. Change  SMB Password for user

Set a password for the viglen smb user by running the following command: -

sudo smbpasswd viglen

5. Restart Samba

sudo /etc/init.d/samba restart

6. Test Connection from Windows

Open a windows command prompt (Start -> cmd) and enter the following command (with the correct IP address and password)

net use q: \\aaa.bbb.ccc.ddd\data password /user:viglen

You should get a message “The command completed successfully.”, and Q: should be accessible through Windows Explorer etc.

To remove the share, enter the following command: -

net use /d q:

XBMC With VDPAU and iPlayer

There’s an interesting article on the How to do something differently… blog about getting VDPAU working with iPlayer under Linux with the SVN build of XBMC. I’ll be sure to look into it some more when I install Ubuntu onto my Revo.

List of Media Centre Software for Windows and Linux

Here is a list of free Media Centre Software for Linux and Windows.

Windows Media Center Software

Linux Media Center Software

Ubuntu Wallpapers

To install some nice wallpapers on Ubuntu, run the following command: -

sudo apt-get install peace-wallpapers tropic-wallpapers ubuntustudio-wallpapers blubuntu-wallpapers

Starting a VM from the Command Line

Starting a VM from the Command Line (or via a shortcut on the desktop) is easy – just use the command: -

VBoxManage startvm name_of_virtual_machine

for example : -

VBoxManage startvm “Windows XP”

USB in VirtualBox

Here are the steps required to get USB working on a Linux host (tested with VirtualBox 2.1.4)

1. Create a group usbusers and put yourself in it.

sudo addgroup usbusers
usermod -a -G usbusers andy

2. Note down the vendor and id numbers for the USB devices that you want to enable after running the following command: -

VBoxManage list usbhost

3. In VirtuaBox’s USB section add both of these devices, making sure you have the vendor and id numbers correct.

4. Add the following lines in /etc/fstab (you can get the ID of the usbusers group by looking in /etc/group) : -

# usbusers is the USB group (id 1001)
none /proc/bus/usb usbfs devgid=1001,devmode=664 0 0

5. A reboot is required.

Combining PDF Files

Combining PDF files in Linux is ridiculously easy – its just a matter of installing the PDF Toolkit package (pdftk) and then running the following command: -

pdftk file1.pdf file2.pdf file3.pdf cat output newfile.pdf

Mounting QNAP from Linux

Accessing the QNAP from Ubuntu is fairly easy.

First install “smbfs”: -

sudo apt-get install smbfs

Then it’s just a matter of creating the relevant directories in /mnt

sudo mkdir /mnt/Qdownload
sudo mkdir /mnt/public
sudo mkdir /mnt/Qmultimedia
sudo mkdir /mnt/Qweb

…and then editing /etc/fstab

//192.168.0.2/Qdownload /mnt/Qdownload cifs credentials=/root/.credentials,directio,iocharset=utf8,noacl,noperm,nosetuids,rw
//192.168.0.2/Public /mnt/public cifs credentials=/root/.credentials,directio,iocharset=utf8,noacl,noperm,nosetuids,rw
//192.168.0.2/Qmultimedia /mnt/Qmultimedia cifs credentials=/root/.credentials,directio,iocharset=utf8,noacl,noperm,nosetuids,rw
//192.168.0.2/Qweb /mnt/Qweb cifs credentials=/root/.credentials,directio,iocharset=utf8,noacl,noperm,nosetuids,rw

You then need to create a file with your username and password in it: -

sudo vi /root/.credentials

and put the following in it: -

username=user
password=pass

A simple “sudo mount -a” will mount these filesystems ready for use.