Ubuntu: How to change Hostname?

There may be time when you will come across situation when you will need to change the HOSTNAME of your machine. It may be because you might have just cloned your virtual node for load-balancing or may be for any other reason but here is how you can change the HostName of your Ubuntu or Linux machine/node:

On first place how to find out Hostname of the Linux/Ubuntu Machine?

 
# just type in: (All caps are necessary)
$ echo $HOSTNAME
# output might be any name here let's say it is "myubuntu"

Now to change the Hostname of your Ubuntu (or most Linux) machine follow following steps:

 
# open hostname file for editing (either in VIM or your choice of editor be it edit, gedit or nano)
$ sudo vim /etc/hostname
# hostname file will get opened in vim (or vim or your choice of editor)
# update new name and save the file and exit, that's it you're done.
# Sometimes you may also want to edit name of file in hosts file to do that just type in another line at shell
$ sudo vim /etc/hosts
# you will see 2 entries in the file
     127.0.0.1      localhost
     127.0.0.1      myubuntu
# Here change 2nd line which says myubuntu and update it to name of your desire and save and exit
 

That's it you don't need to do anything other than this to change HOSTNAME of your Ubuntu (or linux) system.

Tags: ,

Quick-Start Guide to ADOdb Database Abstraction Library for PHP

PHP (and yes it's for Python too..!) Adodb library has been one of the popular database abstract library since sometime now. We have been using it since sometime for simple operations when we are not using standard framework and probably just serving the plain web-services.

Here is a quick start guide to get started with Adodb5 library when using with PHP to get started with most basic functions for database interactions. For more details one can always browser around and read through detail documentation available at http://phplens.com/lens/adodb/docs-adodb.htm. This is just a quick start guide for all those who just want it little faster to get along with.

How to create adodb connection?

include_once(WEB_ROOT . 'base/adodb5/adodb.inc.php');
 
global $DB;
$DB	= NewADOConnection('mysqli');	
 
$DB->debug = false;
try
{
	$DB->Connect('localhost','root','password','my_db');
	$DB->fetchMode = ADODB_FETCH_ASSOC;
}
catch (Exception $e)
{
	print_r($e);
}

How to Query using Adodb?

Read the rest of this entry »

Tags: , ,

Bootstrap from Twitter goes 2.02

I have been following Twitter Bootstrap project closely since it was announced open-sourced last year and this year it has reached it's version 2.x which is good progress. I have recommended this to my team for couple of projects and had my hands on it for a while.

Today it has grown up to a very mature level where we can use it as a complete web-application UI which is feature-rich with many jQuery plugins and beautiful eye-candy CSS buttons, menu-bar etc.

I think I forgot to mention that it's completely CSS3 and HTML5 framework and you can use it to build mobile web-interfaces too. The forms elements styling offered out of the box are too good (killer...!)

The components which Twitter bootstrap packs in the framework are:

  • Buttons (Yes, they are beautiful out-of-the-box :-) ready to be used)
  • Navigation (packs 3 types of tabs and pills), Navbar, breadcrumb and pagination
  • Labels, Badges and beautiful typography
  • Thumbnails
  • Alerts
  • and Progress-bar

Now you might think that most of the CSS Frameworks will be packing such components, may be even may be more than what bootstrap has to offer but now here comes the real deal it comes with one dozen jQuery plugins integrated - which are just ready to be backed with your next web-application here are to name some of them:

  • Modal (very well integrated with CSS)
  • Dropdown (again beautiful integration)
  • Scrollspy
  • Tooltip (decent)
  • Popover
  • Alerts (removable ones)
  • Button groups, stateful and toggle
  • Collapse (Vertical tabs)
  • Carousel
  • and Typehead (Google Suggest)

Read the rest of this entry »

Tags: , , , , , , ,

Ubuntu 12.04 (Precise Pangolin) Beta2 is released

ubuntu - fast, effective computing for everyone

ubuntu - 12.04

I have been using beta1 release of Ubuntu 12.04 (Precise Pangolin) since last few weeks and I have been trying to setup Ubuntu Server pool for one of my critical application which requires HA (High-Availability) and Load Balancing.

But today I am not going to talk about what I have been building on top of ubuntu but ubuntu precise has come up with new and final development release (beta2) today before production ready release, which will be available on 26th April (probably last week of April 2012).

I am new to Linux but Ubuntu has made my experience so rich (even without any GUI) that I am feeling bad about using Windows so far. Everything seemed so easy with handy commands and world was all here. I fell in love with Ubuntu and I will keep using it for the good.

Now Ubuntu 12.04 Precise has many good features which I am not going to jot down here but you can view that on official posts.

How to upgrade to Ubuntu 12.04 / Precise Beta2 from 11.10 or 11.04 ?

To upgrade from 11.10 you just need to use "sudo apt-get do-release-upgrade -d" and it should take you on ride with precise. Here switch "-d" indicates that you want to upgrade to development release.

How to upgrade to Ubuntu 12.04 / Precise Beta2 from 12.04 Beta1 ?

To upgrade from 12.04 beta1 to beta2 you need to use "sudo apt-get dist-upgrade". I didn't knew that but I came to know once I asked at ubuntu-forums. Read the rest of this entry »

Tags: , ,

Blogs@DiGiTSS is back again..!

New Life

New Life

Hello and Nameste to All Readers,

I would like to apologize as we at DiGiTSS could not keep blogs section vibrant since last 6 months. We have been late in replying comments and there was no new post since more than 6 months now.

We are sorry about that (our silence or inactivity) and with that we are promising that we will make blogs@DiGiTSS more vibrant place and a place where you would love to visit for interests, learning and everything related to programming world. As a major contributor to this blog I would like to share that past few months have been great learning experience for us and we have learned a lot. We experimented, tested and succeeded at many of our technical experiments and we promise to share them with you in upcoming posts.

We understand that it is one's responsibility to keep blog vibrant and should keep it going in favor of blog as well as it's readers, so that readers or visitors have some reason to come back. If one fails to do that the blog will be lost just like any other blog.

Feedback: Please provide your valuable feedback as comments here for us to know that what did you liked most here and what you think we should have been writing about. We really value your feedback and we will make sure that it will be worth sharing your thoughts about your experience with us and we welcome your suggested changes or improvements.

Write for us..! We are looking for Guest Authors:

Read the rest of this entry »

Tags: ,

Implementing Quick Table Search using jQuery filter

Before sometime I had written a post on jQuery case-insensitive expression filter. Now today we will learn about how to put simple filter for our HTML table using jQuery and it's case-insensitive expression.

It's takes just few lines of Javascript / jQuery code to implement quick filter for an HTML table, here you go:

The HTML

 
<label for="kwd_search">Search:</label>
<input type="text" id="kwd_search" value=""/>
<table id="my-table" border="1" style="border-collapse:collapse">
<thead>
<tr>
<th>Name</th>
<th>Sports</th>
<th>Country</th>
</tr>
</thead>
<tbody>
<tr>
<td>Sachin Tendulkar</td>
<td>Cricket</td>
<td>India</td>
</tr>
<tr>
<td>Tiger Woods</td>
<td>Golf</td>
<td>USA</td>
</tr>
<tr>
<td>Maria Sharapova</td>
<td>Tennis</td>
<td>Russia</td>
</tr>
</tbody>
</table>
 

Read the rest of this entry »

Tags: , , ,

Google launched new +1 Button

Google +1 Button

+1 Button

Google has answered Facebook with their newest product in the shelf "Google +1 Button". With this new +1 Button your visitors can promote article, blog post, website or product on your website by simply clicking and +1 Button.

Google's +1 Button is more important and will beat Facebook Like in popularity because it will influence the search result and yes that makes a difference, big time. If you own a website for your personal blog, product or anything and being in search result is important for you, than don't wait to put "this" button on your website. Since it's launch I have seen lot of implementations.

To vote +1 up, user or visitor just need a Google profile/account, a standard one. Till date when I am writing this some of the Google Apps users are not able to use this feature but I am sure it will change in future as Google will migrate them and make all products available to them. For now you might get an error like "Oops... you need a Google profile to use this feature.Google Profiles is not available for your organization."

Placing a Google +1 Button on website is very simple and easy and there are not 2 ways like Facebook had either go for iFrame version of JS and markup. Just include JS and place a <g:plusone></g:plusone> and that's it you're done. There are choice for button size too, so you can choose one which fits your website design and spacing. Refer Google +1 for Webmasters to get started. I am sure no webmaster can afford to dislike +1 Button.

It's kind of Google Friend Connect but not exactly, influence on search results and it's appearance in search result makes the difference. It also shows up all +1d links on a users profile in a separate tab.

Checkout this video to understand Google +1 Button in more detail:

and yes don't forget to +1d Blogs@DiGiTSS if you like our posts. :)

 

Tags: ,

Paying the bills.!