Archive

Posts Tagged ‘linux’

Top 20 CSS Editors for Linux!

December 28th, 2009 madiga No comments

For CSS editing, you basically need a text editor that’ll perform syntax highlighting for a cleaner and more organized look. By default on Linux, there aren’t that many editors that are CSS friendly but we’ve dug around and compiled a good list of ‘em.

In this article, I have listed 20  great CSS editors available for Linux.

  1. Cream / Vim – Cream is a version of Vim that makes Vim easy to use. It nicely highlights CSS syntax, HTML. It is also rovides a simpler route to learning vim the easy way.
  2. Quanta+ – a highly stable and feature rich web development environment. The vision with Quanta has always been to start with the best architectural foundations, design for efficient and natural use and enable maximal user extensibility. Excellent editor for CSS and HTML.
  3. CSSED – a small developer editor and validator, that tries to ease the CSS editing. It is an Open Source project, it means that you can download the program but also its source. It features syntax highlighting, syntax validation, MDI notebook based interface, quick CSS properties and values insertion, auto-completion and dialog-based insertion of CSS complex values.
  4. Gedit - The official text editor for GNOME. A simple and efficient editor for CSS/HTML editing, and does syntax highlighting.
  5. SciTE – Runs on Windows as well. Also another great editor for development such as CSS.
  6. jEdit - jEdit is a mature programmer’s text editor with hundreds (counting the time developing plugins) of person-years of development behind it. Written in Java, works on Windows, Mac OS and others. Another great editor for CSS and other languages.
  7. BlueFish – Has many great features. Supports editing of PHP, Javascript, HTML, CSS and so many others.
  8. Screem - a web development environment. It’s purpose is to increase productivity when constructing a site, by providing quick access to commonly used features. While it is written for use with the GNOME desktop environment in mind it does not specifically require you to be running it, just have the libraries installed.
  9. Kate – Another web development editor on KDE. Supports most languages.
  10. Nvu – A complete Web Authoring System for Linux desktop users as well as Microsoft Windows and Macintosh users to rival programs like FrontPage and Dreamweaver.
  11. CSS Briefcase – a little program that helps you organize your CSS styles and store them for use in future projects. Just add CSS style code you tend to use in several projects, and from then on, adding the code into new projects is as easy as selecting the styles you want and clicking a button.
  12. Redbox13 – Web-based application that helps create any type of file in your native language. It helps categorize your CSS elements, compress CSS files, and remove useless white space. It has an independent function library that you can use to parse CSS files to three-dimensional PHP arrays. It can be used to identify and remember color codes. It offers a solution to browser incompatibility problems.
  13. jsCSSEditor – a Cascading Stylesheet (CSS) editor (WYSIWYG/Context) written in JavaScript and PHP.
  14. CSSmerge – Not exactly an editor but it can be very useful. It extracts selected blocks of CSS from one or more input stylesheets, and merges them into a single coherent output stylesheet, with optional comments on where they came from, and warnings about conflicting styles.
  15. DHTML Windowing Toolkit – a cross-browser JavaScript/CSS library for the creation of inline DHTML windows to contain content. These windows can be opened, closed, moved, and resized much like native windows.
  16. Bash Blogger – a shell script that generates CSS styled XHTML 1.1 static Web pages.
  17. Eclipse WTP – THE Open Source IDE, the Web Tools Project extends support for many markup languages, JavaScript and CSS.
  18. Emacs CSS Mode – a simple Emacs mode for editing CSS style sheets. It adds font-locking and some basic auto-indentation support to Emacs. It works with Emacs 19.34, but should also work with both older and newer versions as well as XEmacs.
  19. Nedit – a multi-purpose text editor for the X Window System, which combines a standard, easy to use, graphical user interface with the thorough functionality and stability required by users who edit text eight hours a day.
  20. <oXygen/> CSS Editor – allows you to edit and validate the CSS files. Different CSS profiles are supported like CSS2, CSS3, etc. and different media types like Braille or screen for instance. You can also choose the verbosity level of the validation warnings. The content completion provides property values associated with the property name. All the property names are annotated with descriptions from the CSS specification.
Categories: linux Tags: ,

The Ultimate Linux Reference Guide for Newbies

November 24th, 2009 madiga 2 comments
The Ultimate Linux Reference Guide for Newbies
Click Here to download the Ultimate Linux Guide PDF!
FILE AND DIRECTORY BASICS This cateogry also includes utilities that change file/directory properties and permissions
ls List files/directories in a directory, comparable to dir in windows/dos.
ls -la Shows all files (including ones that start with a period), directories, and details attributes for each file.
ls -lSrh Find the biggest files in current directory in human readable format.
cd Change directory (e.g cd /usr/local/bin)
cd ~ Go to your home directory
cd - Go to the last directory you were in
cd .. Go up a directory
cat Print file contents to the screen
cat filename.txt Print the contents of filename.txt to your screen
du -kx | egrep -v “\./.+/” | sort -n Find largest directories in the filesystem.
tail Similar to cat, but only reads the end of the file
tail /var/log/messages See the last 20 (by default) lines of /var/log/messages
tail -f /var/log/messages Watch the file continuously, while it’s being updated
tail -200 /var/log/messages Print the last 200 lines of the file to the screen
head Similar to tail, but only reads the top of the file
head /var/log/messages See the first 20 (by default) lines of /var/log/messages
head -200 /var/log/messages Print the first 200 lines of the file to the screen
more Llike cat, but opens the file one screen at a time rather than all at once
more /etc/userdomains Browse through the userdomains file. hit Spaceto go to the next page, q to quit
less Page through files
od View binary files and data
xxd Also view binary files and data
gv View Postscript/PDF files
xdvi View TeX DVI files
nl Number lines
touch Create an empty file
touch /home/burst/public_html/404.html Create an empty file called 404.html in the directory /home/burst/public_html/
file Attempts to guess what type of file a file is by looking at it’s content.
file * Prints out a list of all files/directories in a directory
cp Copy a file
cp filename filename.bak Copies filename to filename.bak
cp -a /etc/* /root/etc/ Copies all files, retaining permissions form one directory to another.
cp -av * ../newdirectory Copies all files and directories recurrsively in the current directory INTO newdirectory
mv Move a file command
mv oldfilename newfilename Move a file or directory from oldfilename to newfilename
rm delete a file
rm filename.txt deletes filename.txt, will more than likely ask if you really want to delete it
rm -f filename.txt deletes filename.txt, will not ask for confirmation before deleting.
rm -rf tmp/ recursively deletes the directory tmp, and all files in it, including subdirectories.
chmod Changes file access permissions. The set of 3 go in this order from left to right: USER – GROUP – EVERONE 0 = — No permission 1 = –X Execute only 2 = -W- Write only 3 = -WX Write and execute 4 = R– Read only 5 = R-X Read and execute 6 = RW- Read and write 7 = RWX Read, write and execute
chmod 000 No one can access
chmod 644 Usually for HTML pages
chmod 755 Usually for CGI scripts
chown Changes file ownership permissions The set of 2 go in this order from left to right: USER – GROUP
chown root myfile.txt Changes the owner of the file to root
chown root.root myfile.txt Changes the owner and group of the file to root
stat Display file attributes
grep Llooks for patterns in files
grep root /etc/passwd Shows all matches of root in /etc/passwd
grep -v root /etc/passwd Shows all lines that do not match root
ln Create’s “links” between files and directories
ln -s /usr/local/apache/conf/httpd.conf /etc/httpd.conf Now you can edit /etc/httpd.conf rather than the original. changes will affect the orginal, however you can delete the link and it will not delete the original.
wc Word count
wc -l filename.txt Tells how many lines are in filename.txt
find Utility to find files and directories on your server.
find / -name “filename” Find the file called “filename” on your filesystem starting the search from the root directory “/”.
locate filename Find the file name and path of which contains the string “filename”. Run ‘updatedb’ to build index.
rename .html .php *.html Rename all *.html file as *.php
for file in *.html ; do mv $file `echo $file | sed ’s/\(.*\.\)html/\1php/’` ; done Rename all *.html files as *.php
Of course this is more work than previous command…why bother.
find . -uid 320 -exec chown 350 {} \; Change all files with uid 320 to 350.
For all real life find examples check out:

http://johnmeister.com/CS/UNIX/FIND/find-usage.html

EDITORS Most popular editors available on UNIX platforms.
pico / nano
Friendly, easy to use file editor
nano /home/burst/public_html/index.html Edit the index page for the user’s website.
vi Popular editor, tons of features, harder to use at first than pico.  Check out So you want to learn VI?
vi filename.txt Edit filename.txt.
All commands in vi are preceded by pressing the escape key. Each time a different command is to be entered, the escape key needs to be used. Except where indicated, vi is case sensitive.  H — Upper left corner (home)
M — Middle line
L — Lower left corner
h — Back a character
j — Down a line
k — Up a line
^ — Beginning of line
$ — End of line
l — Forward a character
w — Forward one word
b — Back one word
fc — Find
c ; — Repeat find (find next c)
:q! — This force quits the file without saving and exits vi
:w — This writes the file to disk, saves it
:wq — This saves the file to disk and exists vi
:LINENUMBER : EG :25 — Takes you to line 25 within the file
:$ — Takes you to the last line of the file
:0 — Takes you to the first line of the file
emacs Another popular editor. For more commands go to http://www.hsrl.rutgers.edu/ug/emacs_qref.html C-\ t — Tutorial suggested for new emacs users. C-x C-c exit emacs
emacs filename.txt Edit filename.txt.
While you’re in emacs, use the following quickies to get around:
C-x C-f — read a file into emacs
C-x C-s — save a file back to disk
C-x i — insert contents of another file into this buffer
C-x C-v — replace this file with the contents of file you want
C-x C-w — write buffer to specified file
C-f — move forward one character
C-b — move backward one character
C-n — move to next line
C-p — move to previous line
C-a — move to beginning of line
C-e — move to end of line
M-f — move forward one word
M-b — move backword one word
C-v — move forward one screen
M-v — move backward one screen
M-< — go to beginning of file
M-> — go to end of file
sed ’s/Today/Yesterday/g’ infile > outfile Replace all occurance of ‘Today’ with ‘Yesterday’.  Yes days go by so quickly.  Today is already yesterday.  Heck it maybe a few years ago since I’ve written this.
cat file | awk '{NR >=5 && NR <= 10 }' Print out each line between 5 and 10.
NETWORK Some of the basic networking utilities.
w Shows who is currently logged in and where they are logged in from.
who This also shows who is on the server in an shell.
netstat Shows all current network connections.
netstat -an Shows all connections to the server, the source and destination ips and ports.
netstat -rn Shows routing table for all ips bound to the server.
netstat -an |grep :80 |wc -l Show how many active connections there are to apache (httpd runs on port 80)
netstat -lnp Display all open ports with service name.
top Shows live system processes in a formatted table, memory information, uptime and other useful info. While in top, Shift + M to sort by memory usage or Shift + P to sort by CPU usage
top -u root Show processes running by user root only.
route -n Shows routing table for all ips bound to the server.
nslookup yahoo.com Query your default domain name server (DNS) for an Internet name (or IP number) host_to_find.
traceroute yahoo.com Have a look how you messages travel to yahoo.com
ifconfig Display info on the network interfaces.
ifconfig -a Display into on all network interfaces on server, active or inactive..
ping Sends test packets to a specified server to check if it is responding properly
tcpdump Print all the network traffic going through the network.
arp Command mostly used for checking existing Ethernet connectivity and IP address
SYSTEM TOOLS Many of the basic system utilities used to get things done.
ps ps is short for process status, which is similar to the top command. It’s used to show currently running processes and their PID. A process ID is a unique number that identifies a process, with that you can kill or terminate a running program on your server (see kill command).
ps U username Shows processes for a certain user
ps aux Shows all system processes
ps aux –forest Shows all system processes like the above but organizes in a hierarchy that’s very useful!
kill terminate a system process
kill -9 PID Immediately kill process ID
killall program_name Kill program(s) by name. For example to kill instances of httpd, do ‘killall httpd’
du Shows disk usage.
du -sh Shows a summary of total disk space used in the current directory, including subdirectories.
du / -bh | more Print detailed disk usage for each subdirectory starting at the “/”.
last Shows who logged in and when
last -20 Shows only the last 20 logins
last -20 -a Shows last 20 logins, with the hostname in the last field
pwd Print working directory, i.e., display the name of my current directory on the screen.
hostname Print the name of the local host. Use netconf (as root) to change the name of the machine.
whoami Print my login name.
date Print or change the operating system date and time
time Determine the amount of time that it takes for a process to complete + other info.
uptime Show the number days server has been up including system load averages.
uname -a Displays info on about your server such as kernel version.
free Memory info (in kilobytes).
lsmod Show the kernel modules currently loaded. Run as root.
dmesg | less Print kernel messages.
man topic Display the contents of the system manual pages (help) on the topic. Do ‘man netstat’ to find all details of netstat command including options and examples.
man -k ssh Search all man pages for keyword ’ssh’
reboot / halt Halt or reboot the machine.
mount Mount local drive or remote file system.
mount -t auto /dev/fd0 /mnt/floppy Mount the floppy. The directory /mnt/floppy must exist.
mount -t auto /dev/cdrom /mnt/cdrom Mount the CD. The directory /mnt/cdrom must exist.
lsof +D /nfs/mount Return process id of all tasks currently utilizing /nfs/mount directory.  Useful when you’re stuck trying to unmount an NFS mount.
lsof -p <pid> See EVERYTHING that process is doing.  What files are opened, what port it’s listening to and etc.
cat /proc/cpuinfo Display cpu details such as make, model etc.
sudo The super-user do command that allows you to run specific commands that require root access.
fsck Check a disk for errors
COMPRESSION UTILITIES There are many other compression utilities but these are the default and most widely utilized.
tar Creating and Extracting .tar.gz and .tar files
tar -zxvf file.tar.gz Extracts the file
tar -xvf file.tar Extracts the file
tar -cf archive.tar contents/ Takes everything from contents/ and puts it into archive.tar
gzip -d filename.gz gzip -d filename.gz
zip Compress files into.zip
unzip file.zip Extracting .zip files shell command
compress Compress files. compress filename
uncompress Uncompress compressed files. uncompress filename.Z
bzip2 Compress files in bzip2 format
THE (DOT) FILES The good old dot files. Let’s clear up some confusion here by defining each.
.bash_login Treated by bash like .bash_profileif that doesn’t exist.
.bash_logout Sourced by bash login shells at exit.
.bash_profile Sourced by bash login shells after /etc/profile
.bash_history The list of commands executed previously.
.profile Treated by bash like ~/.bash_profile if that and .bash_login don’t exist.
.vimrc Default “Vim” configuration file.
.emacs Read by emacs at startup
CONFIGURATION FILES Listing everything is beyond the scope of this article.
/etc This directory contains most of the basic Linux system-configuration Files.
/etc/init.d Contains the permanent copies of System V–style run-level scripts. These scripts are often linked to files in the /etc/rc?.d directories to have each service associated with a script started or stopped for the particular run level. The ? is replaced by the run-level number (0 through 6). (Slackware puts its run-level scripts in the /etc/rc.d directory.)
/etc/cron* Directories in this set contain files that define how the crond utility runs applications on a daily (cron.daily), hourly (cron.hourly), monthly (cron.monthly), or weekly (cron.weekly) schedule.
/etc/cups Contains files used to configure the CUPS printing service.
/etc/default Contains files that set default values for various utilities. For example, the file for the useradd command defines the default group number, home directory, password expiration date, shell, and skeleton directory
/etc/skel Any files contained in this directory are automatically copied to a user’s home directory when that user is added to the system.
/etc/mail Contains files used to configure your sendmail mail service.
/etc/security Contains files that set a variety of default security conditions for your computer.
/etc/sysconfig Contains important system configuration files that are created and maintained by various services (including iptables, samba, and most networking services).
/etc/passwd Holds some user account info including passwords (when not “shadowed”).
/etc/shadow Contains the encrypted password information for users’ accounts and optionally the password aging information.
/etc/xinetd.d Contains a set of files, each of which defines a network service that the xinetd daemon listens for on a particular port.
/etc/syslogd.conf The configuration file for the syslogd daemon. syslogd is the daemon that takes care of logging (writing to disk) messages coming from other programs to the system.
/var Contains variable data like system logging files, mail and printer spool directories, and transient and temporary files.
/var/log Log files from the system and various programs/services, especially login (/var/log/wtmp, which logs all logins and logouts into the system) and syslog (/var/log/messages, where all kernel and system program message are usually stored).
/var/log/messages System logs. The first place you should look at if your system is in trouble.
/var/log/utmp Active user sessions. This is a data file and as such it can not be viewed normally.
/var/log/wtmp Log of all users who have logged into and out of the system. The last command can be used to access a human readable form of this file.
Apache Shell Commands Some of the basic and helpful apache commands.
httpd -v Outputs the build date and version of the Apache server.
httpd -l Lists compiled in Apache modules
httpd status Only works if mod_status is enabled and shows a page of active connections
service httpd restart Restarted Apache web server
ab -n 20 -c 2 http://www.mynitor.com/ Send 20 requests with concurrency of 2 to server mynitor.com.  Apache benchmark is pretty useful tool for load testing.  Check out 25 free tools to measure website performance.
httpd -k start -c "DocumentRoot /docs/html Start Apache with alternative docroot. Useful for debugging.
httpd -k start -f conf/httpd.conf Start Apache with different config file.
httpd -X Run Apache in debug mode.  This’ll start only one process on which you can use lsof/strace and whatever else to figure out issues.
MySQL Shell Commands Some of the basic and helpful MySQL commands.
mysqladmin processlist Shows active mysql connections and queries
mysqladmin processlist |wc -l Show how many current open connections there are to mysql
mysqladmin drop database Drops/deletes the selected database
mysqladmin create database Creates a mysql database
mysql -u username -p password databasename < data.sql Restores a MySQL database from data.sql
mysqldump -u username -p password database > data.sql Backup MySQL database to data.sql
echo “show databases” | mysql -u root -p password|grep -v Database Show all databases in MySQL server.
mysqldump -u root -p password database > /tmp/database.exp Dump database including all data and structure into /tmp/database.exp
mysqlcheck -u <user> -p<pass> -o <database_name> Optimize all tables in database.
mysql -u root -pmypass -e STATUS | grep -i uptime Check mysql uptime.
Categories: linux Tags: , , ,

/proc for Absolute Linux Newbies

November 22nd, 2009 madiga No comments

In this article I will talk about /proc which should be of interest to Linux newbies. I spent a couple of hours using “cat” to find system information. This is really slick.  Just open a bash shell, su to root, and cd to /proc.  Then it’s a simple matter of using the cat command to list all the info in the appropriate files.

Want to know how much memory you’re system is running on? How much is used and free?  What kind of processor model/speed your system have?  How about knowing exactly what occupies your pci slots?  All that is in /proc including a ton of other system details.

The /proc filesystem is a direct reflection of the system kept in memory and represented in a hierarchal manner. The effort of the /proc filesystem is to provide an easy way to view kernel and information about currently running processes. As a result, some commands (ps for example) read /proc directly to get information about the state of the system. The premise behind /proc is to provide such information in a readable manner instead of having to invoke difficult to understand system calls.

The /proc fs can be used for system related tasks such as

  1. Viewing Statistical Information,
  2. Finding out HardwareInformation,
  3. Modifying Runtime Parameters,
  4. Viewing and Modifying Network Host Parameters
  5. Memory and Performance Information

Now with the definition out of the way, let’s start with the examples:

Print System Information

$ cat /proc/cpuinfo - Information about the processor, such as its type,
make, model, and performance.
$ cat /proc/devices - List of device drivers configured into the currently
running kernel.
$ cat /proc/filesystems - Filesystems configured into the kernel.
$ cat /proc/interrupts - Shows which interrupts are in use, and
how many of each there have been.
$ cat /proc/ioports - Which I/O ports are in use at the moment.
$ cat /proc/meminfo - The number of total, used and free bytes of memory and
swap area(s)
$ cat /proc/loadavg - Average of system load for the last 1, 5 and 15 minutes.
$ cat /proc/uptime - Time in seconds since boot-up and total time used
by processes
$ cat /proc/version - Current rev of the kernel and/or distribution
$ cat /proc/environ - The process environment variables
$ cat /proc/mounts -  Shows mounted filesystems.  Shows device, mount point,
filesystem type, permissions.
$ cat /proc/pci - Current occupation of pci slots.

Some proc files can be used to adjust settings in the kernel. This is especially true for files in the /proc/sys/ subdirectory.  Some examples to change a setting temporarily on your system:

$ sudo echo abc > /proc/sys/kernel/hostname -
This changes your server hostname to abc.example.com
$ sudo echo example.com > /proc/sys/kernel/domainname -
This sets a domain name if you don't have arleady or changes to a new one.
$ sudo echo Windows > /proc/sys/kernel/ostype - If you want to have some
fun, you can change this to print Windows instead of Linux on your boot prompt.
$ sudo echo "Version 0.0.1" > /proc/sys/kernel/osrelease - Another neat trick
to confuse your users.

There is a utility called sysctl – This tool is used to manipulate kernel parameters. If you type sysctl -a | more, you’ll see a long list of kernel parameters. You can use sysctl to modify these parameters. Only root has access to update.

This is Part 1 of /proc file system. There are many cool data /proc can provide to help troubleshoot or simply compile data about your server and operating system. In the next part of this article, I will explore a bit more advanced directories and kernel manipulation. I will also briefly touch on utilizing /proc fs as a programming tool.

WARNING: Be sure to avoid viewing the kcore file in /proc. This virtual file contains an image of the kernel’s memory, and the contents of the file will do strange things to your terminal. In general, do not view any file unless you’re sure what it does.
Categories: linux Tags:

Which *buntu is right for you?

October 27th, 2009 madiga No comments

For those of us who still struggle to know the difference between Ubuntu, Kubuntu and Xubuntu.  This article should shed some light into the fundamental differences and perhaps also lead you to choose the one that best suits your needs.

Ubuntu is a community developed operating system that is perfect for laptops, desktops and servers. Whether you use it at home, at school or at work Ubuntu contains all the applications you’ll ever need, from word processing and email applications, to web server software and programming tools.

Ubuntu is a direct threat and competitor to Windows and Mac operating systems.  Ubuntu is and always will be free of charge. You do not pay any licensing fees. You can download, use and share Ubuntu with your friends, family, school or business for absolutely nothing.

Ubuntu with GNOME


Ubuntu is a community developed, Linux-based operating system that is perfect for laptops, desktops and servers. It contains all the applications you need – a web browser, presentation, document and spreadsheet software, instant messaging and much more.    The default distribution of Ubuntu comes with GNOME desktop environment.

The base of the operating system is all the same but if you like GNOME go for Ubuntu.  The Gnome desktop environment is probably the most widely used world-wide, it is easy, flexible and extremely customizable.  Many use Gnome because of it’s huge community base, easy access to support, custom themes and more.  At the time of this writing, Gnome 2.24 is out.

Kubuntu with KDE

According to the official Kubuntu website, Kubuntu is the first Ubuntu derived distribution.  You can get exactly the same effect by installing Ubuntu and adding the KDE packages (and removing the Gnome packages) from the Ubuntu archives.  Kubuntu uses the KDE graphical environment instead of GNOME.  According to the KDE’s official website, KDE or the K Desktop Environment, is a network transparent contemporary desktop environment for UNIX workstations. KDE seeks to fulfill the need for an easy to use desktop for UNIX workstations, similar to desktop environments found on Macintosh and Microsoft Windows operating systems. The UNIX operating system is according to us the best available today.

KDE is by far the most complete UNIX based desktop environment.  It comes with packages that meets all end user’s needs.  It is extremely user-friendly, has professional interface and in my opinion by should be the default desktop environment for a new user trying to learn Linux.  At the time of this writing, KDE 4.2 is out and it’s awesome!

Xubuntu with XFCE


According to Wikipedia, Xubuntu is an official derivative of the Ubuntu operating system which uses the XFCE desktop environment.  According to the creator of XFCE, Olivier Fourdan…“Xfce is a lightweight desktop environment for various *NIX systems. Designed for productivity, it loads and executes applications fast, while conserving system resources.”  It short, it is a light weight desktop solution compare to Gnome and KDE.  This version can run on older systems, laptops that may not have enough cpu or memory power.

Xfce 4.4, the latest release embodies the traditional UNIX philosophy of modularity and re-usability. It consists of a number of components that together provide the full functionality of the desktop environment. They are packaged separately and you can pick and choose from the available packages to create the best personal working environment

More Ubuntu Derivatives

Edubuntu - Edubuntu’s objective is to create an integrated and usable experience for educational users by enhancing Ubuntu with educational applications, tools, content, and themes.

GobuntuA flavour of Ubuntu that strives to be completely devoid of software, drivers or firmware with restrictive licenses.

Ubuntu Studio - Designed for multimedia editing and creation.  Ubuntu Studio is aimed at the GNU/Linux audio, video and graphic enthusiast as well as professional.

Mythbuntu - Designed for creating a home theatre PC with MythTV.  Mythbuntu is an community supported add-on for Ubuntu focused upon setting up a standalone MythTV based PVR system. It can be used to prepare a standalone system or for integration with an existing MythTV network.  Mythbuntu also uses the XFCE4 desktop.

Ubuntu MID (Mobile Internet Device) Edition – Ubuntu MID Edition targets an exciting new class of computers called Mobile Internet Devices. Ubuntu MID, based on the world’s most popular Linux distribution, and MID hardware from OEMs and ODMs, is redefining what can be done in mobile computing.

Ubuntu is a great and easy to use no matter which of the above derivative you pick.  However, some are meant more for developers and other things that are specific to an industry, such as education.  For a new user, the best options available to use are Ubuntu or Kubuntu.  I personally find the KDE desktop environment more user-friendly than GNOME but everyone has their own preference.

Categories: General Tags: ,

VPNC for Ubuntu!

October 20th, 2009 madiga No comments

People coming from the Windows world are used to using Cisco VPN client to login to their corporate network.  So when they make the transition over to Ubuntu, they’re somewhat puzzled at the complexity of getting Cisco VPN client working.

It’s obviously not as straightforward as it is on Windows platform but there also has been cases of kernel panics using the Cisco VPN client on Linux.

For those who are looking for an alternative, I’ve got good news.  I came across VPNC recently and it only took me a few minutes to get it installed, configured and get connected to my job’s corporate network.

Supported Platforms:

  • Linux (i386/ppc/zaurus tested)
  • NetBSD (i386 tested)
  • FreeBSD (CURRENT of 23.11.2003 tested)
  • OpenBSD (CURRENT of 18.04.2004 tested)
  • DragonFly BSD
  • Darwin / Mac OS X
  • Solaris (7 works, 9 only with –natt-mode forced)
  • Windows / Cygwin

As you can see it supports more than just Linux but I haven’t yet tested on any other in the above list to make sure.

Quick Setup:

$ sudo apt-get install vpnc
Convert your existing PCF file (if you have any) to vpnc recognized format using this perl script: http://svn.unix-ag.uni-kl.de/vpnc/trunk/pcf2vpnc
$ wget http://svn.unix-ag.uni-kl.de/vpnc/trunk/pcf2vpnc
$ chmod +x pfc2vpnc
$ ./pcf2vpnc orig.pcf vpnc.conf
$ sudo vpnc vpnc.conf

That’s it!  Five easy steps to install, configure and connect to your network.  If you have Kubuntu, you can install kvpnc which by default allows you to use the original PCF file for configuration, so no need to convert here.  I haven’t tested this myself so I can’t say for sure it works.

Go ahead, give it a try.  Read the doc that comes with the source pkg to setup a configuration from scratch.

Categories: General Tags: , ,

Linux alternative to ‘truss’ command on Solaris

October 20th, 2009 madiga No comments

The topic may seem unclear to those unfamiliar with Linux operating system but no worries I can explain.   strace can help you troubleshoot any process on the system.  Generally, people look into tools such as strace because some process is acting funky and in order to understand better what it’s doing while it’s being funky is to watch it’s every move while it’s running.  strace is similar to truss on Solaris operating system and as you’ll see it’s a very handy tool for troubleshooting.

From the man pages…”In the simplest case strace runs the specified command until it exits. It intercepts and records the system calls which are called by a process and the signals which are received by a process.”

Furthremore, “strace is a useful diagnostic, instructional, and debugging tool. System administrators, diagnosticians and trouble-shooters will find it invaluable for solving problems with programs…”

Now that you have an idea how powerful strace can be…let’s jump directly into some examples which hopefully can assist you in troubleshooting issues on your system when there is one.

strace is not installed by default but you can fetch it from it’s project site at sourceforge.

TO INSTALL

$ apt-get install strace
$ yum install strace (fedora/redhat)
$ wget http://voxel.dl.sourceforge.net/sourceforge/strace/strace-4.5.18.tar.bz2  (other OS)
$ tar -xjvf strace-4.5.18.tar.bz2
$ cd strace-4.5.18
$ ./configure; make ; make install


NOW onto EXAMPLES

Run it against a simple ‘ps’ command:

$ strace ps

Send output to a file:

$ strace -o /tmp/strace_ps.log ps

- As you can see just how much goes on in
the UNIX machine just for a simple ps command!

Start the program under control of strace:

# strace -Ff -tt <program> <arguments> 2>&1 | tee strace-<program>.log

Start strace with the process ID -
(You can get PID of a process by typing pidof <program>):

# strace -Ff -tt -p <PID> 2>&1 | tee strace-<program>.log

To see only a trace of the
connect, open, close, read, and write system calls, enter:

# strace -e trace=connect,open,close,read,write df > /tmp/out.txt

You get the idea.

Check the man page by typing man strace for detail explanation and examples.

Categories: General Tags: ,

Rename Multiple Files

October 18th, 2009 madiga 1 comment

Renaming single files on Unix is easy and simple but whenever an average user needs to rename multiple files they always have to ask the fat admins to get off their ass and do it for them.

Well those days are over, renaming multiple files is as easy renaming single files…well almost.  In this article, we’ll show you multiple  ways you can rename files at once.  The examples were taken from various sources.

To rename all *.html file as *.php

$ rename .html .php *.html

To remove blank spaces from a filename:

$ rename "s/ *//g" *.php

To rename all uppercase files to lowercase:

$ rename 'y/A-Z/a-z/' *

Change .htm files to .html

$ for file in *.htm ; do mv $file `echo $file | sed 's/\(.*\.\)htm/\1html/'` ; done

Change .html files to .htm

$ for file in *.html ; do mv $file `echo $file | sed 's/\(.*\.\)html/\1htm/'` ; done

Change .html files to .shtml

$ for file in *.html ; do mv $file `echo $file | sed 's/\(.*\.\)html/\1shtml/'` ; done

Change .html files to php

$ for file in *.html ; do mv $file `echo $file | sed 's/\(.*\.\)html/\1php/'` ; done

Again, to rename *.txt to *.bak

$ for f in *.txt; do mv "$f" "${f%.txt}.bak"; done

To rename *.php5 to *.php

for x in *.php5; do n=${x/.php5/.php}; mv $x $n; done

There are many other ways of course. If you want to change the actual filename itself such as prefixing with a unique name, adding a word in between filenames or appending.. sed and awk is probably the best in that.

Categories: General Tags: