Blog de Ubuntu en Español Blog [no oficial] de Ubuntu en Español

31Dec/090

Using modalias / modinfo to find device details

If you need to track down a device driver details in Linux then one place to start is by grepping modules.alias for the driver.

Today I was looking for more details on a new NC364T 4 port PCI Express Gigabit adapter that I set up on one of our DL360 G5s. We are migrating a few of our ESX hosts to the HPs in the next few weeks and I wanted to do some testing on these cards before the move. These use the Intel 82571EB driver so a if you know Intel’s vendor ID then this is pretty simple:

$ grep -i 8086 /lib/modules/`uname -r`/modules.alias | grep -i 105e

8086 is Intel’s vendor ID and 105e is the device ID for the NC364T.

The output should look something like this:

alias pci:v00008086d0000105Esv*sd*bc*sc*i* e1000e

You can see in the output that v = 00008086 (Intel’s vendor ID) and d = 0000105E (the device ID). sv / sd refer to subsystem versions for both vendor and device respectively.

Now to get useful info about the e1000e driver, just use modinfo:

$ modinfo e1000e

And you should see something like this:

filename:       /lib/modules/2.6.18-164.9.1.el5/kernel/drivers/net/e1000e/e1000e.ko
version:        1.0.2-k2
license:        GPL
description:    Intel(R) PRO/1000 Network Driver
author:         Intel Corporation, <linux.nics@intel.com>
srcversion:     5F52CC7F2D808D334CAC4FD
alias:          pci:v00008086d000010F0sv*sd*bc*sc*i*
alias:          pci:v00008086d000010EFsv*sd*bc*sc*i*
alias:          pci:v00008086d000010EBsv*sd*bc*sc*i*
alias:          pci:v00008086d000010EAsv*sd*bc*sc*i*
alias:          pci:v00008086d000010DFsv*sd*bc*sc*i*
alias:          pci:v00008086d000010DEsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CEsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CDsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CCsv*sd*bc*sc*i*
alias:          pci:v00008086d000010BEsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CBsv*sd*bc*sc*i*
alias:          pci:v00008086d000010F5sv*sd*bc*sc*i*
alias:          pci:v00008086d000010BFsv*sd*bc*sc*i*
alias:          pci:v00008086d000010E5sv*sd*bc*sc*i*
alias:          pci:v00008086d0000294Csv*sd*bc*sc*i*
alias:          pci:v00008086d000010BDsv*sd*bc*sc*i*
alias:          pci:v00008086d000010C3sv*sd*bc*sc*i*
alias:          pci:v00008086d000010C2sv*sd*bc*sc*i*
alias:          pci:v00008086d000010C0sv*sd*bc*sc*i*
alias:          pci:v00008086d00001049sv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Dsv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Bsv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Asv*sd*bc*sc*i*
alias:          pci:v00008086d000010C4sv*sd*bc*sc*i*
alias:          pci:v00008086d000010C5sv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Csv*sd*bc*sc*i*
alias:          pci:v00008086d000010BBsv*sd*bc*sc*i*
alias:          pci:v00008086d00001098sv*sd*bc*sc*i*
alias:          pci:v00008086d000010BAsv*sd*bc*sc*i*
alias:          pci:v00008086d00001096sv*sd*bc*sc*i*
alias:          pci:v00008086d0000150Csv*sd*bc*sc*i*
alias:          pci:v00008086d000010F6sv*sd*bc*sc*i*
alias:          pci:v00008086d000010D3sv*sd*bc*sc*i*
alias:          pci:v00008086d0000109Asv*sd*bc*sc*i*
alias:          pci:v00008086d0000108Csv*sd*bc*sc*i*
alias:          pci:v00008086d0000108Bsv*sd*bc*sc*i*
alias:          pci:v00008086d0000107Fsv*sd*bc*sc*i*
alias:          pci:v00008086d0000107Esv*sd*bc*sc*i*
alias:          pci:v00008086d0000107Dsv*sd*bc*sc*i*
alias:          pci:v00008086d000010B9sv*sd*bc*sc*i*
alias:          pci:v00008086d000010D5sv*sd*bc*sc*i*
alias:          pci:v00008086d000010DAsv*sd*bc*sc*i*
alias:          pci:v00008086d000010D9sv*sd*bc*sc*i*
filename:       /lib/modules/2.6.18-164.9.1.el5/kernel/drivers/net/e1000e/e1000e.ko
version:        1.0.2-k2
license:        GPL
description:    Intel(R) PRO/1000 Network Driver
author:         Intel Corporation, <linux.nics@intel.com>
srcversion:     5F52CC7F2D808D334CAC4FD
alias:          pci:v00008086d000010F0sv*sd*bc*sc*i*
alias:          pci:v00008086d000010EFsv*sd*bc*sc*i*
alias:          pci:v00008086d000010EBsv*sd*bc*sc*i*
alias:          pci:v00008086d000010EAsv*sd*bc*sc*i*
alias:          pci:v00008086d000010DFsv*sd*bc*sc*i*
alias:          pci:v00008086d000010DEsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CEsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CDsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CCsv*sd*bc*sc*i*
alias:          pci:v00008086d000010BEsv*sd*bc*sc*i*
alias:          pci:v00008086d000010CBsv*sd*bc*sc*i*
alias:          pci:v00008086d000010F5sv*sd*bc*sc*i*
alias:          pci:v00008086d000010BFsv*sd*bc*sc*i*
alias:          pci:v00008086d000010E5sv*sd*bc*sc*i*
alias:          pci:v00008086d0000294Csv*sd*bc*sc*i*
alias:          pci:v00008086d000010BDsv*sd*bc*sc*i*
alias:          pci:v00008086d000010C3sv*sd*bc*sc*i*
alias:          pci:v00008086d000010C2sv*sd*bc*sc*i*
alias:          pci:v00008086d000010C0sv*sd*bc*sc*i*
alias:          pci:v00008086d00001049sv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Dsv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Bsv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Asv*sd*bc*sc*i*
alias:          pci:v00008086d000010C4sv*sd*bc*sc*i*
alias:          pci:v00008086d000010C5sv*sd*bc*sc*i*
alias:          pci:v00008086d0000104Csv*sd*bc*sc*i*
alias:          pci:v00008086d000010BBsv*sd*bc*sc*i*
alias:          pci:v00008086d00001098sv*sd*bc*sc*i*
alias:          pci:v00008086d000010BAsv*sd*bc*sc*i*
alias:          pci:v00008086d00001096sv*sd*bc*sc*i*
alias:          pci:v00008086d0000150Csv*sd*bc*sc*i*
alias:          pci:v00008086d000010F6sv*sd*bc*sc*i*
alias:          pci:v00008086d000010D3sv*sd*bc*sc*i*
alias:          pci:v00008086d0000109Asv*sd*bc*sc*i*
alias:          pci:v00008086d0000108Csv*sd*bc*sc*i*
alias:          pci:v00008086d0000108Bsv*sd*bc*sc*i*
alias:          pci:v00008086d0000107Fsv*sd*bc*sc*i*
alias:          pci:v00008086d0000107Esv*sd*bc*sc*i*
alias:          pci:v00008086d0000107Dsv*sd*bc*sc*i*
alias:          pci:v00008086d000010B9sv*sd*bc*sc*i*
alias:          pci:v00008086d000010D5sv*sd*bc*sc*i*
alias:          pci:v00008086d000010DAsv*sd*bc*sc*i*
alias:          pci:v00008086d000010D9sv*sd*bc*sc*i*

This is a lot of good information and you can easily see which other devices can use the same driver.

A couple links for tracking down vendor / device IDs:

PCIDatabase.com http://www.pcidatabase.com/index.php
LKDDb: Linux Kernel Driver DataBase http://cateee.net/lkddb/

Filed under: Contributors No Comments
31Dec/090

Japan Linux Symposium videos

To view video from Japan Linux Symposium check the following link

http://vimeo.com/user1676127/videos/sort:date

Filed under: Contributors No Comments
31Dec/090

2009: We Fooled You

As 2009 comes to a close, below is my very incomplete list of top “we fooled you” moments of 2009.

  • Cloud Computing trumps everything
  • Virtualization renders the OS irrelevant
  • Google “does no evil”
  • Cisco can’t grow or compete
  • Outsourcing isn’t forever
  • Chrome is better than Firefox or IE
  • Storm / Android beats the iPhone
  • Bobby (Foundry) would never sell
  • Huawei will falter
  • HP can’t catch IBM
  • IBM wouldn’t get back into networking equipment
  • Sun is dead
  • Open Source Software kills ISVs
  • Open Source Hardware dominates storage
  • Free Software – LOL
  • PBT vs. MPLS
  • Nortel would be saved
  • Web vs. traditional advertising
  • Juniper would never enter switching
  • Oracle is just a database company
  • Apple vs. Microsoft
  • Dell doesn’t care about services
  • IPOs are dead
  • Facebook is a fad
  • LTE is years away
  • Cisco UCS crushes HP, IBM, Dell, and more.
  • Business Intelligence wars would end
  • IPv6 – enough said
  • All start-ups need traditional VCs
  • Internet / IP Security is solid
  • Google Apps ends the need for Microsoft Office
  • Yahoo is dead
  • Linux Desktop vs. Apple and Microsoft

2009 was both an exciting and frustrating year for technology.  The battle lines are drawn for 2010 and I’m looking forward to a great and surprising year.

Happy New Year!

Filed under: Contributors No Comments
31Dec/090

How to join/merge mp4 files in ubuntu?

Do you have multiple .m4v files and is looking forward to join them?  Then, I hope that this post will help you.

What is required?

ubuntu 9.10 Karmic
Install gpac packages to install MP4Box tools.
sudo apt-get install gpac

Once you’ve done it, you can use the Mp4Box command to concatenate the files together:

MP4Box -cat file_01.m4v -cat file_02.m4v -cat file_03.m4v -new final.m4v

This will create a merged m4v file ready do be used.

NOTE: MP4Box will be able to concatenate only 20 files at a time.

Filed under: Contributors No Comments
31Dec/090

Howto configure PPTP VPN in Ubuntu

First you need to install the following packages

sudo apt-get install pptp-linux ppp pptp

then edit /etc/ppp/chap-secrets file, add the following line

Username   PPTP   Password   *

31Dec/090

Cheap webcam in Linux (Ubuntu Karmic 9.10) with Skype

I think I found a 5$ webcam which can be used with Skype in Linux. I used Skype 2.1 with Ubuntu Karmic 64-bit.

The said webcam is this : http://www.dealextreme.com/details.dx/sku.13 . I am not 100% sure, since I bought a variant of it in India, but as long as the lsusb output shows

Bus 002 Device 010: ID 04fc:2001 Sunplus Technology Co., Ltd

you should be fine (the ID 04fc:2001 being most important).

One needs to compile and install the gspca drivers, as outlined here, but I have also checked in the .config file needed in my github repository.

On that topic, the GSPCA linux webcam driver makes for very interesting history, with one man having written 235 drivers! I’m not sure, who is the current maintainer, but hats off to all of them!

Guys, always buy UVC (USB Video Class) webcams.

Filed under: Contributors No Comments
31Dec/090

Makeshift Linux port checker (Bash Script)

I notice I keep running “netstat -ntlup | grep #” to check to see if my webserver is running on a particular port.  So, instead of typing all that out each time, I wrote this cheap little script.

How to use:
(optional: move it to /usr/bin)
chmod +x portcheck.sh
portcheck [port # or program name]

i.e.: portcheck 80 or portcheck lighttpd

#!/bin/bash

# Script is used to determine if a port is used.
# Usage: portcheck
# Executes netstat -ntlup | grep to do checking.
# Returned text is stored in a variable. If variable is empty,
# port is not in used. Otherwise, port is being used.

# Get the username of the person running script
USER=`id -un`

# Root is required to run netstat -ntlup
if [ "$USER" != "root" ]; then
echo "Root privileges required."
else
NET=`netstat -ntlup | grep $1`

if [ -z "$NET" ]; then
echo "Port is free"
else
echo $NET
fi
fi

Filed under: Contributors No Comments
31Dec/090

What is Linux?

Linux is an Open Source implementation of UNIX initiated by Linus Torvalds, which runs on many different hardware platforms.

Falconer’s owner has recently earned a Novell Certified Linux Professional (CLP) certification and become a Novell Silver Partner.

Hundreds of application programs have been written for Linux, some of these by the GNU project. Systems using protected memory and pre-emptive multitasking are inherently more stable. Because the source to Linux is open source, it is easy to customize and to update rapidly (total cost of ownership is also low). This flexibility has enabled Linux to run on everything from handheld and embedded systems to clusters of hundreds of servers.

The pronunciation of “Linux” has been a matter of much debate. Many, including Torvalds, insist on the short I pronunciation /li’nuks/ because “Linus” has an /ee/ sound in Swedish (Linus’s family is part of Finland’s 6% ethnic-Swedish minority) and Linus considers English short /i/ to be closer to /ee/ than English long /i:/ dipthong. This is consistent with the short I in words like “linen”. This doesn’t stop others demanding a long I /li:’nuks/ following the english pronunciation of “Linus” and “minus”. Others say /li’niks/ following Minix, which Torvalds was working on before Linux.

Filed under: Contributors No Comments
31Dec/090

All The New Stuff You Can’t Use

Do you get excited about new language features? Probably. Can you use them immediately at work? Sometimes. If you write software that you distribute though, you often can’t!

Wouldn’t it be awesome if I could get all of the Python Package and Ruby gems (and CPAN) as RPMs on EL 4 and I get to pick my interpreter version (any version I like) and be able to choose from multiple interpreter versions to run on the same system?

Part of the problem with writing software that you want to be easy to set up and install for users is that you can’t use the shiny newness. For instance, if you have to support EL 2, you won’t be excited about new features in Python 2.5, as you’ll never be able to use them. Same deal with Rails 3 or TurboGears 4000.

If you are a hosted service, you could decide to do a lot of work and become a mini-distribution (packaging these things for yourself and tracking security updates and other bugfixes), but that’s a lot of duplicated IT across the world for everyone trying similar things. Each new library you want to use becomes a discussion with IT because someone needs to package it and look after updates. Ouch!

I am not a fan of the java-style mode of deployment as it seems to imply a great chance for security vulnerabilities (due to lack of updates by packaging a sub-module with your code), retards progress, and also tends to encourages forking. However I can kind of understand why it occurs. Fear of the outside world breaking your code, or not being able to deploy what you want where you want it.

Virtual appliances are also the wrong answer to deployment, because of the same update concerns, and the fact they take a sledgehammer to the problem and waste resources.

Ideally what I think I want is a cross-distribution build server that all upstream software projects could use that would automatically build packages for different interpreter versions and distributions. By cross distribution I not only mean all of Fedora, CentOS, and RHEL, but also Debian and Ubuntu. If we are lucky, also OS X. I’m tired of OS X deployments working differently.

Then I should be able to do:

yum install python25-simplejson python24-simplejson

and run the same interpreter on the same box.

Some issues are to be had with contention over Apache, I’m assuming, though I think it would be really awesome if we could take every hosted service developer in the world out of having to maintain their own libraries when Enterprise Linuxes are too far behind and the likes of Fedora or Lefty Lemur are too fast-changing and unstable.

I don’t forsee this happening, of course… but you know… sometimes I think it would be nicer if the newness was easier to deploy on the oldness. To do this though, we really have to take the human distro-specific packagers out of the equation, and make a build service that is very very encouraging for all upstream developers to use. And it should (because of the upstream focus) ideally involve a partnership between distributions. This may also require unifying Debian and RHEL packaging in order to gain widespread adoption of software developers packaging their own content and submitting it to common build servers. If possible, do OS X as well.

Also, I want a pony.

Filed under: Contributors No Comments
31Dec/090

Fixing sound after upgrading to Ubuntu 9.10 Karmic Koala

I recently upgraded from Ubuntu Jaunty (9.04) to Karmic (9.10), and the sound stopped working. As a matter of fact, no sound card was detected. Searching around, it turned out that the problem lied with a wrong kernel version, which actually stems from an apparent bug in the new grub boot loader that ships with Karmic. Even though I’m using Ubuntu, this might affect other distributions that use the same boot loader. If you face a similar problem, try the following:

First, check your kernel version:

  • sudo uname -r

If you see a version below 2.6.31, do the following:

  • Delete your old /boot/grub/menu.lst file. Due to an apparent bug, grub will not overwrite it during upgrade or subsequent upgrade-grub commands.
  • Run sudo update-grub. A new menu.lst will be generating, now pointing to the right kernel.
  • Install grub on your MBR. First make sure which device holds your MBR (most probably /dev/sda, but it might be /dev/hda if you have an old IDE disk), then run: sudo grub-install /dev/sda.
  • Reboot.

Hope this helps.

Filed under: Contributors No Comments