Category: Technology


You may want to install and use Classic Gnome on your Ubuntu PC, unlike Ubuntu 11.04 the classic gnome desktop is no longer installed as an alternative to the new Unity desktop. I thought I’d quickly share how installed it on my Ubuntu 11.10 development machine, which now enables me to use either Unity or the Gnome Classic desktop enviroment.

So using the terminal, install the gnome-session-fallback package like so:-

sudo apt-get install gnome-session-fallback

So to now use your the newly installed Classic Gnome desktop enviroment simply logout and then use the gear icon just above the username box to change the desktop session to ‘Gnome Classic’.

All done!

Ok well I’ve not posted on here for a while, mainly due to the fact that life has been so hecktic and I’ve been getting myself far too involved in too many different things..

So thought I’d better update you all with some info etc.

Well the last week I’ve managed to do a whole load more coding to the main framework of ZPanelX, I’ve now implemented the modular hook system, this enables module developers to ‘hook’ into core parts of the framework and execute their own code from inside their module/controller.ext.php file.

As well as the hook system, the daemon is now fully complete and I’ve spent the last few days implementing XMWS which stands fro ZPanelX Modular Web Services. XMWS is an XML based web service layer for ZPanelX which enables module developers to rapidly develop web service components within their module.

Luckily I have about 8 days off work in total over Christmas and the new year so I managed to get a lot of coding on ZPanelX done and dusted :) – Hopefully not much will come up between now and spring and ZPanel X will be released on time :)

It looks very nice too!

Recently we have all seen Google change its web user interface from the old very basic buttons  and text  (which it carried for years) to a more fluid design which I think is great (although I will miss the simple controls that Google used to use :) )

So for historical purposes I thought I’d quickly take a screenshot and share it with the web for years to come ;) – Before the new interface becomes default and they turn off the old version permanently!

This is the old Gmail interface style (screenshot taken 2nd November 2011)

This is what the new interface looks like..

 

Today is a sad day for many people, it is today that the world lost a true technology guru and an icon.

I have spent a short amount of time reading many of the nice words that many other big technology people have said about him over at wired.com.

Up until about 4 months ago except for an iPod I never personally owned an Apple computer but recently I went out and purchased an iMac (I am writing this post from it now, see one of my earlier posts on my blog for a photo :) ). I decided to buy an iMac as its simple to use, whilst robust and is a truly lush piece of hardware (I love the design and raw metal look) anyway, that is besides the point.

I thought that it would be foolish of me not to at least attempt to pay tribute to Mr. Jobs.

I was so pleased to see Sergey Brin (co-founder of Google inc.) was actually typed this from his MacBook..

“From the earliest days of Google, whenever Larry and I sought inspiration for vision and leadership, we needed to look no farther than Cupertino. Steve, your passion for excellence is felt by anyone who has ever touched an Apple product (including the macbook I am writing this on right now). And I have witnessed it in person the few times we have met. On behalf of all of us at Google and more broadly in technology, you will be missed very much. My condolences to family, friends, and colleagues at Apple.”

It just goes to show how many people use Apple products and what a true impact Steve has had on so many peoples lives.

My thoughts go out to Steve’s family and extended family over at the big Apple family.

Rest in peace Steve, you truly are one in a billion!

Well I know there are a lot of tutorials on the internet regarding the installation of Git server on Ubuntu but I thought I’d try to ‘KISS’ (Keep it simple stupid!), most of the tutorials are full of non-nessacery information and quite often don’t go into detail (or at least explain in an easy to follow way) about why we set it up this particular way.

In this tutorial I plan to explain in an easy to follow way a proven method of installing Git to host Git repositories on a Ubuntu Server.

Installing Git
This needs to be done on the server and also on your workstation, these instructions however need to be run on the server logged in as ‘root’ user – or use ‘sudo’ but I do it under ‘root’ personally.

sudo apt-get install git-core

Installing Gitosis
Gitosis seems to be the ‘trendy’ way for easy configuration of Git servers, so we’ll install that now too.. So we’re going to use Gitosis which needs python and a python setup tool to get running. Grabbing the python setup tool in Ubuntu will grab all the requirements if you don’t already have them:

sudo apt-get install python-setuptools

Now that we have python and the python setup tools installed we need to ‘clone’ the gitosis software (as that is the standard way to grab it, we are grabbing it from a git repository :) ) – So what we are doing now is creating a temporary folder called ‘src’ of which we will be using to store the gitosis code.

mkdir ~/src
cd ~/src
git clone git://github.com/res0nat0r/gitosis.git

Now what we do is install it (Gitosis) using the python setup tool we grabbed earlier.

cd gitosis
sudo python setup.py install

Setting security…
We’re next going to add a new user called git. This is the guy that will do all the heavy lifting for us!

sudo adduser –system –shell /bin/sh –gecos ‘git version control –group –disabled-password –home /home/git
git

IMPORTANT: If you have locked down ssh, don’t forget to go into your /etc/ssh/ssh_config file and add git to the list of Allowed Users that can login. That list of users is separated by a space not a comma.

I always encourage the use of public/private key exchange and in the case of gitosis it looks to be required. Generate a key if you haven’t already. See instructions for public/private key here. I’m going to assume that from this point on you can access your server from your local machine using a public key exchange!

Next, copy your id_rsa.pub file over to your server somewhere (in our example we’re using /tmp) and then run this command:

sudo -H -u git gitosis-init < /tmp/id_rsa.pub

You’ll see output like this:

Initialized empty Git repository in ./
Initialized empty Git repository in ./

We’re now done with the server config; from your local machine, test it out with this:

git clone git@YOUR_SERVER:gitosis-admin.git

If all went well you have a gitosis-admin directory with a gitosis.conf file and keydir directory. We’re basically setup now. We just need to create a new repository and push it to the server.

Config Gitosis for a new project (repository)

Use your favorite editor to create a new block under the gitosis one. It should look like this:

[group myproject]
members = ballen@Bobs-iMac.local
writable = myproject

A couple of things to watch out in the above block. First, make sure your name matches what’s in your public key (that is, open your id_rsa.pub file and see that what the name says. Mine says ballen@Bobs-iMac.local so that’s what I have above. Yours will be different.) Second, make sure you spell writable correctly!

Once you’re done, commit and push the changes up to the server.

git commit -a -m “created a new repository!”
git push

What we’ve basically done in this step is configured gitosis to accept a new repository. We then submitted that new configuration to the server using Git itself. Genius!

Put your local code under version control.
Now that the myproject project is waiting for us on the server let’s go put it under version control on our local machine.

cd myproject
git init

As you may have heard, most of the goodness with git is in a special hidden .git directory at the root of your project. That’s pretty cool since it means removing your project from version control is as simple as erasing that directory. Way easier than subversion.. especially if something goes wrong..

If you’re a Rails developer you may want to blacklist some things from being under version control. Open up a text editor and create a file called .gitignore in the root of your project directory. Fill it up with this goodness:

.DS_Store
log/*.log
tmp/**/*
config/database.yml
db/*.sqlite3

Designate the server as a remote repository.
An interim step here is to remote add the files to the server we set up previously. Honestly I’m not sure what’s going on here under the covers but it’s necessary..

git remote add origin git@YOUR_SERVER:myproject.git

Add files and commit!
Let’s add everything to git, (note the trailing dot) and then push your initial commit to the server.

git add .
git commit -a -m “initial import”
git push origin master:refs/heads/master

Once that’s done you’re done! You can grab your code from any place that has public key access to your server using this command. – You’ll need to ensure you add the contents of the public key to the /etc/authorized_hosts file to allow access to the Git server (Don’t add any extra lines etc.).

git clone git@YOUR_SERVER:myproject.git

Adding additional repositories are as easy as adding another block to the gitosis-admin.conf file and then initialising it using the above method.

Hope you enjoyed this tutorial, much of the content came from this forum post, I have tested and ensured that it is working perfectly in Ubuntu Server 11.04 and added extra information where I have felt it is necessary to explain certain things.

Well I haven’t blog’d for a month so thought I’d better update you all with what’s been going on recently…

Well I decided to give GitHub a try out (I’ve had an account registered on the site and I reserved the ZPanel project name) but haven’t yet given it much of a try-out but as I released the latest version of Zantastico I decided that I would use Github to host the source and maybe I’ll now make the complete jump from SVN to Git for all my source control needs :) – I must say, Github is very cool indeed (once you get your head around how the permissions work and adding your machine keys etc.). The web interface offers some lovely features that allows you to edit code from the browser and will automatically revision it too :)

Also over the last month, I decided that I needed to upgrade and combine my home server’s, I went and bought a Netgear ReadyNAS Duo off Ebuyer… It was knocked down in price a little and thought ‘well why not…’ – It been great, it has some lovely in built features of which not all I am using but comes with DLNA media streaming services, Built in torrent client, APF shares compatible with Apple TimeMachine as well as all the standard NAS protocols.. SMB, CIFS, FTP, RSYNC etc. – I’m really pleased with it, I currently have a single 250GB drive with all my data on it but will be upgrading it 2x 2TB drives which will create a RAID1 mirror. :)

After a long time of meaning to install Rustus’s BIND module for ZPanel 6.1.1 on my CentOS VPS (used for hosting this site and many of my friends personal sites too) I was really impressed.. Rustus is one of the best module developers that I have seen and has produced several third-party modules for ZPanel. I am especially impressed with the DNS module due to how it handles the the ZONE files and how much effort has gone into creating this module. It really is a must for any persons running ZPanel 6.x.x as it is such a time saver… No more logging into UKReg (my domain registrar) to manage my DNS records now… :)

Lastly, not that you are interested… This weekend I went to go and try on a suit for my mums wedding, she is to be married on the 1st of October 2011 and my brother and myself will be giving her away as my beloved grandfather passed away in 2006. Here is a photograph of the awesome suit with me in it (it has ‘tails’ too but the photo isn’t all that good) :)

Until next time… :)

Well yesterday I made one of the biggest purchases I have to date (not far behind my house, car etc)!! I have many computers in my house and have owned many computers over time but nothing beats the awesomeness of Apple’s hardware design! – I forked out and bought an iMac (the most expensive computer I have personally owned! :) ) and first one that I have not built myself…

Check out this beauty..

Unline many linux distrubutions FreeBSD by default disables ‘root’ login over SSH (at least it does with FreeBSD 8.2), If you do need to enable remote root logins over SSH this simple blog post will show you what you need to do; the more secure way of gaining remote admin access to your server would ideally be logging in as an alternative user and then using SUDO to perform any administrative tasks.

Firstly, You will need to edit the SSH daemon configuration file to enable this like so..

ee /etc/ssh/sshd_config

Find this line:

#PermitRootLogin no

and change it to:

PermitRootLogin yes

Basically you should have removed the hash ‘#’ from the start of the line (uncomment the line basically) and then change ‘no’ to ‘yes’, save the file and then restart the SSH daemon like so..

/etc/rc.d/sshd restart

…and your done, you should now be able to login as ‘root’ over SSH on your FreeBSD server!

In this easy to follow tutorial I will show you how to install Apache, PHP and MySQL on FreeBSD, I have used FreeBSD 8.2 in this tutorial but should work for at least a couple of release’s later.

I will be installing the software using FreeBSD ‘Ports’ you can also install software on FreeBSD using the pkg_add system but this is not covered in this tutorial!

First of all we make sure that you have the latest snapshot of the FreeBSD ports collection, do this by running:-

portsnap fetch

and extract the infomation like so..

portsnap extract

If you already have the ports setup, you can just run portsnap update instead..

First up we are going to install MySQL, so lets begin with logging into your FreeBSD server and running this command:

cd /usr/ports/databases/mysql55-server

make BUILD_OPTIMIZED=yes BUILD_STATIC=yes

make install clean

The first command above changes the current directory to the MySQL server ports folder, the next adds some build parameters and the last command installs and cleans up any debris :)

Now we want to add MySQL as part of the startup process so when the server re-boots the MySQL daemon will run..

Open /etc/rc.conf with your editor and add the line shown below to enable starting mysql server on boot.

mysql_enable=”YES”

Now to start MySQL for the first time run this command:

/usr/local/etc/rc.d/mysql-server start

We need to now set a password for the MySQL root user by executing..

/usr/local/bin/mysqladmin -uroot password ‘new-password’

MySQL is now installed and ready to be used!

Now we need to install and configure Apache..

cd /usr/ports/www/apache22

make install clean

..again, lets add Apache to the system startup process in the same way that we did for MySQL..

apache22_enable=”YES”

Thats it, the basic Apache22 package is now installed!

Now we install PHP5 and configure it for use with Apache..

Go to the php5 port directory by typing the command:

cd /usr/ports/lang/php5

Build and install the port by typing

make install clean

Make sure the APACHE (Build Apache module) option is ticked when configuring the build

cd /usr/ports/lang/php5-extensions

make install clean

Now, copy the default PHP.ini file so we can use it for our new installation..

cp /usr/local/etc/php.ini-dist /usr/local/etc/php.ini

Edit your Apache configuration file (/usr/local/etc/apache22/httpd.conf) and add this:

AddType application/x-httpd-php .php
AddType application/x-httpd-php-source .phps

in the DirectoryIndex add the php extentions like:

DirectoryIndex index.php index.html

Edit the Languageconfiguration file (/usr/local/etc/apache22/extra/httpd-languages.conf) and add the following lines:

AddDefaultCharset On

Ok, now lets start Apache for the first time..

/usr/local/etc/rc.d/apache22 start

Your all done! – You should now have a fully working AMP install on your FreeBSD 8.2 server :)

Well I thought I’d document how you can mount a SAMBA share on a Linux Server (in my case Ubuntu Server), I possibly have a project coming up soon where I may need to mount a Microsoft Windows based shared folder for additional storage/shared storage across multiple Linux/UNIX based web application servers.

Firstly you must make sure that your server/PC has the smbfs package installed, on Ubuntu you can install like like so..

sudo apt-get install smbfs

Once you have checked that you have that installed or installed it if your PC or server on which you want to mount the drive on then you can continue to the next step..

In this example I will be connecting to the following Windows Shared folder (\\myserver\data) and I will be mounting it on my linux server in /mnt/remote-data/.

If the folder ‘/mnt/remote-data/’ does not exist you will firstly need to create this folder like so..

sudo mkdir /mnt/remote-data

Now you can mount the Windows Shared folder like so..

sudo mount -t cifs -rw -o username=ballen,password=yourpassword //myserver/data /mnt/remote-data

If you then want to unmount the remote shared folder, you can enter the following command:

sudo umount /mnt/remote-data

You can also view all your current mounts like so:

sudo mount -l

I hope this helped some people, you can mount anywhere on your OS for example, you could mount the ‘music’ shared folder in your home directory like so…

sudo mount -t cifs -o username=ballen //myserver/music /home/ballen/Music

…but just remember that the folder needs to exist upon which you want to mount on :)