Category Archives: Linux

This category describes Linux related question and it is designed to be used by Suse and Ubuntu users

Creating Ethernet Aliases

If you need to configure more network aliases, you can use the following commands: vi /etc/network/interfaces Add the following lines: auto eth0:0iface eth0:0 inet staticname Ethernet alias LAN cardaddress 192.168.1.101netmask 255.255.255.0broadcast 192.168.1.255network 192.168.1.0 Restart the network service: /etc/init.d/networking restart Now your machine will response also to 192.168.0.101. You can use up to 254 aliases for… Read More »

Modify a file from browser

#! /usr/bin/perl use CGI qw/:standard/; print “Content-type: text/htmlnn”; print “Modify the file:$file<br/><br/>”; $action = param(‘action’); if($action eq “”){ $file_content=””; open (MYFILE, “<“, $file); @lines=<MYFILE>; foreach $l(@lines){ $file_content.=$l; } close (MYFILE); print<<frm; <form action=”modify.cgi” method=”POST”> <textarea name=”file” cols=”150″ rows=”30″> $file_content </textarea> <input type=”hidden” id=”action” name=”action” value=”modify”> <br /><br /> <input type=”submit” value=”Modify!”> </form> frm } if($action… Read More »

Create symbolic link

When you want to create a symbolic link to a certain location all you have to do is ln -s /usr/local/apache/logs ./logs This will create a symbolic link inside current directory: logs which goes to /urs/local/apache/logs Cheers,

Leave a process in background

When you want to close a console, but you want to leave the program which runs active you must run the following commands: Ctrl + Z – this will put the process in background, but in inactive state bg – will activate the process in background If you want to bring it to front fg… Read More »

Show all open ports

When you need to view all open ports from you Linux machine all you have to do is to run the following command in the console: netstat -tulpn Cheers,

Search text inside a file recursively

When you need to search recursively inside a structure of directories you need to run the following command from the console: find /srv -type f -follow -exec grep –with-filename –line-number “apache2ctl” {} ; This will search in every file from every folder from /srv and will show in which file and at each line it… Read More »

Start Apache & MySQL when your Linux starts

If you want to set what programs will start when you boot your Linux machine you must set the Run Levels. A visual way to do this, from OpenSuse 11.0 is: Yast -> System -> System Services (Run Level) -> Expert Mode After this you must enable those services. Cheers,