Category Archives: Linux

Setup A Hosted Git Repository With Gitolite

Git LogoGit has gotten a lot of hype recently, especially among smaller development teams and contractors, for its flexible, distributed environment, ease of use and while Subversion is the old kid on the block, there are pros and cons for each. This article assumes that you already know the intrinsics of the different version control systems and you’ve decided that Git is for you.

Gitolite is a package that allows us to host our repositories using one dedicated user that has restricted access to the host OS and provides access to the source code.

The following steps helped me successfully install and setup Git on a Ubuntu Server 11.04, install gitolite to host my Git repositories and allow secure access over SSH. I’ve not tested other Linux versions, but assume it should be very similar.

The basic steps include:

  • Create User
  • Generate SSH keys
  • Install Git
  • Install Gitolite
  • Administer Gitolite

Read more »

Linux jobs get more demand

Linux logoLinux Foundation director Jim Zemlin, has some advise for Linux world professionals. He was as of late quoted saying, “Linux’s increasing use across industries is building high demand for Linux jobs despite national unemployment stats.

Linux.com reaches millions of Linux professionals from all over the world. By providing a Jobs Board feature on the popular community site, we can bring together employers, recruiters and job seekers to lay the intellectual foundation for tomorrow’s IT industry.”

Current requirement is for 8,000 Linux-based technical jobs. Unix is being replaced by Linux in a fast pace and most of todays devices run on a changed version of Linux kernel from servers, HDTV desktops to supercomputing data centres. Read more »

Apache Prefork Vs Worker Threads

Apache Worker ThreadsWe often get questions like: What is the difference between Apache Worker Threads vs Prefork? Is it bad to have the values the same configuration? Is it bad to have them different?

In this quick article we like to shed some light between the two modules and assess in what given circumstance, certain os and application would call for which solution.
Read more »

Best Free Beat Making Software

Beat Making Software Beat Making can be a great way to earn money and build a career in the music industry. Up to now, you only had a couple of options when it came to selecting a beat maker.

The first was to pay a high price for high priced high end equipment.  The other option was to get affordable software that you could afford, but made beats that sounded like crap.
Read more »

Ubuntu 11.04 Natty Narwhal with Unity UI

Ubuntu 1104 Natty NarwhalApril and October are the months where Canonical releases new versions of their OS Ubuntu. And that means it’s time for a new Ubuntu release now, with what may be a ground-breaking user interface and major changes from previous versions that come together nicely.

Ubuntu code named Natty Narwhal, or version 11.04 is here and sporting some radical changes from previous editions of the Linux distro. The most distinguished being the arrival of the Unity desktop environment, which was previously relegated to netbooks. It has integrated search, a combination of launcher and a taskbar, and app menus that have been moved to the top of the screen much like in Max OS X, effectively implementing the best ideas from Apple and Microsoft and a new design. Read more »

Firefox Extensions For Web Developers

Firefox LogoWith the release of Firefox version 4 last week, we thought it’s time for a fresh list of most powerful Firefox extensions for web developers. Even though couple of our mentions are not yet compatible with this latest release, we’re convinced they’ll be available in no time.

While release 4 also includes some HTML 5 enhancements, we like to see some new extensions to help developers with canvas, forms, local storage and other new features in the future.

In case, we mean just in case you don’t have Firefox yet, you can get it here.

FireBug

Javascript debugger, live DOM & CSS inspector and so much more. The de-facto single greatest web developer add-on for Firefox.

Web Developer Toolbar

Another great developer tool and addition to FireBug, adds a toolbar with powerful web developer tools at your fingertips.

Live HTTP Headers

As you browse, view live HTTP headers of any page loading in real time.

ColorZilla

An advanced eyedropper, color picker, page zoomer and various colorful goodies.
Read more »

Enable Digest Authentication In Apache

Auth Digest

Digest Authentication

Basic http authentication in Apache (mod_auith) has been available for a while, but one major downside still exists, which is the exchange of plain text user name and password information over a possibly unsecured network.
That is where Apache Digest Authentication takes over and provides us with MD5 encrypted values, using the mod_digest apache module.

Here are the steps to create a password file to store all account information, install the apache module mod_auth_digest and the necessary configuration parameters to enable security of our restricted area.

Create Account file

For digest authentication we need to use a utility called htdigest, unlike with basic authentication where we used htpasswd. The application takes the file name, realm and username as arguments, then prompts twice for the user’s password. The flag -c creates a new file, it overrides the existing one if exists. Read more »

Access Dropbox From Linux Server Command Line

DropboxSharing files between VM’s can be a pain, especially if your VM is running on a text based server without UI. For example, I start up a new VM for almost anything and I deal with up to 20 different sites and application and every one has it’s own VM.

VMWare provides it’s “Guest Additions” and that includes folder sharing. It works fine on desktop os’s, but on the command line we have to mount it using VMWare’s file system, which can be a bit cumbersome. A much simpler and easier way to share files is via USB or DropBox. Getting the DropBox sync daemon to run is really easy and once running, anything you add to DropBox will be synced to your VM transparently and at network speed.

If you don’t already have a DropBox account setup, get a free one here. Now on to the steps to get the sync daemon up and running.

Steps:

SSH to your Linux server and change to your home directory.
cd ~
for 32-bit os:
wget -O dropbox.tar.gz “http://www.dropbox.com/download/?plat=lnx.x86″
for 64-bit os:
wget -O dropbox.tar.gz “http://www.dropbox.com/download/?plat=lnx.x86_64″
After the file “dropbox.tar.gz” downloaded properly, then extract it
tar -xvzf dropbox.tar.gz Read more »

How To Clone A Virtual Machine In VirtualBox

Moving, cloning and modifying Virtual Machines and their associated Virtual Hard Disks in VirtualBox has been no easy task and to make matters worse, are poorly documented at best. In this guide, we’re using VirtualBox 3.2.10 r66523 running on Ubuntu 10.10 64bit host operation system.

Merge Snapshots

Merge all snapshots that we want to be included, delete the ones we don’t want. Unless we do this, we only get the base version and loose all changes contained in those snapshots.

Run VBoxManage

Using VBoxManage clonevdi to copy the virtual hard disk to a new VDI file. The basic syntax is: VBoxManage fullPathTooldVdiFile fullPathTonewVdiFile. We need to ensure that a hard disk with that name does not already exist, otherwise we’ll get errors.
VBoxManage clonevdi /data/VirtualMachines/Windows7.vdi /data/VirtualMachines/Windows7_clone.vdi

Add Disk To Virtual Media Manager

We’ll add the new created hard disk to the Virtual Media Manager. This step ensures that the hard disk has been properly cloned, has the proper permissions and that there are no conflicts with other disks and virtual machines. In VirtualBox, select File -> Virtual Media Manager -> Add and select the cloned file, in our case Windows7_clone.vdi. If there are no errors, we should now see the hard disk listed among the others and are ready to proceed with the new Virtual Machine.

Create new Virtual Machine

In VirtualBox, select Machine -> New  and proceed with the steps to create a new Virtual Machine. At the point we we select a hard disk, click existing and select our new disk.
Start up the new Virtual Machine and change hostname in /etc/hostname and eventually the network configuration in /etc/network/interfaces.

Setup Puppet to configure your network servers

Growing companies at some point are faced with the increased workload to setup, configure and maintain their servers and applications. Administrators try to script repetitive tasks and ultimately look for solutions that are scalable and provide a central management tool base. There are several software packages available, commercial and open source ones.

Puppet is probably the most used open source configuration management package available today and more system administrators and software developers are interested in setting it up within their environment. An excellent book about Puppet (Pulling Strings with Puppet) is available and so are numerous online articles and tutorials. However, lots of online resources are just not quite complete and can lead to lots of frustration, especially in the setup and configuration of Puppet.

So here is another step by step tutorial about how to install and setup Puppet to the point where we can run a simple recipe residing on the server (puppetmaster) and execute on the client. For this illustration we’ll install Puppet on Ubuntu 10.10 using a deb package.

Configure Network and DNS

Setting up configure hostnames on server and client is crucial. Since Puppet uses self signed certificates to secure communication, it’s essential that network is setup properly and hostnames are configured with fully qualified domain names.

Let’s open /etc/hosts and add the necessary entries. (note: If you use a DNS server in your network, those setting changes should be made on your DNS server and not the hosts file)

 Read more »

Install and configure puppet server (puppetmaster) on Ubuntu 10.10

Before installing and configuring puppet server (puppetmaster), ensure that your network is properly setup. Configure Puppet Server on Ubuntu 10.10 is easy and straight forward. It’s those subleties about the network configuration and necessary puppet recipes and files that can make our lives miserable.

To install Puppet, choose one of the following methods (we will use the Ubuntu Package)

Using package manager of your distro

  • RPM (Fedora) for Red Hat, Fedora (puppet-server for server, puppet for client)
  • DEB (Debian) for Ubuntu, Debian (puppetmaster for server, puppet for client)

Installing from source: (note: you will need to have Ruby installed on your system prior to installing Puppet)

  • download the latest version from puppetlabs
  • # tar -zxf puppet-0.xx.x.tgz
  • # cd puppet-0.xx.x
  • # ruby install.rb
  • # puppet –version (to verify installation)

Using Ruby Gem: (note: you will need to have Ruby and Ruby Gem installed on your system prior to installing Puppet)

# gem install –remote –source http://reductivelabs.com/downloads puppet

Read more »

Install and configure Puppet Client on Ubuntu 10.10

After we have configured our network and installed, configured and verified our Puppet Server (puppetmaster), it’s now time to install our first puppet client and configure it to receive a signed certificate and puppet recipes. If you haven’t performed those pre-requisite setups, please start with Setup Puppet to configure your servers.

Let’s first install puppet from the ubuntu package:

# apt-get install puppet

Then we start our client

# puppetd –server puppet-server01.example.com –verbose  –waitforcert 60

A peak at /var/log/syslog confirms our request for a certificate: Creating a new SSL certificate request for puppet-client01.example.com
And the same log on the server should contain: puppet-master[617]: puppet-client01.example.com has a waiting certificate request

If this state on the server is confirmed, it’s time to sign the certificate on the server:

# puppetca –list (and again we should see the hostname of our client that has requested the cert)

# puppetca –sign puppet-client01.example.com

We should get confirmation as such: notice: Signed certificate request for puppet-client01.nextpt.com. Anything else or errors will likely point towards network and/or dns configuration issues.

If you have followed our tutorial on how to setup puppetmaster, you should now have htop installed on your client. Also check /var/log/syslog for additional info.

Finally we should enable puppet to start on reboot. We do this by editing /etc/default/puppet and set START=yes.

Install Redmine using Passenger via Apache on Ubuntu 10.04

Installing Redmine on any system has been a daunting task for many, especially work thru countless dependencies and linking apps to make the application available via Apache. Since Ubuntu 10.04, Redmine can now be installed via apt or aptitude, and no doubt the process is much easier, but by no means just as straight forward as we’re used to.

To get Redmine up and running over Apache on Ubuntu 10.04, these basic steps are required:

  1. Install Apache2, Mysql Server, Subversion, extensions and utilities
  2. Install Redmine via apt
  3. Test Redmine using Webrick
  4. Install Passenger

1. Install Apache, Mysql Server and necessary extensions and utilities

$ sudo apt-get install build-essential apache2 apache2-threaded-dev apache2-suexec-common libapache2-svn libmysqlclient15-dev

2. Install and configure Redmine

$ sudo apt-get install redmine redmine-mysql subversion

Read more »

Using Regular Expression In PHP – The Basics

regular expressions cookbookRegular expressions are a powerful tool for finding, examining and/or modifying text. Regular expressions themselves are, with a general pattern notation almost like a mini programming language, allowing you to define and parse text. They enable you to search for patterns within a string, extracting matches flexible and precise. However, you should note that because regular expressions are more powerful, they also suffer from added overhead and are slower than the more basic string functions. You should make careful consideration and only use regular expressions if you have a particular need.

PHP supports two different types of regular expressions: POSIX-extended and Perl-Compatible Regular Expressions (PCRE). The PCRE functions are more commonly used, are more powerful than the POSIX ones and faster as well

In a regular expression, most characters match only themselves. For instance, if you search for the regular expression “foo” in the string “only a fool does not use regular expressions” you get a match because “foo” occurs in that string. Some characters have a special meaning. For instance, the dollar sign ($) is used to match strings that end with the given pattern. Similarly, a caret (^) character at the beginning of a regular expression indicates that it must match the beginning of the string. Characters that match themselves are called literals while characters that have special meanings are called metacharacters. Read more »

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.

Page 1 of 41234