Posts

Showing posts from 2010

Ubuntu Update Manager's Proxy does not change when system proxy is changed

All efforts to change the Update Manager's proxy come to a grinding halt without any solution. The reason for this fallout is that the proxy is "hidden" at a very safe location. Ubuntu Update Manager's proxy does not change after changing the system-wide proxy or proxy of synaptic program. The reason is that it uses the apt-get's proxy settings. Which can be amended by looking at the /etc/apt/apt.conf file. This file contains the information about proxy servers. Acquire::http::proxy "http://ProxyServerAddress:ProxyServerPort/"; Acquire::ftp::proxy "ftp://ProxyServerAddress: ProxyServerPort/"; This information can be amended to gain direct access to the internet or if the need is to change to a different proxy server. 

The easiest SVN tutorial ever

Browsing through the Internet its extremely difficult to find  the subversion(svn) commands in an instance and be productive immediately. So here is the step by step list of instructions which can be followed to accomplish the most common tasks of svn. We would use the project on Sourceforge named Dr. Java as an example. If the project is already there and you wish to CHECKOUT some code to view here is the command. $svn co https://drjava.svn.sourceforge.net/svnroot/drjava drjava Now if you wish to add new file to the svn repository the command is very simple. For example if you wish to add the text file readme. $svn add README_TEXT The above command will not add it to the server but add it to the schedule. If you wish to view current status of additions, deletions that are scheduled you could use the command $svn status And finally if you are satisfied simple do the following and the commit will be done meaning all the changes will now be part of the repository and a new ver...

MySQL quickest way to look at databases

Looking for MySQL's administration tool is a task. Installing and configuring PHPMyAdmin would take Apache, php and then successful configuration. Then what to do to look at the tables, databases in the fastest possible way to look at tables and execute queries. $ mysql -u username -p the command will prompt for a password mysql> Show databases; mysql> show tables;  The above two commands are extremely useful when one wants to look at the databases installed and tables in individual databases. For example to look at users tables in database drupal the following commands will suffice. mysql> use  drupal6; mysql> select * from users; These commands can be used in both Linux and Windows and are very handy and dont require much to do.

PHP Issue :: preg_split instead of explode function

If the need is to parse a string and extract the words. Then its advisable to use preg_split instead of using the explode function. Code follows : preg_split ("/\s+/",$textInput); where the first argument is the regular expression for finding one or more spaces and the second argument is the input text. This option works far better than the explode(" ", $textInput).

Judging the Joomla Jungle :: The Premier CMS

First experience of using a comprehensive Content Management System (CMS) was Drupal way back some years ago. Before that content management meant either using Front Page or direct FTP of the webpages. Despite "hearing" a lot of good reviews about Joomla never really got the time to explore it. First Steps The first steps towards installing Joomla in Linux are the usual for web servers. Install LAMP (Linux, Apache, MySQL and PHP).  After testing LAMP's successful installation proceed with the following. Download Joomla from the website and follow the instructions given in INSTALL.PHP file in the main folder. Copying the instructions from the php file verbatim here. Copy the folder into www directory of Apache. {verbatim copy starts } First, you must create a new database for your Joomla! site e.g.     $ mysqladmin -u db_user -p create Joomla MySQL will prompt for the 'db_user' database password and then create the initial database files.  Next yo...

Learning Probability via Octave

Image
Probability is a subject which brings everyone sleepless nights. Octave, the MATLAB clone or for some MATLAB wanna-be . GNU Octave is a high-level language, primarily intended for numerical computations. The best way to learn octave is to take a difficult task (or goal) and then start using it. Octave Basics Octave can be installed using the following command in Ubuntu. $ sudo apt-get install octave Once installed octave can be invoked via the command. $ octave Its best to understand the modus operandi of Octave. Like lists are the primary data structures in LISP Language. In octave vectors are at the core.  Vectors are used to store information, manipulate information via vector algebra and display data still using 2D/3D graphics. Applications of octave are huge but we will use probability as a starting point and see how we can learn better probability using the computational and graphical features of octave. Uniform Probability Distribution Unce...

Best web hosting companies :: A futile search without a plan and execution

Web hosting services is a thriving business and new services keeps propping almost daily. Now with every new choice new questions need to be asked. Which web hosting service should I go for? The answer to this question does not lie in any search engine queries but rather lies in a plan. In order to determine the best web hosting companies one needs to have a plan and an execution map. Plan Phase Selection of web hosting service is easier if answers to the following questions can be determined. Why do we need a web hosting service? What is the goal of the website? What will be our needs in the next three years? Which departments in the company are planning to use the website in the next few years? Is our company's business uniform enough to warrant a company-wide website?  How much is the company willing to invest? What is the expected budget of this endeavor? Expected automation needs of the company in the next three years? Calenders, Emails other needs. Maximu...

Why Operating Systems Programming is so difficult?

The character of operating system programming has remained more or less constant over the years. That is a polite way of saying that it is still as scary as ever. Why it is so? Complex system requires complex programming methods and this goes against the spirit of the dictum "Good programs are easier to understand and develop". So can we conclude that system programming being done is bad programming. Or the programmers are not following best practices and all the elaborate methods created to ease programming. Or they are still dealing with a lot of legacy code. Looking at the output "they" are the best talent. Probably its the fact that they are good that they create something so brilliant that nobody can fathom or appreciate. The reality needs to be explored. System Programming So what exactly is operating system programming. Is it really something different from regular programming or its just a subset of programming. System Programming in contras...

Harnessing UML in Ubuntu

Software development was never easy. Software design became extremely difficult with the explosive growth of computers and Internet. Let me accept that I was never a fan of UML. I always believed that software development is an art and the design process is more of an inspiration than a mechanical process of finding nouns and verbs. Patterns, well I thought they were probably the worst creativity-repellents possible. So I was always lousy with UML until I realized that this aversion was compounded due to using MS Visio. Visio probably is the worst place to go to develop UML diagrams. My faith in Visio was developed while using the minimal project management tools  (during undergraduate studies) so when it came to doing UML I simply went ahead and used Visio for Software Design. Not until 2007 did I come out of the dark ages when I used umbrello for the first time. Then i came to realize that the true worth of a UML Drawing tool. The way in which all the diagrams were integrated g...

Overcoming Python in Ubuntu 9.10

Python's rise to power is imminent by claims that Python alongside PHP/ Perl is the "P" in LAMP. This is equivalent to knighthood amongst geeks. Python fascinates developers who are very much conscious about productivity. The first step is to ensure Python is installed so here is the command to do so in Ubuntu 9.10. (Most likely it would already be installed). $ sudo apt-get install python  The first step to testing a language is to write a hello world program. Hello World Program Python's manner of saying hello world to the world is different. Go to terminal and write the following command to invoke python. $ python Once inside the shell. Type print "hello world" and the output hello world will appear. >>> print "hello world" hello world Another way of saying hello from the Python world is via creating a text file and writing the same in it and then saving it say "helloworld.py" and then on the command prompt executing...

Experimenting Java Enterprise Edition (EE) SDK 6 on Ubuntu Linux

Image
Installations Soon after downloading the Java EE on Ubuntu machine through the website the file (~48 MB) called java_ee_sdk-6-web-unix.sh. An attempt to run the shell script resulted in the following error. Could not locate a suitable Java runtime. Please ensure that you have Java 6 or newer installed on your system and accessible in your PATH or by setting JAVA_HOME This requires installation of Java 6 by using the following command (another roughly 55 MB). $ sudo apt-get install sun-java6-jdk Now going back to the Java EE installation through the following command. $ sh java_ee_sdk-6-web-unix.sh Going through the clicks (one has to only write the password for admin account and the proxy if any). Rest of the information is filled in by default. Verifying Installation Now go to the web browser and type the following in the address box. http://localhost:4848 If you changed the value of admin control panel port. Please replace 4848 with the port number you specified during in...

Virtualization :: Old wine in new bottles

Virtualization dates back to the introduction of CP/CMS later renamed IBM VM-370. VM-370 provided two key ingredients. Multiprogramming and extended machine with better interface with the hardware[1]. The recent interest in Virtualization came on the back drop of energy conservation and providing services to users. The explosive growth of the needs of internet and data centers has fueled this renewed interest in Virtualization. Virtualization Software Already have experimented with a virtual machine player VMware Player marketed by VMware Inc. Using this we installed FreeBSD, Ubuntu, Gentoo on top of Windows XP. Whats the next step towards Virtualization? Hypervisor? Hypervisors are of two basic types. Type one are those which provide direct interface between the Guest OS and the hardware. While the type two hypervisor has a host OS onto which the virtualization software is installed and then the guest OS is installed. VMware ESX and GSX are examples of type 1 and type 2 hypervis...

How and where should I change proxy settings in Linux?

PLEASE NOTE THAT IF YOU ARE USING DIRECT CONNECTION TO THE INTERNET THEN THE FOLLOWING POST DOES NOT APPLY. TRYING TO SET THE SETTINGS MAY LEAD TO DISRUPTIONS / DISCONNECTION FROM THE INTERNET. How and where should I change proxy settings in Linux? This is a most frequent question posed by newbie (and not so new) Linux users ? This mountain can be scaled in three steps. Step 1 Using proxy to get simply connected to the internet Just change proxy setting in Firefox and/ or browser of your choice and start using internet. Ignore the rest of urges of Linux to get updates etc and life will be cool and simple. Of course life cannot continue to be so simple. One has to after all install programs etc. Step 2 Adding proxy for system-wide settings Now the next step is to setup proxy for "system-wide" setting. If using GNOME got to the System-> Preferences -> Network Proxy. Typical settings could be ip address/ host name of the proxy server and port name (t...

Linux LAMP raising jinn and exorcising demons

In the early nineties Linux was a hobby, which in the words of Linus Torvalds might never be professional like GNU. It took off and shook the foundations of empires aspiring to bleed every penny by selling server operating system. The contributions of open source community have caused severe headache for software companies. Apache Foundation is one such name. How much does it cost to setup a web server? Around the cost of a LAMP, compare this with the cost of aptly named vamp or is it WAMP?  What jinn did the lamp raise? What changes did it trigger? A very simple question is how come Ethernet and Networks were around in the seventies but it took just a couple of years after Linux for Internet to raise it head? The answers to all these questions is there was no LAMP earlier. LAMP stands for Linux Apache MySQL PHP (Python / Perl).  This is open source combination which gives a head start to web development environment. LAMPs have been around for not very long but the LAMP was...

The LISP-end of the computing

LISP never introduced until very late in school and that too in the form of ONE slide (yes true) one slide. So what is it in LISP that deserves so little concern. Looking at MIT OCW lectures it seems to be THE language of choice. So whats lisp infact? LISP (LISt Processing) is a language where the primary data structure is list and modus operandi is list operations. Step 1:  Installation Installation of lisp on aptitude based package manager (like Debian/ Ubuntu) can be achieved by the following command.  $ sudo apt-get  install clisp Alongside this its recommended to install the HTML version of the book  Common Lisp the language, 2nd Edition by Guy L. Steele Jr. $ sudo apt-get install cltl The book is installed in the /usr/share/doc/cltl/clm/index.html. Step 2: Testing LISP functionality Soon after installation clisp can be tested for functionality. The following sequence of commands test the lisp environment.  To start clisp $ clisp Try out the lisp-...

Why hibernating Linux might be a great idea

Why hibernating Linux might be a great idea? What supports the idea? There are basically two reasons that support this idea. One Linux has traditionally lived up to the billing as premium server class operating system.  Secondly it might strange but Windows has performed much better on Laptop using hibernate option than desktops. The former is a direct evidence support the convention while latter is circumstantial evidence. Since Windows is performing better in spite of it’s not so glorious record otherwise. So Linux can be expected to perform better than Windows because of its better history. The conjecture that server’s better performance can be attributed to the lesser frequent restarts needs to be further investigated but for now we could assume it to be true. Therefore its important to start setting up the hibernate option in the Operating System (be it Windows or Linux on laptop or a desktop). Its very good for the battery life too. Steps for initiating hibernate inUbuntu L...

The Evolution that is Linux

The availability of huge number of Linux distributions is amazing. The primordial soup developed by  Dennis Ritchie and Ken Thompson named UNIX had in it genesis the most amazing OS Multics. The primordial soup gave birth to a phenomenon which resulted in evolution of one beautiful species after another. The rise of Lisa led to Mac. Even the great evil empire acknowledged its superiority by first trying to develop Xenix and when it failed in its attempt to usurp started slowly building in features into its own Windows. A mutation took place in 1991 when Linux Travolds gave birth to Linux. This led to the never ending stream of species. Each and every species had its strengths and weaknesses but every species showed the brilliance and resilience that was present in its initial genes. The Linux of today cannot be compared directly to the MULTICS or even the first UNIX but the design is same providing solid and unbeatable performance. Not only is Linux and FreeBSD holding on to the se...

Linux Newbie : Why I cannot use Latex like those gurus?

Image
Latex is another brilliant Linux / Unix specialty hidden behind the geek facade.  Interesting introduction here {warning PDF file} talks in detail about why and how document processing improves with increase in document complexity. In the words of the author "It is very hard to write unstructured and disorganized documents" . I like the approach but feel that this might attract power users but for newbies its more of the same old school of Linux is for geeks. The purpose is not to criticize the authors. He / she did a great job and deserves credit for this article as well. Now the primary question is how and where to start, following tutorials almost always leads to temporary use. Even students writing thesis in latex only a few would later use it for submitting assignments or other work. The problem is two fold one the students or users are not introduced to latex in a friendly manner rather they use it as if trying to live up to the 'lofty standards' setup by ad...

How to automatically change proxy setting in Firefox ?

Proxy setting for office LAN / WLAN and home LAN / WLAN are often different. Firefox provides an easy method of changing proxies without having to do anything. The file proxy.pac provides an easy method of automatically changing proxy setting in Firefox from one network to another. There are elaborate methods of changing proxy settings given here . However the easiest method is described below. Step 1: Edit the file proxy.pac (preferably save it at a convenient location) and add the following line. function FindProxyForURL ( url , host )   {   return "PROXY proxy.example.com:8080; DIRECT" ;   } Where proxy.example.com  is simply the address of proxy and could be replaced by the IP Address of the proxy server. 8080 is the port address for http in most networks but could be different in some networks. Step 2: Go to Firefox Menu--> Tools --> Options --> Network Tab --> Click Setting Button --> Check the automatic proxy configuration url and ...

Linux Newbie : Why grep almost never yields something productive

Getting Started Level 0 Every Linux newbie hears about power of grep sooner or later. But no sooner does newbie try to use the grep command the experiment ends badly. The reason grep almost never yields anything productive is because of a couple of issues. The basic problem is lack of knowledge of regular expressions and secondly knowledge of switches of grep. This realization should not deter a new user from using grep. A very nice detailed tutorial of regular expression (regex) is available here . The migrating user having used dir and similar commands in DOS and using windows search box almost never expects (nor can fathom) the power provided by grep. Firstly grep means "global regular expression print". Now this means that knowledge of regex is required to be able to use grep effectively . Now what should a newbie do? Wait till user's regex knowledge improves? NO NOT AT ALL. That would scare away the user and never to use grep. Here is the first simple command that ...

The VNC Alternative of using Linux over Windows

A popular method of connecting to Linux Machine is via SSH (Secure Shell). This protocol of exchanging data over secure channel [1]. The beauty of this channel is that it could easily be extended to provide other facilities like SFTP (Secure File Transfer Protocol) or SCP (Secure Copy). One could get hold to a host of small applications from www.ssh.com [2]. Another method to use is VNC (Virtual Network Computing) [3]. Its a desktop sharing method and uses remote frame buffer protocol. The VNC alternative to using Linux over Windows can be used to enjoy Linux while still using Windows distribution. The only constraint is that one has to use an extra machine for Linux but the fact that we don't need to use any monitor, keyboard or mouse with it helps in both ease of use as well as house keeping (tuck away the Linux box under any table in your office and no one will know it exists).  The key to this idea are two simple commands on the two operating systems. Linux Box Step 1: Run ...

Two easy steps to installing Firefox 3.6 in Ubuntu 9.10

Browsing through google results for installing the latest release of Firefox 3.6 and Ubuntu 9.10 seems to be a headache. While it is extremely simple to install. Just go to the www.firefox.com and click install. Go through the motions of downloading and clicking the downloaded archive tar.  Simple is not it !

Two steps to using Assembly in Linux (ubuntu 9.10)

  ⚠️ Update (2026) This article was originally written several years ago and uses older 32-bit Linux assembly methods. While the concepts are still useful for learning, modern Linux systems now use 64-bit architecture by default, and some commands shown below may no longer work as expected.  ✅ Recommended Modern Approach * Use **64-bit assembly (`elf64`)** * Use **`syscall` instead of `int 0x80`**I * Use registers like `rax`, `rdi`, `rsi`, `rdx` 🔧 Quick Working Example (64-bit) ``` section .data     msg db "Hello, world!", 10     len equ $ - msg section .text     global _start _start:     mov rax, 1     mov rdi, 1     mov rsi, msg     mov rdx, len     syscall     mov rax, 60     xor rdi, rdi     syscall ``` 🛠 Compile & Run ``` nasm -f elf64 hello.asm -o hello.o ld hello.o -o hello ./hello ``` --- 📌 Note The original content below is kept unchanged for reference ...

Trial of Ruby in Ubuntu 9.10

 Ruby the pinnacle of OOP a language described as more object oriented than Python and more powerful than Perl by its creator Yukihiro Maksumoto. I set out to test it on my Ubuntu 9.10. Given ubuntu's excellent support and repositiories no wonder not only ruby but also ruby on rails was available in the respositories. I just had to shoot out the following commands. Installation $ sudo apt-get install ruby-full build-essentials $ sudo apt-get install rails $ sudo apt-get install vim-ruby $ sudo apt-get install vim-rails The same could be accomplished via the synaptic package manager in a more graphical environment by selecting System->Administration->Synaptic Package Manager. Then searching for the packages ruby and rails and selecting both and clicking "Apply". Soon after installation I went ahead and wrote the following program to test the ruby language.  The benefit of installing vim-ruby and vim-rails is that it helps in using vi with syntax highligh...

Upgrading Ubuntu from Hardy (8.04) to Karmic Koala (9.10) via Intrepid Ibex (8.10) and Jaunty Jackalope (9.04)

Realized my Hardy (8.04) on the desktop needs upgrading finally. Even though I had decided not to upgrade it until an LTS (Long Term Support) Ubuntu is released. Upgrading from Hardy (8.04)  to Karmic Koala (9.10) is not directly supported so the logical path is to do the following upgrades. Step 1. Hardy (8.04) to Intrepid Ibex (8.10) Step 2. Intrepid Ibex (8.10) to Jaunty Jackalope (9.04) Step 3. Jaunty Jackalope (9.04) to Karmic Koala (9.10) Each step follows similar pattern. $ sudo do-release-upgrade The same could be done via the graphical user interface (GUI) by selecting System ->Administration -> Software Sources , select Updates Tab and from release upgrade combo select  "Normal Releases". Then select System ->Administration -> Update Manager. This is followed by countless mega bytes of download and hope that net keeps connected all along.

Desirable features in a text editor in Linux or Windows

The selection of editor and choice of editors is something Windows users cannot imagine let alone comprehend. Windows comes with at most two text editors and one word processor. Notepad and Wordpad come under the heading of text editors. Wordpad is quite useful in this respect and notepad is very handy. However if one wishes to do any advanced word processing one has to shift to Microsoft Word. No doubt various text editors like TextPad, Emacs for Windows , Vi for windows are available to download. Linux flavors be it FreeBSD, Ubuntu, Solaris, Red Hat,Gentoo or countless others come with host of editors for text editing. What are the features one loves to have in a text editor F-01. EASE of use F-02. EASE of scrolling/ searching text F-03. EASE of editing text F-04 Language syntax highlighting / command menu F-01 EASE of use The best for satisfying F-01 is nano. The reason is that most of the command are very easy to remember moreover the commands mostly needed are continuousl...

Experiment :: FreeBSD on VMware Player on top of XP

Installing FreeBSD on top of XP via VMware Player. The experience is pretty nice until now. Installation steps were pretty simple. 1. Downloaded FreeBSD ISO from the website (http://www.freebsd.org/where.html) 2. Then installed the ISO via VMware Player The first reboot led me to a prompt $ and ability to run various commands. The next step is to install KDE. Started off installing KDE by executing the following command (make install clean) on the command line in the directory (/usr/ports/x11/kde4/). this led to downloading the kde from internet. Then since no proxy was setup therefore an error was encountered. This was solved by setenv http_proxy http://myproxyaddress:8080 . The command line came up easily the only problem was that KDE failed to install and gave the error "undefined reference to vtable projectbuildermakefilegenerator". Trying to figure out what to do with this error. Tried to google, rebuild ports, reload ports and lets see what happens. But overall...

Why nano is still better than Vi? Pine or not ?

One of the classic debates amongst linux geeks is whether Vi is better than emacs and vice versa. I have used all three and personally I like nano. The reason is not functionality richness or any other performance metric but simply the fact that I had been using PICO (Pine Composer) for a long long time roughly five years. Pico was first developed in University of Washington and came along side the famous email program pine (Program for Internet News and Email). The skills developed while using pine to quickly check email and reply via pico have been instrumental in developing this skill set. I performed my data structures, operating systems and networking lab coding in the same pico editor and this lead to my constant hookup with pico. GNU's clone for pico is nano and this does not let me use vi and /or emacs. Even though vi is supremely more effective and productive than nano but history is on nano's side.

Operating Systems Books Review

Last Summer I taught Data Structures and found it to be hardest subject to teach. Before teaching data structures I had either come across freshmen or handled mature students of final year or second half of third year. That was the first time I encountered students of second year (of course I teach Discrete Maths to second year students but that's completely new course) and had to teach them a course which strongly relied on concepts built in the previous course. Artificial Intelligence and elective courses mostly have their own pace and agenda therefore not hard to teach. I am going to teach Operating Systems for the second time. Teaching Operating Systems from Tanenbaum's Modern Operating Systems looks like a cake walk for the teacher but a bed of thorns for the students. The question is how to make it further interesting? The alternate is to use Tanenbaum's book Operating Systems Design and Implementation. This would be complimented by MINIX OS developed by Tanenbaum. ...

VMware Player Gateway to Linux Experience

Recently I got a recommendation to use VMware Player to install linux. Ever since it has grown on me. I have install Ubuntu 9.10, edUbuntu, Ubuntu 7.10 and Gentoo. Especially the way it dynamically uses memory instead of reserving bulk of memory space. If i were to actually partition the hard disk and install all these OS I would have had to give up somewhere between 3GB ~ 30 GB. But now I am only using 11 GB of space. Apart from this benefit another amazing feature is that a separate IP address is available (even when connecting to a DHCP Server). This is not only keeps it clean and simple but also allows interaction with the guest OS via network interface. Another interesting feature is the automatic restoration of the virtual machine state. This feature comes especially handy when dealing with power failures or unintentional closing of the window. The installation steps are pretty much simple. 1. Install VMware Player from the website (http://www.vmware.com/products/player/). ...