Archive for the Useful Stuff Category
Redis High Speed Storage Or Cache System
NoSQL databases are the hype, with MongoBD and CouchDB on the forefront, while Memcache has found a place in many high load web applications during the past few years. Each of these applications has their own, very specific characteristic. MongoDB finds its usage where single key-value pairs are not sufficient, but adds a slight overhead and complexity with its hash table like multi field storage architecture. CouchDB is an ideal candidate where single key-value pair storage engine is sufficient.
And there is Redis, the new kid on the block. Redis is a high speed storage or cache system, much like Memcache on steroids. Redis writes data into memory, which makes it really fast. And in contrast to Memcache, it writes data periodically to disk depending on the amount of data that has changed. Redis is been said to be able to handle in excess of 10’000 reads/writes per second! (more…)
Free Version Of Microsoft Word With Office 2010
Microsoft is releasing a new edition of Office to businesses this Wednesday and for the first time it’s adding free versions online versions of MS Word and other programs that work in a Web browser. It’s expected that these free apps will have fewer features than the desktop versions.
MS Office 2010 marks a milestone in the company’s efforts to stay abreast with an shift within the software industry that moves away from programs running locally on computers to free services that can be accessed from any browser over the Internet. Microsoft must walk a fine line and be careful not to make the free applications too appealing as to impact its lucrative software business negatively.
Software accounted for 29 percent of Microsoft’s revenue and 51 percent of its operating income in the most recent quarter.
In contrast to it’s competitor, 4 percent of companies use Google Apps today, according to Forrester Research.
In addition, the Outlook e-mail program will be able to pull in information from users’ outside social networks, such as Facebook and LinkedIn. It also adds new features to tame the ever-growing number of messages in the inbox, including a way to group all replies to a single thread under one line.
How To Install Snow Leopard From USB
Ever been without a DVD/CDROM or installation disk? Especially MacBook Air users undoubtedly come across this situation. This article will explain how to install Snow Leopard from an external device such as USB or disk drive.
You will need an appropriately sized external drive or USB Flash Drive, as the Snow Leopard install DVD’s size is about 6.2 gigabytes. An 8GB USB stick like the SanDisk Cruzer 8GB is the perfect choice.
Now let’s plug in that USB stick and get started.
1. Start up Disk Utility and select your Flash Drive from the left side pane.
2. Select the Erase tab and set Format to Mac OS Extended (Journaled). It should be the first choice in the list. Set Name to Snow Leopard or OS X Install so you can easily keep track of it. Before you the Erase button, be sure that you copied any files or folders from the Flash Drive that you want to keep, as everything will get erased. You’ve been warned! Hit Erase. (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
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
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.
ImageMagick from the command line
ImageMagick is such a cool and powerful tool to manipulate images, it’s a real shame if you don’t make use of it during your web design or photo album creation. From resizing, compositing and converting all types of file types, it’s list of usability cases is endless. It’s free and available for almost every operating system.
If you don’t have it on your system yet, here is the imagemagick download location. You might also have it in your repository, check your package manager as it might be as simple as calling “sudo apt-get install imagemagick” (on Ubuntu) or “sudo yum install imagemagick” (on Red Hat/CentOs).
Here is a small compilation of command-line tools (by no means a complete list). The list of available commands is actually sheer endless, you’ll be amazed by how powerful this application is.
imagemagick resize
convert image.gif -resize 128×128 resized_image.gif
imagemagick crop
convert image.gif -crop 240×360 cropped-image.gif (add’l params for crop location: 240×360+10+10)
imagemagick rotate
convert image.gif -rotate 90 rotated-image.gif
imagemagick mirror
convert image.gif -flop mirrored-image.gif
There are many more, actually way too many to list them all here. Have a look at the official ImageMagick usage page for a complete list of image manipulation actions.
Add Medibuntu Repository for Ubuntu 9.04
Medibuntu is probably the most useful and popular non-included repository, as it contains a lot of codecs for viewing or creating audio and video files. It’s a must have repository for Ubuntu.
- Acrobat Reader
- Firmware for the ALSA sound system
- Google Earth
- DVD decryption
- MPlayer / MEncoder
- Non-free codecs and
- Skype
and the list goes on. Two simple commands get you up and running:
sudo wget http://www.medibuntu.org/sources.list.d/jaunty.list –output-document=/etc/apt/sources.list.d/medibuntu.list
sudo apt-get update && sudo apt-get install medibuntu-keyring && sudo apt-get update
This adds the Medibuntu as a repository and updates the sources list. You can now install software like additional codecs, utilities and more like this:
sudo apt-get install non-free-codecs libdvdcss2
And you can always use Synaptic to install new software, of course. For a complete list, go here.
Ubuntu run script at startup, shutdown or reboot
What’s the proper method to run a script at startup on Ubuntu?
You can use update-rc.d for start-only or stop-only scripts, following these steps:
Start script called “startup_script” on startup (note the dot at the end of the line) :
# update-rc.d -f startup_script start 99 2 3 4 5 .
- start is the argument given to the command (start, stop).
- 99 is the start priority of the script (1 = first one, 99= last one)
- 2 3 4 5 are the runlevels at which to run the script
The dot at the end of the line has significance, read more here: /etc/rcS.d/README
Start startup_script on shutdown and reboot :
# update-rc.d -f startup_script start 90 0 6 .
Stop startup_script on halt and reboot :
# update-rc.d -f startup_script reboot 90 0 6 .
To run the script as a daemon, use the skeleton file located at “/etc/init.d/skeleton”
To know which runlevel you are running, type:
$ runlevel
Read more about runlevels here.
Nginx and memcached module
Memcache is traditionally used as a module inside server side scripts, such as PHP, ASP, ColdFusion and others. And it’s doing a terrific job, as long as it’s implemented correctly.
But if we look under the hood of the actual Memcache application, and I’m not talking about the PHP or ASP extension, but rather the executable that’s running as a daemon under linux, for example, it is a rather simple database like application running in memory. Now there are two basic actions that need to be performed to use it, one is writing info into memcache, the other is reading it. In a typical scenario, there are many reads for one write, that’s the whole point, isn’t it. But what if we can isolate the reading from the server side scripts, and let a small high speed module do that for us.
Create iso from cdrom in ubuntu
I’ve been asked how to extract an iso image from a cd. While there are a few approaches, one is the clean and easy way and that’s the readom way.
- Insert your cd into the drive. If Ubuntu mounts the drive, umnount it
(umount /media/xxx) - Using readom (read only memory), we specify the source device and the target file
(readom dev=/dev/yourcdrom f=/home/user/directory/imagename.iso)
Your drive should spin up and create the iso. Once finished, mount the iso and test it.
That’s it. Happy rippin!
Sync Outlook with Google Calendar
One of the major hurdles for people to move away from Windows is the lack of a true Outlook alternative. The common scenario is you’re using Exchange at work, connecting via Outlook and using features such as email, calendar, contacts, tasks and more. While Evolution (Linux) used to work nicely with previous versions of Outlook, Microsoft made sure to burn that bridge with Outlook 2007.
While there still is no true replacement, there are tools available that make life quite comfortable on Linux/Unix without an Outlook client.
One solution relies on Google Calendar and a small utility that replicates all exchange calendar data to Google. This way, we can also access Google Calendar from anywhere. In my case, I have a running windows pc in the office. This pc is used to replicate Exchange data to Google using Google Calendar Sync.
This litte app replicates changes either way, from Exchange to GCal or GCal to Exchange, or as in my case both ways. In addition, Evolution can exchange data with Google Calendar directly.