Ubuntu How to Change Color Linux Directory Listings

Here’s another change I automatically make when installing a new Linux Ubuntu Server.
I’m using Bash prompt, and that’s the standard prompt for all Debian (Ubuntu, Mint, etc…) installations, so the chances are that you are using Bash too.

Problem:
The standard default color scheme for Linux directory listings (when you type in ls at the linux prompt) is hard to read. If you’re using putty on a Windows machine to connect to a linux server, the color scheme is dreadful. The deep blue is simply illegible for me.
Continue reading “Ubuntu How to Change Color Linux Directory Listings”

How to Make Streamripper Save UTF8 Filenames

I’m assuming you came here because you are already using Streamripper on the command line.
This fix is for those who rip streams with filenames that are not the basic character set (Not English).

If you are seeing ripped file names that look like this øòåú çï – áùãä éøå÷.mp3 then here is the solution:

On the linux command line, use the following directive:
Continue reading “How to Make Streamripper Save UTF8 Filenames”

Ubuntu Server Setup – Top 5 things to do on the First Day

You’ve just unwrapped your new Ubuntu server running on Ubuntu 12.04 LTS and now it’s time to roll up your sleeves and get started. What should you do first? Here’s a checklist of the top things I do for each new Ubuntu server that I install.

Let’s approach it from two ways:
– You’re working with a managed network provider like Rackspace, etc… or
– You’re doing it yourself on AWS as a new EC2 instance (Similar to managed, with some caveats).

You have your server credentials and have logged on to your server with a SSH connection. You are staring at your command prompt and are ready to begin…
1. Check your server to make sure you got what you wanted

Are the drives partitioned right? Do you have any space on /var to work?

df -h

What release are you running? The current (as of 2/13) latest LTS version of Ubuntu is 12.04.x

lsb_release -a

2. Update your copy of distribution files.

sudo apt-get update

This will make sure that as we get started installing new software, we’ll have the latest and greatest of everything.

3. Install The LAMP stack ([Linux], Apache, MySQL, PHP) We’ll want to throw in phpmyadmin here as well. In case you aren’t familiar, phpmyadmin is great for setting up database permissions and general DB management from within a browser-based GUI.

sudo apt-get install lamp-server^ phpmyadmin

Answer Yes to the prompts as it installs each of the requested programs in the LAMP stack. You’ll need to pick out a password for MySQL and then confirm it. Later you’ll be asked for a password for phpmyadmin. Use the same password, it will make things easier for later. (You can always change your password later from within MySQL or PhpMyAdmin.

4. Install htop
htop is essentially “top” on steroids. It gives you a good visual picture of your server’s load and what processes are running. It’s sort of like the baby monitor of servers.

sudo apt-get install htop

5. Setup a test web page
You’ve installed apache, so you can test that everything is set correctly. Go to your default web root directory /var/www (this can be changed later, and we’ll show you how to do that in our next blog in this series)

cd /var/www

Now, edit the file index.html and put in some text that identifies it as your new server.

sudo vi /var/www/index.html

(or .php, or .htm depending on your configuration)

Now start or reload apache to make sure everything is running right.

sudo service apache2 reload

After you’ve saved the file, you can go to a browser window and type in your server ip address. You should see your temporary index page that you just created/edited.

Next…
Configuring Apache, setting up cron jobs, rsync to synchronize with multiple servers, setting up MySQL database connectivity, and more…
Check out our other blog posts on these topics.

Ubuntu Server – How to Sync Files Between Multiple Web Servers

Another installment in our How to Set up an Ubuntu Server Series:

Synchronizing multiple servers – You have more than one web server in your host configuration. What’s the easiest way to synch files among the multiple web servers?
Solution – rsync does the trick efficiently and easily.

This tutorial assumes you are comfortable on the linux command line.

Steps to Set up rsync for multiple servers synchronization:

Step One

First make sure rsync is installed on each server that you’ll be working with.  By typing rsync from a command prompt, you should get the rsync response asking you for parameters.  If rsync isn’t found, then install it.

sudo apt-get install rsync

Step Two

Test synchronizing files.  From a command prompt on your 2nd server, type in an rsync command to retrieve files from the 1st server.  Let’s assume you have a directory /var/www/ set up on both servers and you wish to synchronize the files from the first server to the 2nd. The first server acts as the master.  Any new files or changes to existing files on the master will overwrite existing files on the 2nd server.  Type in from the command prompt on server 2

sudo rsync -ra user@FirstServerIP:/var/www/ /var/www/

The first server in this example sends all the files in /var/www/ along with the (-r) recursive subdirectories. You can also sync only specific files, etc…
If this works, you are ready to move on to step 3. If not, check your connectivity with the FirstServer. Generally, if you can ssh to another server, you should be able to rsync with it as well. AWS EC2 Users If you are using AWS Amazon’s ec2 servers, which require a passkey, the rsync command will look like this:

rsync -rave “ssh -i /home/ubuntu/.ssh/passkey.pem” ubuntu@EC2ServerIP:/var/www/ /var/www/

Note that for AWS EC2, you will first need to copy your passkey over to your .ssh directory

Step Three

Next, let’s set this up to synchronize all the time automatically. We accomplish this with a cron job. Here again, we’re assuming you are familiar with how to set up and edit crons. From your root user (sudo su) edit your crontab

crontab -e

Then, add a line to the crontab that tells it to run the rsync command every minute (or any frequency that suits you).

* * * * * rsync -ar FirstServerIP:/var/www/* /var/www/

Test your configuration!  Go to your first server and make a change or add a file to the synchronized directory. Then go back to the 2nd server and see if the file is there. You can replicate this process to as many servers as you need, but keep in mind that frequency of sync and amount of data passing on your internal network can get costly and cause a hit on performance.

I hope this little tutorial was helpful.  Please drop me a note if you have any questions or comments.

 

Increase Contrast VIM editor color scheme

Problem:  Low contrast VIM on SSH and Telnet

If you work over SSH or telnet on VIM (VI) text editor, then you are probably experiencing a low contrast page that’s very hard on the eyes.  I searched all over the net and VIM’s wiki but didn’t find a fix.

Solution: Change setting in VIM’s config file

Continue reading “Increase Contrast VIM editor color scheme”

Easiest Way to Have a USA IP Address

Free and Legal Method for Acquiring a Reliable USA IP Address For Testing and Surfing While Outside the USA.

Q. You’re located outside the USA and need to test what your website looks like to your USA visitors.  What’s the easiest way to accomplish this for free an without pesky and unstable ip cloaks and expensive ip proxy address forwarders.

A. If you have a server already located in the USA, all you need to do is to connect via SSH to your server with a port tunnel and then configure your browser to access all non local internet connections through that port.

Step by Step Guide to SSH Tunnel:

Continue reading “Easiest Way to Have a USA IP Address”

Puppy Linux – Puppy Arcade 5 Super Fast Game Emulator

Puppy Arcade – Have your Puppy Linux and Play Games too (with awesome speed)!
We’ve been singing the praises of Puppy Linux (Review) for some time now. We love to hear about applications and new ways to use this great and fast linux distribution.

Scott Jarvis sent us info on his just released Puppy Arcade 5, a Puppy Linux flavor with a retro video game emulation based on TurboPup Xtreme (arguably the fastest Puppy derivative). Thanks to Scott, you can now download the Puppy distro along with a ton of game emulators. These tiny game emulators, such as Amiga, Atari, Nintendo, and many others, are very suitable for a compact distro like Puppy. Many of the emulators were written over 20 years ago, but they still serve up a good time. This is an especially great experience for those of us who lived through the “Frogger” days.

Download & Installation
Continue reading “Puppy Linux – Puppy Arcade 5 Super Fast Game Emulator”

Parted Magic 4.8 – Linux Partitioning Recovery Tool. Screenshots & Review

Overview
Ever need a quick and free tool for accessing a non-responsive computer?   Have you wanted an easy way to partition multiple drives with a simple graphical tool?  Do you like running Linux from RAM? If you answered yes to any of the above questions, you’ll want to give this nifty tool a closer look.
Parted Magic has an extensive (but not exhaustive) collection of file system tools. The top features set on their website includes:
Format internal and external hard drives. Move, copy, create, delete, expand & shrink hard drive partitions. Clone your hard drive, to create a full backup. Test hard drives for impending failure. Test memory for bad sectors. Benchmark your computer for a performace rating. Securely erase your entire hard drive, wiping it clean from all data. Gives access to non-booting systems allowing you to rescue important data.

Installation
Parted Magic is available on Source Forge which is linked from their website Download Page.
This handy tool comes in several flavors and can be installed from a CD, USB drive, PXE, and as a Grub tool. We took the iso file and installed it on a Live CD. The filesize was ~72MB and downloaded very quickly (from Sourceforge).

Parted Magic
Parted Magic Desktop

First Impressions
Parted Magic booted without a hitch and almost instantly.  The welcome screen offers several choices, including (our selected method) running the entire tool in RAM. The RAM load took about 20 seconds and the CD was ejected. Our Linux machine was now running in RAM and was super-de-duper fast. It felt like sitting in a Porsche. You know something good is going to happen.

The desktop is clean and spartan. There are no applications installed other than what you’ll need for file and disk management. The desktop does include a menu with quick access to all the available tools, and a terminal shell for command line queries.

We tested some disk management and format tasks, and even checked the installed memory on the host computer.  Parted Magic was fast and worked flawlessly.

Installed Applications

Parted Magic includes an assortment of tools to make your disk partitioning and file management go as painlessly as possible.  Installed tools include the partitions editor, and a smart control utility that really takes out the guesswork in salvaging or partitioning drives.  I liked the nice mounted devices display window for easy control of which drives should be mounted in any session.  Check out the gallery of screenshots below for a recap of all the installed tools.  The main menu includes these sub menu categories:  graphics, internet, system tools, and accessories.  Parted Magic also includes GPic View, for quick graphics and images viewing.

Screenshot Gallery


Conclusion

As we say for all our best distro reviews, unless you have the marketing muscle of RedHat or Novel, or the grass roots popularity of Ubuntu, if you want to stand out among the many dozens of available distros, you really need to have a niche.  Parted Magic serves a niche, and it does it’s stated job marvelously.  The installation and running of Parted Magic worked flawlessly, and super-fast.  If you have disk formatting or testing tasks and you can’t accomplish them from your already installed OS, Parted Magic is the way to go.

Google Chrome Beta for Linux Released

Good news for those of us who have been using Firefox as a last resort in our Linux machines. Google has announced the beta release of the mouch-touted browser for the Linux platform. Chrome is said to be faster and lighter than Firefox.

I’ve been using Chrome in pre-beta for quite some time without incident. It is a great step forward for Linux!

For more details and how to get your copy, check out:
http://www.google.com/chrome/intl/en/w00t.html