Tuesday, March 27, 2012

RHEL stop x-server

Very simple. According to the generic runlevel specification, you just have to change to runlevel 3. (Typical systems start in runlevel 5 because of the GUI)

Typical Linux runlevels
IDNameDescription
0HaltShuts down the system.
1Single-User ModeMode for administrative tasks.[2][3]
2Multi-User ModeDoes not configure network interfaces and does not export networks services.[4]
3Multi-User Mode with NetworkingStarts the system normally.[5]
4Not used/User-definableFor special purposes.
5Start the system normally with appropriate display manager. ( with GUI )As runlevel 3 + display manager.
6RebootReboots the system.

How to do it?

# init 3  (as root. And that's it!)

Curiosity

Lately, many systems have migrated to Upstart which is "an event-based replacement for the traditional init daemon — the method by which several Unix-like computer operating systems perform tasks when the computer is started. It was written by Scott James Remnant, a former employee ofCanonical Ltd." (source: Wikipedia)

It was firstly introduced in Ubuntu 6, and was recently adopted by RedHat to its Enterprise Linux (RHEL) as well, being therefore available in dependent distributions like Scientific Linux and Centos.

Wednesday, March 14, 2012

Simple VPN via SSH using SHUTTLE

Have you ever wanted to connect to a remote network? Sure u did. VPN?
What if your workplace doesnt offer VPN services? Or the remote is just your home, you won't install a VPN server. Or simply you wouldnt like to setup a vpn client!


Shuttle comes to help you:
"What's sshuttle? It's a Python app that makes use of SSH to create a on-the-fly VPN between your Linux, BSD, or Mac OS X machine and a remote system that has SSH access and Python."

https://github.com/apenwarr/sshuttle


This is how you use it:
If you would also like your DNS queries to be proxied through the DNS server of the server you are connect to:
./sshuttle --dns -vr username@sshserver 0/0

"Any TCP session you initiate to one of the proxied IP addresses will be captured by sshuttle and sent over an ssh session to the remote copy of sshuttle, which will then regenerate the connection on that end, and funnel the data back and forth through ssh. "

Thursday, October 6, 2011

Installing Django over Zend Server with mod_wsgi

The architecture
We will guide you through the installation of a web server based RHEL 5 to run Django websites using Apache 2 (from Zend Server CE), Python 2.7 with virtualenv, linked by an WSGI interface.


The Tools


Zend Server CE


For our development environment, we are using the Zend Server CE, which besides coming with an administration interface out-of-the-box, it's a complete and stable web server stack, offering apache 2, php, lighttpd, etc.
The installer guides you throw a few installation steps and which, in the end, puts your new server up and running and tells you the address where the hosted pages and the administration page are available, tipically https://localhost:10088 and https://localhost:10082 respectively.
Apart from the functional point of view, when using the installer, Zend Server CE completely installs under the directory you've chosen. That means minimal system modification and better organization.

Python 2.7 and Virtualenv


We want to take advantage of the new features and performance improvements of Python 2.7. Unfortunately RHEL5 ships with Python 2.4 only. Python 2.7 was installed from source in it's own directory, leaving system Python untouched, while alias enable transparent access to the latest binaries.

Furthermore, in order to run out web page with it's dedicated python libraries, we used Virtualenv.

mod_wsgi


It implements a simple to use Apache module which can host any Python application which supports the Python WSGI interface, In our case DJango.


Installation steps
Configure Zend Server CE
  1. Download it from http://www.zend.com/en/products/server-ce/downloads. Choose the tar.gz file.
  2. Extract it
    $ tar -xzf
  3. Install it
    $ cd ZendServer...
    $ ./install.sh
Install python 2.7
  1. Install pysqlite-devel
    $yum install sqlite-devel
  2. Installing Python 2.7 into alternate location since we don’t want to break Centos 5.6 (yum) that uses Python 2.4
  3. $ cd /usr/src/python2.7/
    $ wget http://www.python.org/ftp/python/2.7.2/Python-2.7.2.tgz
    $ tar zxvf Python-2.7.2.tgz
    $ cd Python-2.7.2
    $ ./configure --prefix=/opt/python2.7 --with-threads --enable-shared
    $ make
    $ make install

  4. Creating symbolic link to the alternate Python version
  5. $ ln -s /opt/python2.7/bin/python /usr/bin/python2.7
    $ echo '/opt/python2.7/lib'>> /etc/ld.so.conf.d/opt-python2.7.conf
    $ ldconfig

  6. Let’s test if new Python version works/usr/bin/python2.7

  7. If successful you will see something like this:
    Python 2.7.2 (default, Sep 3 2011, 18:28:42)[GCC 4.1.2 20080704 (Red Hat 4.1.2-50)] on linux2

    press control+D to exit

  8. Now we need to install Python setup-tools
  9. cd /usr/src/python2.7/
    wget http://pypi.python.org/packages/2.7/s/setuptools/setuptools-0.6c11-py2.7.egg
    sh setuptools-0.6c11-py2.7.egg --prefix=/opt/python2.7

  10. Installing virtualenv to our Python 2.7
  11. cd /opt/python2.7/bin
    ./easy_install virtualenv

  12. Create Python links and alias to newest version (optional but recommended)
    $ ln -s /usr/local/python2.7/bin/easy_install-2.7 /usr/bin/easy_install-2.7
    $ ln -s /usr/local/python2.7/bin/easy_install-2.7 /usr/bin/easy_install-2.7
    $ ln -s /usr/local/python2.7/bin/virtualenv-2.7 /usr/bin/virtualenv-2.7
    $ echo "alias python=python2.7
              alias pip=pip-2.7
              alias easy_install=easy_install-2.7
              alias virtualenv=virtualenv-2.7" >> ~/.bashrc
    $ source ~/.bashrc
Installing mod_wsgi (this module will work only with python 2.7)
    $ cd /opt/python2.7/lib/python2.7/config/
    $ ln -s ../../libpython2.7.so
    $ cd /usr/src/python2.7/
    $ wget http://modwsgi.googlecode.com/files/mod_wsgi-3.3.tar.gz
    $ tar zxvf mod_wsgi-3.3.tar.gz
    $ cd mod_wsgi-3.3
    $ ./configure --with-python=/opt/python2.7/bin/python
    $ make
    $ make install
Configure System + Apache
  1. Create a directory structure for static/php pages, wsgi scripts and django sites
    $ mkdir /var/www
    $ mkdir /var/www/html
    $ mkdir /var/www/wsgi-scripts
    $ mkdir /var/www/sites
  2. Create python virtual environment for django websites and activate it
    $ mkdir /usr/local/python2.7/virtualenvs; cd /usr/local/python2.7/virtualenvs
    $ virtualenv --no-site-packages --distribute websites
    $ source websites/bin/activate
  3. Install core Django and required site libraries
    $ pip install django
    $ wget http://bitbucket.org/jespern/django-piston/downloads/django-piston-0.2.2.tar.gz
    $ tar -xzf django-piston-0.2.2.tar.gz
    $ cd django-piston
    $ python setup.py install
    $ pip install django-grappelli
    $ pip install django-filebrowser
  4. Configure mod_wsgi.
    Create file wsgi.conf under /usr/local/zend/apache2/conf.d/ with contents:
    #The aim of mod_wsgi is to implement a simple to use Apache module
    #which can host any Python application which supports the Python WSGI interface.
    #
    LoadModule wsgi_module modules/mod_wsgi.so
    AddHandler wsgi-script .wsgi
    WSGIPythonHome /usr/local/python2.7/virtualenvs/websites

    ######## Configuration entries ##############

        Order allow,deny
        Allow from all


    # WSGI aliases
    WSGIScriptAlias /radioclass /var/www/wsgi-scripts/radioclass.wsgi
  5. Create the website wsgi script for the site
    create file as specified before ( /var/www/wsgi-scripts/radioclass.wsgi ) with contents:
    import os
    import sys
    os.environ['DJANGO_SETTINGS_MODULE'] = 'settings'
    ys.path.insert(0, '/var/www/sites/radioclass/')

    #Load WSGI Handler
    from django.core.handlers.wsgi import WSGIHandler
    application = WSGIHandler()
  6. Create (or move) your django website for the specified directory (/var/www/sites/radioclass/)
    $ cd /var/www/sites/
    $ django-admin startproject radioclass
  7. Apache settings and reload
    check /usr/local/zend/apache2/conf/httpd.conf, and eventually change ListenPort to 80
    restart zend
    $ /usr/local/zend/bin/zendctl restart

Monday, January 17, 2011

IrDA/Infrared working on hp compaq nx7000 series with Ubuntu

The nx7000 hp compaq series has a FIR (Fast IrDA).
Although the device is detected, its default configuration in Ubuntu yields an IRQ conflict with the Parallel port on IRQ7. Besides, the BIOS does not initialize this chip, and therefore it must be so by software.

In order to achieve all that, I wrote these small guidelines, compiled from a scarce set of results.

4.10. IrDA

The nx7010 has a FIR (Fast IrDA) port that supports speeds up to 4 Mbps. The smsc-ircc2 module that supports it is experimental and not included in the default Fedora kernel, so you'll have to set the SMC_IRCC_FIR kernel option, and recompile the kernel. The only problem is that the BIOS does not initialize this chip, so you'll need the SMCINIT utility to do this for you.

To get this to work you first need to download and compile tosh1800-smcinit according to the instructions given on the linked page.

  • Install irda-utils and setserial packages.

The /etc/sysconfig/irda file should look like this:

IRDA=yes DEVICE=irda0 DISCOVERY=yes 

To /etc/modprobe.conf add the following lines:

install smsc-ircc2 /usr/local/sbin/tosh1800-smcinit; /sbin/modprobe --ignore-install smsc-ircc2 alias irda0 smsc-ircc2 

Now you can start IrDA as root via irattach irda0.

DEBUG: Try (re)start ir-util service and check the contents of dmesg

Thursday, December 9, 2010

Propel and Oracle - Installing from scratch on Ubuntu 10.04 / 10.10

Propel (http://www.propelorm.org/) is a great ORM package for PHP which is compatible with most popular database systems, including MySQL, PostgreSQL, SQLite, MSSQL, and Oracle.
Nevertheless putting everything up and running can be quite tricky: it depends on phing, php cli, oracle drivers, etc, which are not ready out of the box.

After many hours reading tutorials and source code, and many failed attempts, I was finally able to put it running, which I will explain below.

Rule #1: Don't reinvent the wheel!
There is a crucial element in this story: the database driver. Installing Oracle Call Interface (OCI) and insert all oci modules into php can be tricky. Therefore, if you are installing from scratch I'd HIGHLY recommend to use Zend Server CE, the successor of ZendCore. This is the procedure described in this guide.
If you're willing to do it by hand, I'd suggest you to visit the following resources:
https://help.ubuntu.com/community/PHPOracle


Step #1: Install ZendServer (apache+php+DB drivers)

Go to http://www.zend.com/en/products/server-ce/downloads and download the latest ZendServer CE. (it's free). You could also try setting up a deb source for apt-get, but in the case of Ubuntu 10.10 this didn't work.
Locate and extract the package:
tar -xzf ZendServer-CE-php-xxxx
Move in the newly created directory and begin installation:
cd ZendServerxxxx
sudo ./install.sh

Great! your Apache server should be up and running. Refer to the printed INSTALLATION SUMMARY message to know your Zend administration page address. By default: https://localhost:10082/ZendServer

In the Administration page go to Server Setup -> extensions and check whether oci8 and pdo_oci extensions are "ON". Otherwise your system is probably missing libaiol. In such case install it:
sudo apt-get install libaio1
Back to the administration page hit "Restart PHP".

Finally we need to add php binaries and libraries to the path. In order to do that, append the following lines to the end of your /etc/profile file (check the path according to your installation).

PATH=$PATH:/usr/local/zend/bin
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/local/zend/lib


and load the new settings:
source /etc/profile


Step 2: Installing and fixing propel

The easiest way to install propel is, without doubt, using php-pear
ZendServer will also provide this utility. If you are installing the system by hand make sure you have php-pear installed before proceeding.

In order to install the Propel packages, you must add new channels from where pear will fetch it and its dependencies:

pear channel-discover pear.propelorm.org
pear channel-discover pear.phing.info

Install propel
pear install -a propel/propel_generator
pear install -a propel/propel_runtime

After the installation is finished, there are two details which must not be forgotten.
In first place, add propel_generator library folder to php include path. The easiest way is to through the zend administration page, under Server Setup->Directives->Paths and directories. Add to the box the path of the libraries, separating with ":", typically:
:/usr/local/zend/share/pear/data/propel_generator/lib
Restart PHP

Further, the current version of phing doesnt support multiple classpaths, which makes Propel to raise the following error every-time it's executed:
Swallowing exception: Could not create task of type: propel-sql [wrapped: Could not instantiate class PropelSQLTask, even though a class was specified. (Make sure that the specified class file contains a class with the correct name.)]

To correct this, edit propel_gen config file:
vi /usr/local/zend/share/pear/data/propel_generator/build-propel.xml

Locate the block:

path id="propelclasses">
pathelement dir="${propel.home}/lib/"/
pathelement dir="${propel.project.dir}/"/ --
/path


and transform it into

path id="propelclasses"
pathelement dir="${propel.home}/lib/"/
!-- pathelement dir="${propel.project.dir}/"/ --
/path

(note the commented second pathelement entry)

After this you should be able to run propel_gen


Step 3: Connecting to the database

The last step is to define the connection to the database. In this case I'll show an example considering a connection to a remote server. Just be sure all php oci modules are loaded and working.

Each propel project has its configurations in a build.properties file, including the connection to the database.
In case of oracle drivers, one must refer to the system OCI drivers, although we must generate Oracle like queries.

Please provide the following details, replacing {} according to your case:

propel.project = {proj name}

# The Propel driver to use for generating SQL, etc.
propel.database = oracle

propel.database.driver = oci

#tnsnames entry
#propel.database.url = oci:dbname={user}@{DBNAME}/{SID}

#Full qualified conn string (no need for TNSNAMES)
propel.database.url = oci:dbname=(DESCRIPTION=(ADDRESS_LIST=(ADDRESS=(PROTOCOL=TCP)(HOST={db_server})(PORT={db_port})))(CONNECT_DATA=(SERVER=DEDICATED)(SERVICE_NAME={SID})))

propel.database.creole.url = ${propel.database.url}
propel.database.user = {user}
propel.database.password = {passwd}


Thursday, October 28, 2010

Unix File-Systems: why EXT4?

Ext4 is here since the Linux 2.6.28 kernel, and henceforth some of the most popular Linux distributions have been adopting it. In some cases, e.g. Ubuntu, it's actually the default file system.
It it really worth to abandon the very well known EXT3 or ReiserFS, which have proven its value for several years now?

Just for minimal information, EXT4 is mostly like an update to EXT3, not really a revolution, which has several advantages over it and is backwards compatible. In the mainline of the improvements is the use of extents instead of block mapping like XFS or Apple HFS+ already do, which is designed to improve performance with the creation of larger files, and will reduce fragmentation on the hard disk. Furthermore, EXT4 features delayed allocation, persistent pre-allocation, and journal check summing.

For a clearer idea, here you find some benchmark results from Phoronix
Ok, one can see that the large file creation really benefits from extents with a significant 50% margin.

For sequential read the performance gain is also very significant, although XFS performs a little bit better. EXT3 and ReiserFS are outperformed by more than 55%

And if you had doubts between EXT4 and XFS, this last test shows how the filesystems perform against a server disk activity simulation. EXT4 performs 3x better than XFS and almost 100% better than the usual competitors.

So, if you are or ever been in doubt, I assume you have good reasons to not think again in the same issue. EXT4 is there and is actually faster for most disk usage patterns.

Tuesday, September 28, 2010

The device mess!

Phones, Smartphones, PDAs, MIDs, UMPCs, Tablets/Pads, Netbooks, Laptops, PCs... the real device mess has come and there is options for every taste, for every pocket and eye.

Notably the whole new terms for devices between Phones and PCs reach the maximum confusion, and there is no clear border in the definitions, so they're likely to overlap. So let's see...

Displays:
Featuring anything from from 4 to 12+ inches, they can be non-touch, or touch. Then the touch ones can be Capacitive, Resistive, Surface Acoustic Wave and a bunch of other strange technologies. From these the Resistive is pretty popular since it supports for multi-touch screens. Check Wikipedia

CPU
powered by a x86, ARM or imitation chip, you can also find of everything that will influence, of course, the performance of your device but also the battery life, the Operating System and all the applications to be run. Nevertheless here a new story begins, which we extend next.

Operating System
Let's present the traditional scenario first:
-Small device -> ARM processor -> proprietary OS / Chrome / Windows CE
-Larger/Work device -> x86 processor -> Windows / Linux
.
If you still believe it, then forget it. Here the things get really complicated!
The latest days I've seen of everything, with a thousand chinese companies creating of everything with every kind of processor, and of course every kind of O.S. running on it.

Some curiosities:
A cheap laptor with an ARM processor running Android.
.
It's not Intel, it's not AMD, neither VIA... It's Loongson! A x86 compatible CPU being developed in China!

And... 5 inch tablet (therefore Ultra Mobile PC - UMPC), which throttles a 1,1GHz Atom

In the end, can can be loaded with all kind of stuff... This is my personal favorite part!
Gadgets
Connectivity: USBs, RS232, WiFi 802.11 a/b/g/n/XXX, ITU GPRS/EDGE/3G/HSDPA/UMTS/HSPA+, Bluetooth, even WiMAX, IRDA, Ethernet...
Extras: GPS, 1D/2D/Barcode reader, RFID and whatever you can imagine to be integrated...

And of course, some resistive versions intended for the professional use, that simply would cost as many times as the amount of plastic around..

Tuesday, June 22, 2010

Resume your remote SSH sessions

How many of us already suffered from a network failure while working remotely over SSH? I'd bet most of us, and isn't that frustating that you just lose all the unsaved changes? It's gone and there's no way you can get back to your session.



Although this is the very common situation, fortunately there is a very simple way you can work over a persistent SSH session.
All you have to do is to create a session holder on the server, which you can do with an utility like "screen" [http://www.gnu.org/software/screen/]

Screnn works server side so it's completely independent on the client software you use for the remote connection.

The steps are just:
  1. Remote login (normally) to your server, from windows, linux, whatever client...
  2. run "screen" (make sure it's installed on the server)
You are now working on a server session. To test it, put something to run, e.g. "top" and close the window.
"Oh God, is my session dead?" - not really. Login again and type "screen -ls". You will hopefully see your sessions, like,

There are screens on:

2477.pts-0.server1 (Detached)
2522.pts-0.server1 (Detached)
2 Sockets in /var/run/screen/S-root.


To reconnect to one of them use:

screen -r 2477.pts-0.server1

There are several options to contol the server session,. Below is a short list of the most important ones:
  • Ctrl a c - Creates a new screen session so that you can use more than one screen session at once.
  • Ctrl a n - Switches to the next screen session (if you use more than one).
  • Ctrl a p - Switches to the previous screen session (if you use more than one).
  • Ctrl a d - Detaches a screen session (without killing the processes in it - they continue).

To close a screen session where all tasks are finished you can type Ctrl-D

Wednesday, March 24, 2010

VirtualBox Raw partition - Windows Host Linux Guest

Some virtualization systems have recently been able to handle real hard disk partitions. This is specially useful if you have a dual boot system (lets say Windows and Linux) but you frequently have to access a system while running the other. Then the solution is to use a virtual machine with your real OS installation.

In my case I'm accessing Linux from my Windows XP installation using VirtualBox. For the other way round you can easily find several how-to's around.


The most important and not obvious step is how to create the mapping virtual disk.

First you'll need to have the boot sector of your Linux Machine accessible. To create it use dd to extract the first 512 bytes from your bootable Linux partition. (In this case I have grub installed on it, NOT in the MBR).

After, please find the VirtualBox name of your partition.
  • VBoxManage.exe internalcommands listpartitions -rawdisk \\.\PhysicalDrive0
Switch PhysicalDrive0 to PhysicalDrive1, PhysicalDrive2... as needed.

You should see something like this:

Number Type StartCHS EndCHS Size (MiB) Start (Sect)
1    0x07  0   /32 /33  13  /163/19           100         2048
2    0x07  13  /163/20  1023/239/63         20480       206848
3    0x07  1023/239/63  1023/239/63         26410     42149888
4    0x83  1023/239/63  1023/239/63         10239     96238800


To create the VirtualBox disk issue the command:

  • VBoxManage.exe internalcommands createrawvmdk -filename e:\vm\ubunturaw.vmdk -rawdisk \\.\PhysicalDrive0 -register -partitions 4 -mbr c:\linux.bin

-filename is the VirtualDisk name (may include path)
-register tells VirtualBox to register the virtual disk in the Virtual Media Manager
-partitions specifies which partition is to be mapped. Make sure it's your linux partition. If you don't specify VirtualBox will try to map the whole Disk, which can corrupt your data, besides not accepting your mbr file.
-mbr Specifies the master boot record for your system (required)

Now just create a common virtual machine with the recently created disk!

Tuesday, March 2, 2010

NIC Bonding/Teaming

NIC binding/teaming is about creating a virtual network device that can make use of several real NICs to achieve higher throughput and/or fault-tolerance.

This means both will have the same MAC address. Depending on the protocol, you might not even have to change router configuration, and several Linux distributions have good support on that.

Here I provide links to some how-to’s on enabing NIC bonding for some of the most popular Linux distributions. Windows users don’t have the same luck, unless the NIC manufacturer had provided some utility for this specific purpose.

In all the cases an additional kernel module has to be loaded (bonding). Debian systems make use of the ifenslave utility.

RedHat Linux Enterprise 4
http://www.cyberciti.biz/tips/linux-bond-or-team-multiple-network-interfaces-nic-into-single-interface.html

Debian
http://www.5dollarwhitebox.org/wiki/index.php/Howtos_NIC_Bonding_Debian
http://www.howtoforge.com/nic-bonding-on-debian-lenny

Ubuntu
https://help.ubuntu.com/community/UbuntuBonding

Thursday, January 14, 2010

HP zt3000 / Compaq nx7000 and Mobility Radeon 9200

It seems like many people are having a lot of problems getting their 9200 video drivers to work on their zt3000 and nx7000 laptops.

Starting around Catalyst 5.6, something changed in the original ATI driver code that stopped working with the laptop's LCD screen.
The newer drivers actually work but the laptop LCD either has a strange color behavior, or it just shows nothing (like in my case).

Solution? Just use a modded Catalyst 5.6 or earlier.

This should be sufficient for most zt3000/nx7000 users... if they're running on XP. If you're trying to run Vista, you can still install them by downloaded the modded drivers install package then enabling Windows XP SP2 compatibility mode.

You can also try Omega Catalyst drivers.

Read more: HP zt3000 / Compaq nx7000 and Mobility 9200

Tuesday, December 15, 2009

Home SVN Server - Authentication with mod_dav_svn


Since nowadays broadband is everywhere, why not installing your own svn server? Unlimited size, private data and ultra-fast access when you’re working locally are some of the advantages.

This tiny overview is not going under much detail about installing the system, instead it reminds you (and myself) some post-installation steps you should not forget in order everything to work smoothly, namely access via apache server (mod_dav_svn).

First: Install the svn package (in ubuntu the package “subversion” comes already with repository administration commands)

Second: Install the libapache2-svn package with apt-get.

Third: Config mod_dav_svn. Go to /etc/apache2/mods-available and find dav_svn.load. Check inside if both apache modules are being loaded (i.e. both lines are uncommented).

Then open dav_svn.conf and you have to configure certain parameters, like the hard disk location where your svn repository will actually reside. Luckily this file is already well documented, but the common settings are as follow:

<Location /svn> –> Tells apache the url it should reserve for SVN. In this case http://your_server/svn will point to our repository, which you use with your svn client.

SVNParentPath /var/svn –> Tells Apache/mod_dav where all svn repositories reside.

Create the repository location and give it permissions.
(remember, when you commit apache will WRITE information for you, so it must have permission to do so)
> mkdir /var/svn
> chown www-data /var/svn –R

No go and create your first repo!
>svnadmin create /var/svn/

The following steps are needed if you want apache to require authentication when users try to commit and or read.

Back to dav_svn.conf

First tell apache “Hey! I want some authentication, and I’ll store users information on … (the file path)”:
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd

This will require authentication for every access. If you want to make it public readable add this trick:

<LimitExcept GET PROPFIND OPTIONS REPORT>
Require valid-user
</LimitExcept>

Now just create your first user:
> htpasswd -c /etc/apache2/dav_svn.passwd your_first_svn_user

To add more users you just skip the –c (create) parameter.

Monday, December 7, 2009

Public DNS server from google

Google seems to be broadening their service provisioning with the introduction of a “Public DNS service”.

If it’s true DNS plays an essential role in the internet, it’s also true it introduces already a significant overhead. Google considers the service can be improved and therefore launches its approach, which they claim it’s faster, more secure and needs no redirection (less resolving jumps).
Details on performance are available at the google page: http://code.google.com/speed/public-dns/docs/performance.html

I’m temped to give it a try. Free, simple to try (and remember). Just point your dns server addresses to 8.8.8.8 and 8.8.4.4. Feedback is encouraged! :)

Public page: http://code.google.com/speed/public-dns/

Wednesday, November 25, 2009

Why store ISOs if you can Mount zip?

Have you ever stored CD images (usually .iso files) on a DVD or hard-drive, just to get rid of the old & slow media? Then you could, of course, mount the image to a virtual drive and you’re done!

Have you ever thought “damn, this ISO could be smaller…” or “this whole bunch of files were better in a single file. Do I have to create an ISO?”

Well, the actual question you’d like to ask is “Can I mount a standard format compressed archive file?” What about zip? Yes, mount zip would be great!
And you know what? It’s as straight-forward as downloading a small piece of software for that.

There’s winMount (commercial), but for free we can get Prismo File Mount: http://www.pismotechnic.com/download/
It supports ISO, ZIP, CISO, CFS, ISZ, DAA… etc. Probably enough for your daily tasks… :)

Monday, November 16, 2009

Linux monitor file updates

This is a very handy command, mostly if you are doing some system changes and you need to monitor a log file.

Like me, many people know it's possible but have forgotten how. Simply use tail!

tail –f <file>

For those who didn't know, it checks for new lines in the file and prints them to standard output.
Nice, isn't it?

Sunday, November 15, 2009

Deluge 1.2 on Ubuntu Hardy

Torrent clients are must-have applications nowadays. There are dozens of clients around, but the average user will look for a simple yet fast and intuitive one.

As a Window user I’m a fan of uTorrent, which is well known by its quality and simplicity. Unfortunately, when it comes to Linux, there’s no uTorrent. After following some discussions between torrent clients for Ubuntu1, I finally decided going to Deluge. It’s said to be fast, simple, good-looking and comes with a web interface.

Those who read previous articles may have noticed I’m building a minimal server system using Ubuntu Hardy (8.04) and Deluge characteristics were about the requirements I had in mind, principally the web-interface for controlling it remotely.

So I went straight to the shell and apt-get install deluge… What?? it doesn’t exist?
A little search through packages.ubuntu.com revealed it’s been only available from Ubuntu Jaunty afterwards.
Further looking into Deluge doc, I could find they provide it via a third party repository, at launchpad:

deb http://ppa.launchpad.net/deluge-team/ubuntu <distribution> main universe

working for distribution feisty, gutsy, hardy, intrepid or jaunty. Good! :)

The steps are:

  1. Add the line to /etc/apt/sources.list, replacing <distribution> with hardy or one of the other dists.
  2. apt-get update. An error will raise saying some “signatures couldn't be verified”. Please copy the key at the end of this line to be used in the next step2
  3. Add the key to apt with the command:
    apt-key adv --keyserver keyserver.ubuntu.com --recv-keys <key_here>
  4. apt-get update. Now everything should go fine.
  5. Now the nice command. apt-get install deluge

You may prefer to install just the daemon and then the web interface. Go for the deluge-core and deluge-web packages.

It’s also a good idea to create a rc startup script so deluge starts automatically at system startup. Luckily someone already thought about that. Give a look at:http://dev.deluge-torrent.info/wiki/UserGuide/InitScript

And that’s it!

1- http://ubuntuforums.org/showthread.php?t=213713

2- https://help.launchpad.net/Packaging/PPA/InstallingSoftware

Tuesday, November 10, 2009

Dyndns in Ubuntu/Debian

In Debian/Ubuntu you can install an IP updater via apt:
sudo apt-get install ipcheck

For dyndns use the following syntax:
ipcheck -r checkip.dyndns.org:8245 \
$USERNAME $PASSWORD $HOSTNAME
Of course, you may find it more useful to create a script which runs automatically via cron.

For details refer to the original article:

http://blog.patrick-morgan.net/2007/05/dyndns.html

Loads of Linux Info

Pretty amazing the amount of information on a single page.

http://www.yolinux.com/

It's true, you'd better "Search this page with ctrl-f"

Monday, November 9, 2009

VMWare 2.0 on Ubuntu 8.04 LTS (minimal)

This small How-to contains the steps to install a virtualization host with VMWare 2.0 on a minimal ubuntu installation.

Ubuntu version was Server Jeos. Yep, it’s intended for virtual machines, but it works perfectly on old standard hardware (like my PIII).


Run the following command to install some necessary packages:

sudo apt-get install linux-headers-`uname -r` build-essential xinetd

Then go to the location where you saved the VMware Server .tar.gz, unpack the file and run the installer:

tar xvfz VMware-server-*.tar.gz
cd vmware-server-distrib
sudo ./vmware-install.pl

The installer will ask you a lot of questions. You can always accept the default values simply by hitting .

When the installer asks you

In which directory do you want to keep your virtual machine files?
[/var/lib/vmware/Virtual Machines]

you can either accept the default value or specify a location that has enough free space to store your virtual machines.

At the end of the installation, you will be asked to enter a serial number:

Please enter your 20-character serial number.

Type XXXXX-XXXXX-XXXXX-XXXXX or 'Enter' to cancel:

Fill in your serial number for VMware Server.

After the successful installation, you can delete the VMware Server download file and the installation directory:

cd /home/falko/Desktop
rm -f VMware-server*
rm -fr vmware-server-distrib/

If you have accepted all default values during the installation, root is now the VMware Server login name.

You can access the management interface over HTTPS (https://:8333) or HTTP (http://:8222); the management interface can be accessed locally and also remotely.

The result was a charming VMServer running occupying 90MB of RAM. Impressive!vmware_server_ubuntu

 

For the full step-by-step version (Ubuntu Desktop) check:
http://www.howtoforge.com/how-to-install-vmware-server-2-on-an-ubuntu-8.04-desktop

Friday, November 6, 2009

Minimal Ubuntu installation

Looking for a very small Ubuntu?
Good and bad news!
Ubuntu most basic version (shell only) is around 400MB.
The good news
If you find it too complicated, two simple alternatives for a "normal" shell-only system.
  1. Download the Ubuntu Minimal and follow the steps. Get iso from https://help.ubuntu.com/community/Installation/MinimalCD
  2. Get the Alternate CD and choose "Install a command-line system.". Here's a good tutorial: https://help.ubuntu.com/community/Installation/LowMemorySystems
Both alternatives will consume between 500MB and 800MB, so it's up to you whether you can dispend the space but have a simpler installation.

UPDATE: If you’re installing Ubuntu on a plain old machine, you might want to try Ubuntu JeOS. It’s ubuntu server version intended to run on a virtual machine. As so, it comes only with the absolutely essential drivers and applications.

After installation (very simple, GUI guided) it occupied some 300MB.