Category Archives: Linux

Ubuntu 10.10 Maverick Meerkat Said To Be Radical

Ubuntu LogoThe new anticipated release of Ubuntu 10.10,  named “Maverick Meerkat” (currently in alpha2) is said to be radical, according to Marc Shuttleworth, chief of Canonical.

Canonical head Mark Shuttleworth mentioned on his blog that the upcoming Ubuntu version 10.10 will be focused on being social and fast. Shuttleworth says “The OS is getting faster and faster when it comes to boot times but the final push remains”. In the mean time, he said that the Netbook Edition of Ubuntu 10.10 will have a revamped UI and will be the fastest booting, fastest network OS for netbooks at this time. Canonical is the company that finances and oversees the Ubuntu project.

Ubuntu 10.10 is being called “Maverick Meerkat”. Meerkats are social creatures by nature and very family oriented and therefore has been adopted for this release. The Ubuntu project has been working very hard to become a viable and open source alternative to leading operating systems such as Mac OS X and  Windows 7.

Ubuntu is probably the most installed Linux distro currently, thanks to many different flavors (Ubuntu, Kubuntu, Xubuntu, Edubuntu, Ubuntu Studio and Ubuntu Netbook Edition). These variations include desktop and server versions including applicable applications and default settings. The last one is for netbooks and started with the amalgamations of Intel’s Moblin (Mobile Linux) into Ubuntu.

Ubuntu 10.10 promises to make everything faster and better than ever before, but ultimately will depend on how good Canonical is at keeping promises. Ubuntu has become a strong competitor and real alternative, and that is especially true for netbooks. For the average consumer, power users and production systems, the benefits come in the form of low cost, good stability and increased security.

Learn more about Ubuntu and the upcoming release.

Create Patch Files Using Patch And Diff

Using diff to create batch files and subsequently running them against select files is such a convenient way to update, fix or change existing files, but many developers and system administrators simply don’t know much about them.

Here is a quick primer on using diff and apply changes for select files. Use diff –help to check out more options and flags.

NOTE: pay caution when using patching, any mistake or error are executed without warning or undo feature. It’s best to always make a backup of any file or folder that are going to be affected by your patch.

diff

Some useful flags you can specify when comparing files are -b (ignore white space difference), -B (ignore blanc lines), -r (recursive) and -i (ignore case).

Let’s say we need to change the GA analytics code on our pages and that they are unfortunately hard coded. The files are shown below as are the results from diff: Read more »

How To Clean Up The New Ubuntu Grub2 Boot Menu

Clean Up And Modify he new Ubuntu Grub2 boot menu differs quite a bit from the previous version. As Ubuntu nominated the new version 2 of the Grub boot manager as of 9.10, removing of the old problematic menu.lst file.

Ubuntu Grub2 Boot Menu

Ubuntu Grub2 Boot Menu

Grub2 is a leap forward in many ways, and most of the annoyances from menu.lst are gone. Yet, if you don’t clean up old versions of kernel entries, the boot list can quickly get messy and end up in a long list of nonsense. Let’s assume we want to remove the 2.6.32-21-generic boot menu entries. Previously, this meant editing /boot/grub/menu.lst. But with Grub2, we use the package manager to remove the kernel package from our computer, Grub automatically removes those options. Btw. if only one operating system is installed on your computer, you may not see the boot menu at all and have to hold down the SHIFT button on your keyboard while booting up to get the menu to show.

To remove old kernel versions, open up Synaptic Package Manager, found in the System > Administration menu. When Synaptic opens up, type the kernel version that you want to remove into the Quick search text field. The first few numbers should suffice. Then for each of the entries associated with the outdated kernel (e.g. linux-headers-2.6.32-21 and linux-image-2.6.32-21-generic), right-click and choose “Mark for Complete Removal”, then hit “Apply”. These entries will be gone upon the next boot. Read more »

Install PHP 5.2 on Ubuntu 10.04 Lucid Lynx

There are many reasons why we want to install PHP 5.2 on Ubuntu 10.04 Lucid Lynx, the most prominent is that many web packages are not compatible yet with PHP 5.3. Drupal 6 being a prime example.

But there is no automated method out of the box, and there are now several scripts floating around the Internet that may work or just partially work. A major concern is the ability to update, easily switch to PHP 5.3 when the application is ready and also easily add / remove extensions.

With these considerations in mind, this is the best way to install PHP 5.2 on Ubuntu 10.04 Lucid Lynx:

We will install PHP 5.2 using apt-get and install from Ralp Janke’s repository. Read more »

Best New Chrome Extensions For Developers

With increasing popularity in Google’s Chrome browser, so increases the demand for extensions. This is especially true for Developers, as we are used to such a nice variety of high quality tools in Firefox. And the more tools are available on one browser, the more that browser is used in developing web sites, resulting in higher quality web experience for end users on that platform. Btw., did you know that Google Chrome surpasses Safari in US browser market (macstories.net)? The following are arguably the best new Chrome extensions for developers.

6. BuiltWith Technology Profiler

BuiltWith ExtensionBuiltWith is a web site profiler tool, that returns all the technologies it can find on a particular page. BuiltWith extension helps developers, researchers and designers find out what technologies web pages are using and in turn help them to decide what technologies to implement. BuiltWith currently tracks widgets (snap preview), analytics (Google, Nielsen), frameworks (.NET, Java), publishing (WordPress, Blogger), advertising (DoubleClick, AdSense), CDNs (Amazon S3, Limelight), standards (XHTML,RSS), hosting software (Apache, IIS, CentOS, Debian).

5. Session Manager

Session Manager ExtensionWith Session Manager you can quickly save your current browser state and reload it whenever necessary. You can manage multiple sessions, rename or remove them from the session library. Each session remembers the state of the browser at its creation time, i.e the opened tabs and windows. Once a session is opened, the browser is restored to its state.

Read more »

Testing Memcached Using Telnet Commands

Troubleshooting memcached is not so transparent as some other technologies, but testing memcached using telnet commands can give us quite some insight on what’s happening under the hood.

Following is a short list of useful commands to inspect a running memcached instance.

How to find the IP address and port to connect:

ps aux | grep memcached will give us the process running memcached, with listening ip address and port. If this command does not yield any results, you likely not running the daemon and need to start it up first.

We can now connect using this info:

telnet 127.0.0.1 11211 (replace your IP address and port)

Supported Commands:

The following is a list of the most important memcached commands. For a more complete list of supported commands, check out the memcached wiki document. Read more »

Burn vob Files To DVD On Mac / Linux

If you’ve got some .vob files and wonder how to get those onto a DVD and actually play it on your DVD player, you may get or already have some strange results.
The files might just be listed on the DVD, without the disc actually playing the movie as a DVD, or the disc may play the first vob section, then the second has no sound. And there is a plethora of issues and scenarios, just not the one you were expecting.

There are multiple ways to do it right and to achieve what you want. Here are two distinct ones:

1) Get a program called Roxio Toast 10 Titanium and click on create DVD. Then simply drag your files from left to right, follow the instructions and hit “Burn”. That’s it, it’s that easy if you can fork out $75.-. And the program can do much more than just that, check it out.

2) Save some money, have fun (maybe) and learn in the process.

- Hop on the terminal of you Mac and ensure that you have hdiutil. Type hdiutil info and you’ll know what version you have, which should be close to framework 283.

- Create an ISO which you can then burn to the DVD:  hdiutil makehybrid -udf -udf-volume-name DVD -o DVD Directory_of_DVD where DVD is the name of the iso file. This can take several minutes, depending on the length and size of your movie and the speed of your Mac.

- Mount the iso on your Mac by double clicking it and verify that it works as intended.

- Unmount it and burn it to DVD with Disk Utility or your favorite burner.

Track And Parse Twitter Messages Stream

Ever wanted to listen, track and parse tweets from a Twitter stream from an individual user? It’s quite an easy task, if you know the right URL’s to parse. Curl is a great little tool to get sources from almost any web resource and Curl has roots in Linux command like and PHP, just to name a couple.

Let’s look at how this would work by pulling CNN’s breaking news feed as JSON:

curl http://twitter.com/status/user_timeline/cnnbrk.json

or XML:

curl http://twitter.com/status/user_timeline/cnnbrk.xml

That will give you the last 20 tweets in either JSON or XML format.

An even more interesting option is to get messages where you have been mentioned. It’s a bit more complicated, as we need to supply login credentials, but no rocket science either:

curl -u “username:password” http://www.twitter.com/statuses/mentions.json (or .xml if you prefer)

That’ll give you the last few tweets mentioning the user supplied with the curl command. Now all you got to figure out is how to parse the messages and plug them into your application.

Ubuntu 10.10 pre-release preview with TestDrive

Once it gets closer to the official release date of a new version of Ubuntu, I frequently download the latest daily build from the repository and install a fresh version in a virtualized environment, so I can try out and test not only the new OS, but also any software that I am  developing or evaluate to run on Ubuntu.

Jorge Castro from Canonical recently introduced a nifty tool called TestDrive that simplifies the installation process by automatically downloading the ISO and configuring a VM. TestDrive is a command-line tool and it prompts you to select an  ISO image you want to test. It will then download the image, configure and launch a VM. A very neat feature is that TestDrive caches the ISO images and utilizes rsync to update only the items that have changed, this way you don’t have to download the entire ISO again just to test a new daily build.

TestDrive is pretty straight forward and easy to use. The primary goal is to provide a very simple method for allowing non-technical Ubuntu users to test and provide feedback on the current Ubuntu release under development. It supports both KVM and VirtualBox. You can configure your preferred virtualization software, the default ISO caching path, and the default memory configuration by editing the file /etc/testdriverc.

Installation is also straight forward, on Lucid simply call $ sudo apt-get install testdrive. Alternatively download and install it from the project’s PPA and don’t forget to visit its project page on Launchpad.

Moonlight 2 implements Silverlight 2 on Linux

One of the intricate aspects of open source software is in implementing support — where it is even possible to do so — for the wide realm of codecs, formats, and a plethora of proprietary technologies that users have come to rely on. One such technology is Microsoft’s Silverlight framework, which until early this year was not available to Linux users.

This changed in January, when the first version of the Moonlight Project was released, providing Linux users with Open Source Silverlight support. Also included, provided that Moonlight has been obtained via Novell and meets certain other conditions, is a license to Microsoft’s free but closed-source Media Pack, containing codecs needed to decode audio and video streams. Read more »

MySQL – How To Analyze, Repair and Optimize all Tables

Ever come across a situation, where you’d like to check all tables in a database and have them all repaired and optimized? My guess is yes.

In case you didn’t know, there is a helpful MySQL utility called mysqlcheck, available as of version 3.23.38. It does exactly what we need.

To check all tables in all databases for corruption and errors and also fix them in one go, this is your command:

mysqlcheck -u username -p password  –check –optimize –auto-repair –all-databases

mysqlcheck executes statements like CHECK TABLE, REPAIR TABLE, ANALYZE TABLE, and OPTIMIZE TABLE and chooses the best statements for any given operation and storage engine.

Note that the operations complete a lot faster if you can afford to to disable any external services, especially if your database is large.

Installing true-type (ttf) Fonts in Ubuntu

Installing true-type fonts in Ubuntu is an easy task. With literally thousands of free fonts available on the Internet, (from sites such as 1001 Free Fonts or DaFont), who could resist to add that extra spice to their documents or websites.

Ready? Here we go!

First, find and download your desired fonts into ~/Downloads/fonts. You may have to create that directory first. Then extract them and copy to the system fonts directory as follows:

cd /usr/share/fonts/truetype
sudo mkdir customFonts
cd customFonts
sudo cp ~/Downloads/fonts/*.ttf .
sudo chown root.root *.ttf
sudo mkfontdir
cd ..
fc-cache

And that’s it. If you had your favourite graphics program open during this process, you’ll likely need to restart it to see the added fonts.
Have fun!

How to recover a lost Linux root password

Forgot your root password? Nice going. What now? Reinstall the machine from ground up? Sadly enough, I’ve seen this happening all too often while it’s surprisingly easy to change the password knowing the correct procedure. While this doesn’t work in all cases (like if you secured your machine with a GRUB password and forgot that as well), but here’s the procedure in case of a CentOS Linux machine.

Start off by rebooting your system. At the GRUB boot loader screen, move the highlighted entry with the arrow keys to interrupt the boot process. While the current boot entry is highlighted, press E and you can edit the kernel line.

Grub boot loader screen

Grub boot loader screen

Use the arrow key to highlight the line that starts with kernel, and press E to edit the kernel parameters. When you get to the screen below, append the number 1 at the end of the line. This will enable you to boot into single-user mode.

Edit GRUB boot loader entry

Edit GRUB boot loader entry

Next press Enter, then B, and the kernel will boot up into single-user mode. Once there you can run the passwd command, changing the password for user root:

prod-093# passwd
New UNIX password:
Retype new UNIX password:
passwd: all authentication tokens updated successfully

Next time you boot up, use your newly created password to login.

Ubuntu 9.10 (Karmic Koala) beta review

It’s that season again when as usual, Fedora and Ubuntu are prepping up for new releases, with the Ubuntu crew having already released the first beta of Ubuntu 9.10, dubbed Karmic Koala. Although is only a beta release and still needs a bit of polish, there’s plenty to love.

Earlier this year, Canonical announced plans to improve the boot experience, the goal being to get the system up and running smoother and much faster. And Karmic Koala doesn’t disappoint, but the eventual goal of a 10-second startup time will have to wait until Ubuntu 10.04 is released in 2010.

The Ubuntu One client software, part of  the Ubuntu One cloud storage tools, is designed to give you a simple way to backup, synchronize and share files over the web. Ubuntu One offers 2GB of free storage, and a 10GB option sets you back $10/month. Ubuntu One also offers public shared folders that other Ubuntu users can access natively from their PC, while non-Ubuntu users can access them via web browser.

Pidgin messaging client has been replaced with Empathy, something other GNOME distros have done as well. But Empathy isn’t just a new Instant Messaging client. It sports a much-improved framework known as Telepathy. More than just a Pidgin replacement, Telepathy offers video-chat and VOIP support, two things that aren’t even on Pidgin’s roadmap.

If you want to give this new beta release a spin yourself, download is available here. To upgrade from your existing 9.04 version, press “CTL+F2″, then type “update-manager -d”, hit enter and follow the instructions.

Install JSON PHP Extension on CentOs / RedHat

I had numerous requests for info and questions relating to JSON extension in CentOS. To enable these functions in RedHat and CentOs 5, the process is really simple and fast.

NOTE: As of PHP 5.2, json extension is now standard. If you’re running PHP 5.2 or later, or like to upgrade instead, you can skip this!

  1. Ensure you have the necessary dependecies (php, php-pear, php-devel, gcc, make):
    • $ sudo yum install gcc make
    • $ sudo yum install php php-pear php-devel
  2. Use PECL (PHP Extension Community Library) to download the json package:
    • $ sudo pecl download json
  3. Use PEAR (PHP Extension and Application Repository) to extract and install the extension:
    • $ sudo pear install json-1.2.1.tgz
  4. Create a file in /etc/php.d called “json.ini”, and add the following lines:
    • ; php-json extension
    • extension=json.so
  5. Restart apache (gracefully if you’re running a live site:
    • $ sudo service httpd restart (apachectl graceful)
  6. Check for availability by creating an info.php file in the web root with the following line:
    • <?php phpinfo(); ?>
  7. Load info.php in your browser and check for JSON. You now should be all set, but if it doesn’t appear, verify all of the above steps very carefully.
Page 2 of 41234