About

Information is always Worth to save ...

Wednesday, December 9, 2009

Setup xwin on Windows for Linux Desktop


Configure the SSH terminal like shown on the image.
Now you should have Cygwin installed on your
Windows Machine.
Now Run the below command,

Xwin -clipboard -multiwindow

and on SSH Terminal you can run firefox or any application which will be shown on Windows Machine.

Post a Message to all users - Ubuntu

Using Wall
##########
echo 'Add the Message here' > test.txt
wall < test.txt
Now its been broad casted to all the users who are using the Server

Tuesday, November 3, 2009

Create a list of installed packages

I found out how to do this recently and thought it might be helpful to some people. To output this information to a file in your home directory you would use,
Code:
dpkg --get-selections > installed-softwareAnd if you wanted to use the list to reinstall this software on a fresh ubuntu setup,
Code:dpkg --set-selections < installed-softwarefollowed by
Code:dselect

Thursday, October 15, 2009

scsi-idle script

#!/usr/bin/perl -w
$statfile = "/proc/diskstats";
die "$0: Cannot read $statfile\n" unless -r $statfile;

$| = 1;
($disk, $interval) = (@ARGV);
$disk =~ s,/dev/,,;
print "$0: disk: $disk, interval: $interval\n";

$halted_data = $last_seen = '';
while (1) {
open(STATUS, $statfile);
($_) = grep(/^\s+\d+\s+\d+\s+$disk\s/o, );
close STATUS;

if ($last_seen eq $_ && $halted_data ne $_) {
print "Spinning down: $disk\n";
# system "./scsi-stop /dev/$disk stop";
system "sg_start -stop /dev/$disk";
$halted_data = $_;
}
$last_seen = $_;
sleep $interval;
}

Tuesday, March 31, 2009

Generating a patch

If you need to generate a patch file for a set of file(s) residing in a directory structure or just for one file, then you can use "diff" command. You can find a very nice article in Linux Magazine named "What's the diff?". Basically, this command finds out the difference between two files.

If you want to generate a patch for a directory structure:
diff -rau "old_dir" "modified_dir" > "patch_file"

r: recursive
a: treat all files as text.
u: Output NUM (default 3) lines of unified context.
In case of two file, ignoring -r would be enough.

Sunday, March 1, 2009

Removing ^M characters in Unix

Its quite simple to do,but its pain when this stops the whole process of automation or development
If foo is the code in which you want to remove ^M
the command you just need is
cat foo | col -b > foo_update

or you can use dos2unix tools also,but the above case is when you dont have access to the dos2unix tools

Sunday, January 18, 2009

changes on mysql and php

When I installed php and mysql.
I wanted to run drupal through it..So i came through some hurdles...
The notes for that ..
1.mysql -u root -p
-->gave the password (*****4*)
Now created a database named drupal and gave complete access to the user

2.mysql>create database drupal;

3.mysql> GRANT ALL PRIVILEGES ON *.* TO 'sree'@'localhost' IDENTIFIED BY '*****4**' WITH GRANT OPTION;
So Now I should be able to Install drupal on my desktop...
but came with one more problem related to the PHP

"Fatal error
: Allowed memory size of 16777216 bytes exhausted (tried to allocate 117327 bytes) in /drupal/drupal-6.9/includes/cache.inc on line 105"

So to fix this we need to change the php files with drupal

i.e
1.vim drupal/sites/default/settings.php
added the ini_set('memory_limit', '16M');
and am not sure abt adding below line but i added it.
php_value memory_limit 16M
in your .htaccess file in the Drupal root folder

-sree

Apache webserver

TO Run a apache webserver from Home.

1.apt-get install apache2
2.Change the Document root directory on /etc/apache2/sites-available/default
3. a2ensite default
4. apache2ctl graceful

Now its ready to restart the apache2, which can be tested on browser with localhost.

Webserver options

I wanted to Run a Webserver from my home.
So first thing for that to happen in this open source platform is

1.Create a dyndns account with somethin like ****.homelinux.com
2.Edit your Router settings for dyndns account
3.Edit the router to have your desktop a staticIp and complete pass through of the http traffic.

which will let you have the access to the public domain from your desktop,Now The main requirements are having Lamp server on your desktop ..If its Ubuntu...

Saturday, January 17, 2009

install LAMP server,Mysql

To install Lamp server on Kubuntu
We can use tasksel util.
So jus type
sudo tasksel install lamp-server
or Individually install packages with
sudo apt-get install apache2 php5-mysql libapache2-mod-php5 mysql-server

But doing so gave me some errors in mysql also.
for example errors like
invoke-rc.d: initscript mysql, action "start" failed.
dpkg: error processing mysql-server-5.0 (--configure):
subprocess post-installation script returned error exit status 1
Errors were encountered while processing:
mysql-server-5.0
E: Sub-process /usr/bin/dpkg returned an error code (1)


To solve these
sudo su
aptitude purge mysql-common mysql-server
aptitude install mysql-server

Permission Error while Running Apache webserver

I am Trying to Run a apache webserver on My linux Box.
when I try to do that.
I came up with an issue like

Forbidden

You don't have permission to access / on this server.


Apache/2.2.9 (Ubuntu) Server at localhost Port 80

But after going through some internet research, I came to know that the document Root doesnt have permissions according to the apache configuration.
So I changed the file "/etc/apache2/sites-available/default"
As like

Options Indexes FollowSymLinks MultiViews
AllowOverride None
Order allow,deny
allow from all


Which gave me the access to the public as well as able to run the server
after changing this you just need to do

/etc/init.d/apache2 restart


Sunday, January 11, 2009

Expedition towards Ubuntu


I bought a Desktop Dell to use it for My personal Fun,Development and blah..blah...
When i bought this Dell Studio Desktop,It has Vista.. But As I am rigorous linux user,I wanted to install Linux in to it.I tried Suse, Fedora Since I am using Ubuntu at Office,I wanted to have different Linux at Home..

So I tried different OS's and finally decided to use Ubuntu8.10..The reasons might be..
1.I am used to ubuntu.
2.Better Hardware access than others.
3.Easy to resolve the issues with Open source Community.
4.Easy to install drivers,plugins since all of them are reachable 
5.Wireless drivers...Its damn easy to setup the b43 firmware 

My desktop details are
1.Dell Studio Mini Tower Core 2 Duo Processor E7300
2. 2.66 GHZ,1066Mhz FSB and 4Gb Ram
3.Broadcomm Bcm ethernet/wireless card