Sharing Internet connection trough an ethernet card with Ubuntu

If you have more than one network card (wireless and ethernet, like in a normal laptop) you can share your Internet connection with another computer via the ethernet cable. “When should I need such a thing?” you say. I know, I know… let me explain. :-)

The other day I was working on a Linux laptop that doesn’t have an integrated wireless card and the USB one had not been recognised after a fresh install. I needed to install a package to make it work but had no Internet. Classic Linux chicken-and-egg problem, isn’t it? :-)

Here is how you do it. Go to System > Preferences > Network Connections, click on the “Wired” tab and add or edit an existing connection. In the IPv4 Settings tab, change the “Method” to “Shared to other computers”.

Network connections in Ubuntu Lucid

Editing network connection in Ubuntu Lucid

If the graphical tool is not available, you can also set this up from the command line:

sudo ifconfig eth0 10.42.0.1 netmask 255.255.255.0 up
sudo iptables -t nat -A POSTROUTING -o wlan0 -j MASQUERADE
sudo sh -c "echo 1 > /proc/sys/net/ipv4/ip_forward"

This gives the connected machine an IP in the 10.42.0.x range and forwards traffic through your wireless interface.

Enjoy sharing!

Virtualbox USB devices not working on Ubuntu Lucid

There is a known problem between Ubuntu Lucid as host OS and Virtualbox 3.2 when it comes to USB devices. Everything works fine except the USB controller — the devices show up greyed out in the guest OS.

If you have the same symptoms, it is likely a permission problem. Check that your user is a member of the “vboxusers” group.

You can do this through the GUI: System > Administration > “Users and Groups”. Click on “Manage Groups”, scroll down to “vboxusers” and check if your user is listed. If not, add it. :-)

You can also check from the command line:

groups $USER

If “vboxusers” is not in the output, add your user to the group with:

sudo usermod -aG vboxusers $USER

You will need to log out and back in for the group change to take effect. In some cases a full restart is required.

That is it.

Wireless Android/pc file transfer with OnAir

I recently bought a new HTC Wildfire and was looking for a way to transfer files between my computer and the phone without needing a USB cable all the time.

OnAir is an Android app that turns your phone into a wireless file server. You install it, start the service, and browse to the IP and port it shows you — from there you can upload, download, and manage files over WiFi.

OnAir Android app screenshot

The setup is really simple:

  1. Install OnAir from the Android Market
  2. Open the app and start the server
  3. Note the IP address and port shown on screen
  4. Open your browser on your PC and go to that address

You will see a simple web interface with your phone’s SD card contents. You can upload files from your PC to the phone, download files from the phone to your PC, or delete files you no longer need. It supports multiple file selection and works with any browser.

It is not as fast as USB for large transfers — WiFi is slower than a cable — but for quickly moving a few files across the room it is very convenient. No cables, no drivers, no hassle. Perfect for when you are on the sofa and just want to transfer a PDF or a photo.

Enjoy! :-)

10 reasons open source is good for business

According to PCWorld, Open Source software is good for business for exactly ten reasons. Here is a summary.

Security — The more people can look at the source code, the more likely bugs are found and fixed.

Quality — Open source software generally gets closest to what users want because those users can help make it so.

Customizability — If you don’t like the way something works, dig into the code and change it yourself.

Freedom — You are not dependent on the vendor’s priorities or timetable. If you want the software to go in a direction the vendor isn’t interested in, you can do it yourself or pay someone to do it.

Flexibility — You decide when and if to upgrade the software.

Interoperability — Open source software often adheres to open standards, making data exchange between applications easier.

Auditability — The application is transparent. Anyone can see what it does behind the scenes.

Support Options — There are communities of developers ready to help for free, as well as private companies offering paid support.

Cost — You can get open source software for free.

Try Before You Buy — Being free, you can always try before committing.

The whole article can be found at PCWorld.

Enjoy

Open Source Multimedia alternatives to common proprietary software

A common problem in the “Open Source World” is finding the right software that does a similar job (even exactly the same if you are lucky) to our favourite proprietary.

I’ve just found a nice list of multimedia alternative software, divided by category, which might help you finding the right one for your needs. There are “replacements” for software like iTunes, Windows Media Player, Nero, Photoshop etc..
Of course the alternatives are not always as powerful as the original ones but, for normal users, most of the time are more than enough.

3D Graphics and Animation
Art of Illusion as a possible alternative to AutoDesk Maya
Blender as a possible alternative to AutoDesk Maya

Audio Players
Songbird as a possible alternative to iTunes
Amarok as a possible alternative to iTunes
Aqualung as a possible alternative to iTunes
aTunes as a possible alternative to iTunes
Jajuk as a possible alternative to iTunes
Jukes as a possible alternative to iTunes
CoolPlayer as a possible alternative to Windows Media Player
Zinf as a possible alternative to Windows Media Player
Moosic as a possible alternative to iTunes

Audio Recorders and Editors
Audacity as a possible alternative to Sonar X1, Adobe Audition, Sony ACID
Frinika as a possible alternative to Sonar X1, Adobe Audition, Sony ACID
InfraRecorder as a possible alternative to Nero Burning ROM, Roxio Creator
Cdrtools as a possible alternative to Nero Burning ROM, Roxio Creator

Audio Ripping and Conversion
BonkEnc as a possible alternative to Exact Audio Copy, Audio Convertor Studio
CDex as a possible alternative to Exact Audio Copy, Audio Convertor Studio
MMConvert as a possible alternative to Exact Audio Copy, Audio Convertor Studio

Audio Mixing/DJ Tools
Mixere as a possible alternative to Traktor Scratch, Scratch Live
Mixxx as a possible alternative to Traktor Scratch, Scratch Live

File Sharing Clients
BitTorrent as a possible alternative to BearShare, Kazaa, Warez
Ares Galaxy as a possible alternative to BearShare, Kazaa, Warez
Shareaza P2P as a possible alternative to BearShare, Kazaa, Warez
BitTornado as a possible alternative to BearShare, Kazaa, Warez
ABC (Yet Another BitTorrent Client) as a possible alternative to BearShare, Kazaa, Warez
ANts P2P as a possible alternative to BearShare, Kazaa, Warez
DC++ as a possible alternative to BearShare, Kazaa, Warez
eMule/eMule Plus as a possible alternative to BearShare, Kazaa, Warez
Mute as a possible alternative to BearShare, Kazaa, Warez

Graphics Editors
Dia as a possible alternative to Visio Professional
Gimp as a possible alternative to Photoshop
Inkscape as a possible alternative to Illustrator, CorelDraw
Paint.Net as a possible alternative to Photoshop

Multimedia Players
VLC Media Player as a possible alternative to Windows Media Player
Mplayer as a possible alternative to Windows Media Player
XBMC Media Center as a possible alternative to Windows Media Player
Media Player Classic Home Cinema as a possible alternative to Windows Media Player
xine as a possible alternative to Windows Media Player
MediaPortal as a possible alternative to Windows Media Player

Multimedia Library Management
Data Crow as a possible alternative to MediaMan

Music Composition
DrumTrack as a possible alternative to DrumCore
Hydrogen as a possible alternative to DrumCore
Linux MultiMedia Studio as a possible alternative to FL Studio

Video Editing
Cinelerra as a possible alternative to Adobe Premiere
OpenShot Video Editor as a possible alternative to Adobe Premiere Pro CS5
Avidemux as a possible alternative to Adobe Premiere
Kdenlive as a possible alternative to Adobe Premiere Pro CS5
CineFX as a possible alternative to Adobe Premiere Pro CS5
Movica as a possible alternative to Adobe Premiere Pro CS5
VirtualDub as a possible alternative to Adobe Premiere Pro CS5
LiVES as a possible alternative to Resolume Avenue 3, AVMixer

Video File Conversion
DVDx as a possible alternative to Zamzar
DVD Flick as a possible alternative to Zamzar
FFDShow as a possible alternative to Zamzar

Video Player
Miro as a possible alternative to Windows Media Player

Enjoy it!

Linux patch to boost Desktop performance

I have been using Linux (Ubuntu is my favourite distribution) for a few years now. I really like it, actually I love it. ;-) Sometimes though I notice that some software is not as fast as its Windows equivalent.

A common culprit was the kernel scheduler. The Linux kernel offers several I/O and CPU schedulers, each tuned for different workloads. The default in many distributions was the Completely Fair Scheduler (CFS) for CPU and CFQ for I/O — both excellent for servers but not always ideal for desktop interactivity.

The Con Kolivas “BFS” scheduler (Brain Fuck Scheduler) was a popular alternative for desktops. It was designed with a simpler algorithm that prioritised interactive responsiveness over throughput scaling. Many users reported a noticeably snappier desktop after switching.

You could test it without recompiling the kernel by passing boot parameters in GRUB. For the I/O scheduler, adding elevator=deadline or elevator=noop to the kernel command line could improve desktop responsiveness on certain hardware. The deadline scheduler, for example, tries to minimise latency for individual requests rather than maximising total throughput.

Your mileage will vary depending on your hardware and workload, but it was worth experimenting if you felt your desktop could be snappier.

Full article: Linux patch able to boost desktop performance.

Give it a try and see if it works for you! :-)

Android vs iPhone

Let me begin by saying that I don’t own any of those phones, so I’m not going into a technical comparison. But knowing I’m an Open Source fan, you should immediately understand which side I am leaning towards. :-)

You might think: “he hasn’t tried any of them and he wants to tell me which one is better! How is that?!?” Well, as I said, I’m not going to tell you which one is better technically but I can tell you which one is better philosophically.

Here are the key points I think matter:

Open Source — Developers and manufacturers are free to implement and change Android in any way they like, which opens up the platform to tons of new ideas and innovations.

Fully Hackable — You can do whatever you want with it. It’s your phone. Try hacking the iPhone. There is nothing you can do unless Apple wanted you to do it.

Dozens of Phones to Choose From — The iPhone is a beautiful piece of hardware, but what if you want a QWERTY keyboard? Or something bigger? Or smaller? Or cheaper? With the iPhone you’re stuck with just the iPhone. With Android there are dozens of options.

Never will a software be perfect, but we should never renounce to freedom and choice. That’s what open source is about. And Android, being open source, wins on that front.

That is it! :-)

10 Greatest Open Source Software of 2009

Open Source software was becoming more and more popular in 2009, even though many of these applications were still little known. According to PCWorld, here are ten of the greatest.

Firefox — The open source browser that challenged Internet Explorer and changed the web.

Chromium — The open source project behind Google Chrome. Fast, clean, and constantly evolving.

OpenOffice.org — The free office suite that could read and write Microsoft Office files.

VLC Media Player — Plays almost anything you throw at it, no codec packs needed.

GIMP — The GNU Image Manipulation Program. Not quite Photoshop but incredibly powerful for a free tool.

Apache — The web server that powered most of the internet.

MySQL — The database behind countless websites and applications.

PHP — The scripting language that made dynamic websites easy.

Linux — The kernel that runs everything from phones to supercomputers.

WordPress — Started as a blogging platform, grew into a CMS that now powers a significant portion of the web.

Check out the original article on PCWorld for the full list with descriptions.

Enjoy!

Open file graphically as administrator from Nautilus – Ubuntu

Working in the terminal is fine, but sometimes you’re browsing folders in Nautilus and you just want to right-click a config file and open it as root without typing commands. There used to be a package called nautilus-gksu for this, but it was deprecated years ago and removed from modern Ubuntu releases.

Here’s how to do it now.

Option 1: nautilus-admin (recommended)

The modern replacement is nautilus-admin, a Nautilus Python extension that adds “Open as Administrator” and “Edit as Administrator” to the right-click menu:

sudo apt install nautilus-admin

After installing, restart Nautilus:

nautilus -q

Now right-click any file or folder and you’ll see “Open as Administrator” in the menu. It’ll prompt for your password via pkexec and open a Nautilus window with root privileges.

Option 2: Use the admin:// URI

If you prefer not to install anything, you can type this directly into Nautilus’s location bar:

admin:///path/to/folder

Nautilus will prompt for your password and show the specified folder with root access. It’s not integrated into the right-click menu, but it works without any extra packages.

Enjoy!

Disable directory listing/browsing – Apache

Often, you don’t want your website users to browse the whole content of a public folder. They will still be able to download files from it but not to list all of them for no reason.

This can be achieved in different ways. Here we cover modifying the Apache configuration file directly.

Open your Apache configuration file for the website you want to amend. Where it is depends on your distribution. In Ubuntu Lucid it’s in /etc/apache/sites-enabled/website_name. Open the file as administrator and look for something like:

<Directory /home/andrea/www/project_name/trunk/public/>
    Options Indexes FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

and remove the “Indexes” option so it looks like:

<Directory /home/andrea/www/project_name/trunk/public/>
    Options FollowSymLinks MultiViews
    AllowOverride All
    Order allow,deny
    allow from all
</Directory>

Now restart Apache to apply the change:

sudo /etc/init.d/apache2 restart

If you prefer not to edit the main configuration file, you can achieve the same result by placing an .htaccess file in the directory with the single line “Options -Indexes”. This is useful on shared hosting where you don’t have access to the server configuration.

Enjoy!