Virtualbox offline SSH with guest OS

Even you are not connected to any network, you still can ssh your guest os from your host using this simple trick. I’m using Virtualbox as my virtualization technology.

 

1. Open Settings for your vm

2. Select Network tab

3. Click Port Forwarding

4. Add new rule with this details


Name : offline-guest-ssh
Protocol : TCP
Host IP : 127.0.0.1
Host Port : 2222
Guest IP : 10.0.2.15
Guest Port : 22

5. Connect to your guest os using this command

ssh -p 2222 root@127.0.0.1

Advertisements

Apache2 on Ubuntu 14.04 LTS

Ubuntu 14.04 comes with latest Apache 2.4 version (at this writing time). There are some changes on Apache configuration and directory structure from previous version. This post will helped you on installation and virtual host configuration on Ubuntu server.

Install Apache2

sudo apt-get update

sudo apt-get install apache2

Once the installation finished, check installed Apache2 version

apache2ctl -v

you can then fire up your browser and point it to http://localhost to see your Apache2 default page

DocumentRoot

Apache2 use /var/www/html as its default DocumentRoot folder. This is where we put all our html file in order for Apache2 to server it to the world. However, we can use different DocumentRoot folder by configuring VirtualHost

VirtualHost

VirtualHost allows Apache to host multiple sites using different domains and DocumentRoot. Two most important configuration files for VirtualHost are :

/etc/apache2/sites-available

contains all virtual hosts document root configuration

/etc/apache2/sites-enabled

contains symlinks to related virtual host configuration file inside /etc/apache2/sites-available directory to tell apache to enable those virtual host to public/world

Example

In this example, we’ll create a new virtual host site accessible by http://www.yadayada.com from our localhost browser.

Create new folder for our new virtual host named yadayada.com

mkdir /var/www/html/yadayada.com

Create our new virtual host configuration file

sudo vi /etc/apache2/sites-available/yadayada.com.conf

Add the following configuration into yadayada.com.conf

ServerAdmin admin@yadayada.com
DocumentRoot /var/www/html/yadayada.com
ServerName http://www.yadayada.com
ErrorLog /var/log/apache2/yadayada-error.log

Tell Apache to enable our new virtual host configuration. Create symlink

cd /etc/apache2/sites-enabled

sudo ln -s ../sites-available/yadayada.com.conf

Restart Apache for changes to take effect

sudo service apache2ctl restart

We need to override our server to use localhost loopback 127.0.0.1 ip for http://www.yadayada.com. We can achieve this using /etc/hosts file

sudo vi /etc/hosts

add this line

127.0.0.1 http://www.yadayada.com

Open your browser and point it at http://www.yadayada.com

Yadayadaaaaaaaa….you should see your virtual host index page in your browser

Codeigniter pagination

CodeIgniter’s Pagination class is very easy to use, and it is 100% customizable, either dynamically or via stored preferences.

Sometimes when we clicked at the pagination number, the numbers still pointed at current page although it shows correct data. This happened because CI will take uri segment 3 as default pagination referrence. To customise CI to read the correct URI segment pagination :

$config['uri_segment'] = 4;

Now CI will recognise uri segment 4 as page referral. Pagination navigator will highlighted to the correct page when you click it now.

Happi pagination 🙂

Linux Graphical SVN Tools

rabbitvcs is like tortoisesvn

For those windows user that are familiar with TortoiseSVN (windows GUI for SVN) now there is similar tools for linux lovers : RabbitVCS.

Install in your Ubuntu with :

add rabbitvcs repository in your source
karmic & lucid
sudo add-apt-repository ppa:rabbitvcs/ppa

hardy, intrepid, jaunty
sudo vi /etc/apt/sources.list
deb http://ppa.launchpad.net/rabbitvcs/ppa/ubuntu **DISTRIBUTION** main
signing key is: 1024R/34EF4A35

refresh our sources
sudo apt-get update

now RabbitVCS showed up in your Ubuntu Software Center.

SVN – Subversion

To manage our code in team development environment, we need a tool called version control system (vcs). One of the most used is Apache SVN.
It is a web based subversion which you can browse it using your web browser.

To install it in ubuntu (lucid) :

sudo apt-get install subversion libapache2-svn

next, we create out subversion repository

sudo svnadmin create /svn

edit our enabled apache2 module

sudo gedit /etc/apache2/mods-enabled/dav_svn.conf

add this at the end of the file

DAV svn
SVNPath /path/to/your/svn
AuthType Basic
AuthName "Subversion Repository"
AuthUserFile /etc/apache2/dav_svn.passwd
Require valid-user

create user for your repository

sudo htpasswd -cm /etc/apache2/dav_svn.passwd your_username

restart apache server to take effect

sudo /etc/init.d/apache2 restart

access your newly created repository using web browser

http://server/svn

Now your subversion repository server is ready to use

*to enable your user to commit to your repository, change permission to apache

sudo chown -R www-data:www-data /svn

some useful svn command for newbies HERE

impress!ve – the Chuck Norris of presentation software

Just use your PDF file as presentation and give it some Chuck Norris kick with Impress!ve. Impressive is a program that displays presentation slides. But unlike OpenOffice.org Impress or other similar applications, it does so with style. Smooth alpha-blended slide transitions are provided for the sake of eye candy, but in addition to this, Impressive offers some unique tools that are really useful for presentations.

It was written in Phyton, a feature-rich interpreted scripting language. Using Phyton platform independent makes this Impressive works on any machine including M$, Mac and Linux

Using Ubuntu:

sudo apt-get install impressive

Present it using :

impressive -t PageTurn presentation.pdf

For more information : CLICK HERE

Installation CVS – Ubuntu Jaunty

as root

sudo apt-get install cvs

sudo apt-get install cvsd

*when prompted for repository location type: /myrepo

sudo cvsd-buildroot /var/lib/cvsd

sudo mkdir /var/lib/cvsd/myrepo

initialize the repository
sudo cvs -d /var/lib/cvsd/myrepo init

sudo chown -R cvsd:cvsd /var/lib/cvsd/myrepo

create a user and password
sudo cvsd-passwd /var/lib/cvsd/myrepo +username

change authentication method
sudo vi /var/lib/cvsd/myrepo/CVSROOT/config

-uncomment SystemAuth=no

to prevent connection refused
sudo vi /etc/cvsd/cvsd.conf

– change Listen * 2401 to Listen 0.0.0.0 2401

restart cvsd
sudo /etc/init.d/cvsd restart

test ur installation
cvs -d :pserver:username@localhost:/myrepo login

.