How to use crontab utility from X?
How to edit crontab utility from GNOME or KDE?
How to have a GUI-based utility with GUI desktop interface?
How to have a GUI task scheduler?
How to install KDEAdmin?
How to install KCron with Fedora 7?
From recent blog entry about crontab utility found here and here, here's an entry on how to utilize crontab utility with non-terminal GUI desktop interface?
KCron is a GUI application for managing cron schedules interactively using a friendly-user GUI-based desktop interface. In other words, KCron is a graphical user interface to cron system scheduler called cron utility. This KCron package is only one of the many binaries included from KDE administration component. KCron can be installed and executed both under the GNOME and KDE environment.
INSTALLATION
~~~~~~~~~~~~~~
Kcron GUI-based cron scheduling utility can be installed also using yum.
# yum -y install kdeadmin
BINARY LAUNCH: Ctrl+F2, kron
During binary launch, KCron scans all system and account users together with all listed and scheduled system and user cron jobs present from the current linux box. KCron displays these cron jobs in a nice and desktop interface. Ease of use and user-friendliness were highly utilized on designing KCron feature for managing scheduled cron jobs. In fact, Kcron is quite attractive and desktop enticing especially for linux newbies who are used to administering jobs with X from their boxes.
By choosing a particular system or user account(s) from the main Kcron screen, Kcron main window presents you mouse-driven options on modifying existing cron jobs of a currently selected user or system accounts. These also include global wide cron jobs from /etc/crontab, /etc/cron.hourly, /etc/cron.daily, /etc/cron.weekly, /etc/cron.monthly cron files.
Here are the actual screenshot I have on editing and modifying existing cron job. KCron displays all system and user accounts with all their existing cronjobs in a manageable, attractive and easy to use KDE layout using dropdown tree menus and multiple panel and child windows.
Noticeably, Kcron uses KDE power of visual display on accomplishing same crontab job function from a running GUI-enabled linux desktop.
This entry is not here to discredit any default crontab administration and management that comes from any linux distro.
Categories
- HowTos (611)
- Linux Devices (39)
- Linux Diggs (620)
- Linux News (1542)
- Linux Videos (24)
Recent Posts
Blog Archive
-
►
2008
(2302)
-
►
October
(140)
- Linus Torvalds on Linux Distributions
- AMD to Spin off Manufacturing Operations
- MySQL cofounder David Axmark leaving Sun
- Mono to contribute back to CLI; Microsoft says it ...
- Monitor your network with GroundWork Monitor Commu...
- The LXF Guide: Write a Perl module
- 8 Best First-person Shooter Games for Linux
- AppDeploy Community Launches Free Windows Installe...
- Ubuntu Tweak - Sneak Peak at Latest Version!
- POS stack targets Linux netbooks
- RIP LinuxWorld
- Firefox extension blocks dangerous Web attack
- Wikia co-founder to speak at linux.conf.au
- Wikia co-founder to speak at linux.conf.au
- Look Ma, No ‘X’
- Look Ma, No ‘X’
- Forget the damn Linux netbooks. Can Windows replac...
- Forget the damn Linux netbooks. Can Windows replac...
- Amarok 2.0 Beta 2 was released
- 6 Years As A Professional Software Developer
- Amarok 2.0 Beta 2 was released
- 6 Years As A Professional Software Developer
- Distribution Release: EnGarde Secure Linux 3.0.21
- Torvalds talks about his brand new blog
- Become a multimedia pro with the Vector Linux Mult...
- Linux Robot - Watch This Space
- Distribution Release: EnGarde Secure Linux 3.0.21
- Torvalds talks about his brand new blog
- Become a multimedia pro with the Vector Linux Mult...
- Linux Robot - Watch This Space
- Linux-Based E-Voting In Brazil
- Is .NET on Linux Finally Ready?
- Linux-Based E-Voting In Brazil
- Multi-core networking stack ported to PowerPC
- Google rev's photo editor for Linux
- Project releases version 2.0 of open source .Net
- One more 2.6.27 prepatch
- Stallman vs. Clouds
- How to Create and Use a Password Reset Disk in Win...
- OpenOffice.org Grows Up
- 45+ Sources and Sets of Photoshop Custom Shapes
- Clean up your filesystems with fslint
- NPX-9000 UMPC is inexpensive but underpowered
-
►
October
(140)
-
▼
2007
(340)
-
▼
August
(95)
- KCron - GUI task scheduler
- Linux backups powered by Tar
- INQ7 front page image retrieval
- using wget for data and file transfers
- BibleTime - Bible study from Linux howto
- human readable DVD/CD drive technical details
- sound-juicer - alternative audio CD ripper install...
- Stellarium - watch the sky from Linux
- Munin - monitor linux hosts install howto
- blocking yahoo chat messenger
- string manipulation using cut linux command
- graphing skystream DVB receiver's Eb/No and signal...
- BZFlag - 3D multi-player tank game install howto
- screenshot and snapshot creations howtos
- string parsing using bash
- grep multiple character from string or file
- enable and disable of telnet service
- grep multiple strings from a file
- remove spaces from filenames
- ISO creation and CD/DVD burning from terminal
- send a message to user's terminal
- retrieve GMail emails via terminal using fetchmail...
- more of activating and deactivating network card
- set new mysql password
- TIP: enable thumbnail display images from apache
- monitor large mailbox users
- using the linux yes command
- string manipulation using tr linux command
- install and play 2D chess game in linux
- more firefox tips and tricks
- recover root password on linux
- establish ssh connection from different port
- uniq linux command
- remove blank lines using grep or sed
- date and time sync via NTP server howto
- who am I
- delete spam email and folder regularly howto
- hello world bash and perl script
- passwordless rdesktop session with XP howto
- force VGA screen resolution and screen mode
- RealPlayer 10 for linux install howto
- Grip - CD ripper install howto
- Banshee - music management and playback
- gnome music applet install howto
- Pirut and yum-updatesd - software management
- Alacarte - editing panel menus install howto
- access NTFS drive in Fedora
- FileLight - graphical disk usage and statistics
- TestDisk- partition tool install howto
- using /dev/null in linux terminal
- yahoo messenger in fedora install howto
- check and repair MS-DOS file systems howto
- using fdformat and mkdosfs from terminal
- Tremulous - Quake 3 install howto
- block consecutive IP address using scripts
- using floppy linux command from terminal
- display word or text file in reversed pattern
- convert a file to equivalent hex/binary code
- spell check text file from terminal
- create screen timer from linux howto
- recreate deleted /dev/null
- harddisk monitoring using smartctl
- bind ssh to selected IP address
- restrict su command to superuser only
- thunderbird install howto
- dovecot POP3/POP3S server with SSL/TLS install how...
- qpopper POP3 server install howto
- my other linux pages
- more ssh log parsing and monitoring
- checking daemon service bash script
- HTML CHM help file viewer install howto
- du - the disk usage linux command howto
- gnome language translator install howto
- display linux memory information howto
- display the number of processor howto
- 3d tabletennis game install howto
- Nokia N70 on Fedora via USB data cable
- Fedora 7 as guest host from VirtualBox
- at - jobs scheduling howto
- Nokia 70 linux connection via bluetooth dongle how...
- crontab - jobs scheduling howto
- managing daemon services howto
- create your own linux OS distro howto
- kernel devel headers install howto
- more multimedia browser plugins install howto
- numlock on with X install howto
- Fedora and RHEL differences
- create virtual terminals with single ssh connectio...
- virtual CentOS using VMWare 5.5.4 install howto
- VMware workstation 5.5.4 install howto
- 50 quick linux command tips part 4
- 5 SysAds permanent static route story
- ssh log parsing and monitoring
- removable drives, devices and media preferences
- gnome-blog desktop blogging install howto
-
▼
August
(95)
Friday, August 31, 2007
KCron - GUI task scheduler
Posted by
VeRTiTO
at
3:29 PM
0
comments
Links to this post
Labels: HowTos
Linux backups powered by Tar
Make backups of your data.
Anybody who manages servers usually does administrative server backup procedures on regular repeated basis. There are several wide procedures and approaches on doing data backups. As to which specific data to do the back up depends on the reasons why the need to backup these files and folders.
There are lots of storage options and backup destinations to choose from nowadays. Selecting backup storage types is as logical as where to have backup destinations and what is available on ground. There are people who does their backups from real work or several occasions into their external tape and/or zip drive devices, external and portable large-capacity USB drives, avilable backup servers, removable backup SCSI harddisk, network SAN drives or even flash drive. The interval basis of doing the backup also depends both from server and end-users data operation as well.
Backup procedures also comes down from simple linux backup commands, from non-interactive shell scripts up to commercial backup products.
Bottomline is that these backup techniques and strategical methods depend on what do you have and what is available on ground.
This document entry however covers a foundation approach and mostly used tar arguments on backing up data using the linux command tar.
=============================================
Data backup samples using Tar Linux command
=============================================
A very simple usage of tar
# tar cvf backup.tar *
Legend:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-c create a new tar file
-v verbose mode
-f select file
* file glob selection
By default, tar digs down into subdirectories
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Making it as a backup copy is as simple as moving to a different location. Preferably to another storage location. As discussed earlier, strategical backup methods depends on what is on ground. If you do not have any more available host, or external backup devices. And what you have is another removable or separate harddisk, you can transfer and copy the backup file on that separate or removable harddisk.
If you wish to copy it on a separate disk mounted on a separate partition, that is just simple file copying linux command like so
# cp backup.tar /mounted/separate/harddisk/backup.tar
If you wish to copy your backup file to a mounted external USB or flash device, similarly it would be done like so
Assuming that the external drive is already mounted
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# cp backup.tar /mnt/usb
Alternatively,
# cp backup.tar /dev/sdb1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Copying data between host to host can be done in many way. One way to achieve this is making use of shell secure copy named scp. If you wish to copy files between two host as tar file, this is more likely how to approach that issue
# scp -C backup.tar username_from_other_host@other_host:destionation_location
# scp -Cpv backup.tar username_from_other_host@other_host:destionation_location
Remember, linux gives us total control using compounded linux commands like so
# scp -C `tar cvf backup.tar *.mp3` remoteuser@remotehost:~remoteuser
Alternatively
# tar cvf backup.tar *.mp3 | scp -C backup.tar remoteuser@remotehost:~remoteuser
Or
# scp -C $(tar cvf backup.tar *.mp3) remoteuser@remotehost:~remoteuser
The above command would prompt you for user's password coming from host destination.
Legend for scp:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-C enable compression mode during data trasfer
-p enable modify and access time and modes from the source original file
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From this backup files, they might grow into big filesizes eventually. If you wish to burn them into CD/DVD disks, you might do so.
However if you wish to have backup file not as it is but as an ISO image file before any host to host or harddisk to harddisk transfers, this could be done like so
# mkisofs -o myhostname-backup-image01.ISO backup.tar.gz
Then proceed with data transfer of backup files.
More information on creating an ISO image from your big backup archived file, you can read more on creating ISO from recent entry here. DVD/CD burning applications were also discussed from here.
Tar comes with many arguments. Some of them cannot really be combined anytime like create a new tar file while updating or listing archived files. You can have more tar argument sample, below are more working tar samples.
Another tar backup example using more tar arguments:
# tar cvfp backup.tar * --exclude=*.mp3 --no-recursion
# tar zcvfp backup.tar.gz * --no-selinux
# tar zcvfp backup.tar.gz *
# tar jcvfp backup.bz2 *
Legend:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--exclude exclude file globbing patterns
-z integrate with gzip command, compression on the fly
-j integrate with bzip2 command, compression on the fly
-p preserve permissions
-c create a new tar file
-v verbose mode
-f file selection
* file glob selection
--no-selinux do not include SELinux security context information and extraction date
--no-recursion do not recurse into subdirectories
By default, tar digs down into subdirectories recursively
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you wish to exclude a directory folder from being archived using tar
# tar cvfp backup.tar * --exclude=FOLDERNAME
From the above examples, --exclude argument was specified since I am currently working on same folder location where
the archived tar file is also being saved and processed.
If you wish to update an existing tar file from new file changes or newly added folders, follow like so
# tar uvfp backup.tar * --exclude=backup.tar
# tar uvfp backup.tar * --exclude=*.tar
From above sample, any file changes and updates would by sync to an existing archived tar file excluding changes occuring from the backup file itself. If the archived file is already existing, the file would be overwritten.
Legend:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-t list down archived files and folder
-u update an existing tar file
--exclude exclude file globbing pattern
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Exclude argument excempts a matched file globbing pattern. From the above example, backup.tar and anyfile that ends with tar file extension (*.tar) would not be updated with the last tar command.
If you wish to exclude batches of files without filename patterns, you can create a text file that contains the filenames that needs to be excluded from the tar operation like so
# cat except.txt
~~~~~~~~~~~~~~~~~~~~~~
filename1.mp3
batibot.ISO
sesame.tar.gz
....
snipped
....
~~~~~~~~~~~~~~~~~~~~~~
and feed it to tar operation command with -X tar argument like so
# tar cvfp backup.tar * -X except.txt
# tar cvfp backup.tar * -X except.txt -X except2.txt
If you wish to append a new set of files or folder to an already existing tar archive, using tar would be
# tar rvfp /home/oldfolder/backup.tar /home/newfolder
# tar rvfp /home/oldfolder/backup.tar /home/newfolder/folder1/*
If you wish to backup a floppy disk using tar, you could do like so
Mount the floppy disk first like so
# mkdir /mnt/floppy
# mount /dev/floppy /mnt/floppy
And tar all contents from floppy disk like so
# tar cvfp floppy.tar /mnt/floppy/.
If you wish to backup a CD disk using tar, you could do like so
Mount the CD disk first like so
# mount /dev/cdrom /mnt/cdrom
# tar cvf CDfiles.tar /mnt/cdrom
If you wish to backup the entire harddisk partition
# tar zcvfp home_partition_backup.tar.gz /mounted/partition
# tar zcvfp home_partition.tar.gz /mnt/home
Tape backup using tar is likely the same as shown below
# tar zcvfp home_partition.tar.gz /dev/st0
USB flash drive for small data tar backup can be done like so
# tar zcvf *.doc /mnt/usb1
Multiple tar file concatenation can also be done from tar to back up multiple tar files like so
# tar Afvp home1.tar home2.tar
If you wish to tar all file glob matched from multiple directories and/or tar dynamic matched files from doing find linux command would be like so
# tar zcvf backup.tar.gz `find /home -name '*.txt'`
# tar zcvf backup.tar.gz `find /etc -name '*.conf'`
Incremental Backup or Archiving using Tar
-----------------------------------------
# tar cvfGp incremental-backup.tar *.txt
# tar cvfGp incremental-backup.tar /home/foldername
Alternatively using a date of reference on incremental backup would be like so
# tar cvfGp incremental-backup.tar *.dat -N '1 Sep 2007'
The above command would do incremental backup tagging all *.dat files having file date stamp creations newer than 1st of September 2007.
# tar cvfGp incremental-backup.tar *.dat --newer-mtime '1 Sep 2007'
The above command would process incremental backup tagging all *.dat files with a newer file date modification value than 1st of September 2007.
Verification Listings of Archived Tar file
------------------------------------------
If you wish to list down or verify files inside an archived backup tar file
# tar tfv backup.tar
If you wish to verify a specific file, folders or multiple files if they are listed from particular archived tar file
# tar tfvp backup.tar | grep specificfile.txt
# tar tfvp backup.tar | grep 'file1\|file2'
# tar tfvp backup.tar | grep 'folder1'
Considering thousands listings of archived files from a single tar file and you wish to exclude a folder from being listed, you can optionally use the --exclude tar argument like so
# tar tfvp backup.tar | grep 'folder1' --exclude=THISFOLDER
# tar tfvp backup.tar | grep 'folder1' --exclude=*.mp3 --exclude=FOLDERNAME
Extraction of files from an Archived Tar File
---------------------------------------------
For basic extraction of archived tar file
# tar xvf backup.tar --no-recursion
For extraction of gzipped compressed archived tar file
# tar zxvf backup.tar
For extraction of bzipped compressed archived tar file
# tar jxvf backup.tar
For extraction of archived tar file to a specific destination folder
# tar xvf backup.tar -C /tmp
# tar jxvf backup.tar -C /tmp/test
# tar zxvf backup.tar -C /home/sesame
# tar zxvf backup.tar -C /home/sesame --overwrite --overwrite-dir
Legend:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
--overwrite simply overwrites any existing files
--overwrite-dir simply overwrites any existing directory folders
--delete be careful with this one as it deletes the archived tar file after extraction
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Integration of tar backup procedure with shell scripts
-------------------------------------------------------
Doing the backup can be done non-interactively or on automatic mode. The first step to do this is to create a shell script. From there you can list down all the necessary backup tar commands one line at a time and make the script executable. A very basic sample of backup scripts would be combination of tar commands specific to your needs that suits the required files and folders to be back up.
Sample simple backup script
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#/bin/bash
# backup scripts basic examples
# Go to backup or temp folder
cd /tmp
# what is happening?
echo Starting the backup process...
# Do all tar backup lines below
tar zxvfp backup.tar.gz /home --exclude=*.ISO --exclude=*.tar
tar zxvfp backup.tar.gz /home/www/pages
# Make a copy from here to there
cp backup.tar.gz /mnt/separate/hardisk/or/any/mounted/device
# Transfer the backup file from host to host
# Remember an entry with passwordless / passphraseless ssh connection discussed recently?
scp -Cp backup.tar.gz user@hostname:~user
# Gone with the wind, now delete footprints in the sand to save local disk space
rm -rf backup.tar.gz
# I see
echo Done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If this helps you out somehow, try contributing from the linux bar's tip using those black ninja boxes if you may.
File Naming Convetions
----------------------
One good practice on administering backup files is a good filename convention. This is mostly applicable on handling and processing any type of files from any file read/write operations.
Yes we need a unique filename. A unique file name is required for a repeated backup routines. Linux can generate unique random characters and numbers but the problem with that approach is unique identification of each filename is not identifiable against each other filenames.
What else could we use on unique filename for our backup files.
Ding! A date string value is always unique and usable on daily backup operations as well as time string value would be acceptable as a unique filename for hourly backup operations. Below are examples of unique file naming convention based on current system date and time. This approach is logical in manner of having proper identification among group of backup files.
This date string command was also recently discussed from INQ7.
Example of how to use from shell script
# cat shellscript.sh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#/bin/bash
ID=`date "+%m-%d-%Y"`
# Daily backup routine with daily unique file name
tar zcvf webpages-$ID.tar.gz /home/www
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# chown 700 shellscript.sh
Unique filename based on date value from command line terminal using tar command would be like
#tar zcvf home1-folders-`date "+%m-%d-%Y"`.tar.gz /home/www
Another unique filename based on time and date values done from terminal would be like
#tar zcvf www-2-pages-`date "+%m-%d-%Y-%I-%M-%S-%P"`.tar.gz /var/www/html2
Backup Scheduling Using Crontab Utility
---------------------------------------
Combining your backup script commands or scripts into linux crontab utility is required for a nice scheduled backup procudures done non
-interactively and automatically on regular basis. There was a recent crontab howto discussion, you can find it here.
There are companies that do their backup during morning hours as most data transaction occurs on night hours. Several do it during sleeping hours or midnight time. But usually, most backup operations depends on each data backup requirements, cut-off date and time implemented by company policies.
Final Note:
Data backups are SOPs, not only for the reason of serving as a fallback data source, but also for serving as history log records and for future references.
Backup data are just dead 1's and 0's of the past, but in one linux snap, they can be brought back to life when we needed them most.
So goodluck, that's it for now.
Unfortunately, screenshots on how a commercially known Tivoli Storage backup system works with linux would not be here.
Next entry would be backing up files using linux rsync and rsnapshot.
Have a nice weekend!
Related Posts:
Linux Backup using RSnapShot
Linux Backup using RDiff
Bandwidth-Effificent and Encrypted Linux Backup
Posted by
VeRTiTO
at
3:00 AM
0
comments
Links to this post
Labels: HowTos
Thursday, August 30, 2007
INQ7 front page image retrieval
According to statistics, the most important page of a newspapager is the frontpage. The very first page of a newspaper is where major news are being emhpasized, given attention, and sensationalized since this is the very outside cover and first entry of attraction where consumers look at from daily newspaper.
With that, INQ7, a website of one of the major newspaper source from Philippines, provides an soft copy of its front page publicly posted from their website on daily basis for the consumer to take a view.
This entry basically covers a simple approach on how to parse date string using linux date command inside a bash shell script to retrieve a front page image of a newspaper particularly from INQ7. This image has a changing filename based from date when the image was photo scanned.
Say the actual URL is
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
http://images.inquirer.net/img/thumbnails/new/hea/pag/img/2007/08/20070830.jpg
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From the above, the image filename is 20070831 in JPG file format. Noticeably, the folder location is also dynamic in value which is also based on current date
Here's the actual simply bash script on handling this kind of dynamic URL source and image filename based on current date string value.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/bash
# script to retrieve front page image from INQ7 website
# get date, year and month in this format: year=2007, month=08, and day of the month=30
date=`date "+%Y%m%d"`
year=`date "+%Y"`
month=`date "+%m"`
# assigns the dynamic URL to the URL variable like so
URL="http://images.inquirer.net/img/thumbnails/new/hea/pag/img/$year/$month/$date.jpg"
# download the image
wget -c $URL > /dev/null 2>&1
#sends the image file as a mail attachment and send it to my email box like so
echo "my email body" | mutt -s "INQ7 Front Page image subject" -a $date.jpg myemail@domain.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Change file access permission to be an executable bash script like so
# chmod 700 samplenews.sh
Then create a crontab job executing the script on daily basis every 7:01AM like so
01 07 * * * /myfolder/samplenews.sh > /dev/null 2>&1
That's it, a very simple approach on retrieving INQ7 front page image file every 7:01AM and deliver it into your Inbox on daily basis.
Sample image from INQ7 site:![]()
This approach is also applicable to Abante and Tonite philippine site.
Done.
Linux commands used:
chmod, wget, bash commands, mutt, crontab
All news website are property and managed by their own respective companies and sites.
Posted by
VeRTiTO
at
4:50 PM
0
comments
Links to this post
Labels: HowTos
using wget for data and file transfers
Did you ever experience transferring more than 50 files from a specific site using browser?
How about downloading gigabyte files between host?
Have you ever done unattended large file transfers between hosts without monitoring it for unexpected brief disconnection or timeouts?
Have you downloaded more than 4 GB of single file from a remote host not supported by electric generators or UPS?
What about downloading multiple files on a site with different source locations, from FTP or from web with irregular filename patterns?
Most linux servers I know and all servers I have been managing boots into runlevel 3 specially those unattended servers being managed remotely from far remote locations.
With that in mind, data file transfers are done via terminal commands between two or more hosts, locally from the network or from the internet. Here are two ways to accomplish file transfer over your network and via internet.
This document entry covers data and file transfers using linux command wget. Each of them has its own set of advantages and disadvantages. And both of them have similar benefits for the users on transferring files interactively or in unattended mode. This entry aimed to maximize your systems administration time on large backup data transfers and file transfers locally and from remote host location while being proactive, busy and effective on another separate work for another hundreds of server.
USING WGET FOR FILE TRANSFERS
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Man wget:
Wget is a free utility for non-interactive download of files from the Web. It supports HTTP, HTTPS, and FTP protocols, as well as retrieval through HTTP proxies.
Wget is non-interactive, meaning that it can work in the background, while the user is not logged on. This allows you to start a retrieval and disconnect from the system, letting Wget finish the work. By contrast, most of the Web browsers require constant user’s presence, which can be a great hindrance when transferring a lot of data.
Wget can follow links in HTML and XHTML pages and create local versions of remote web sites, fully recreating the directory structure of the original site. This is sometimes referred to as ‘‘recursive downloading.’’ While doing that, Wget respects the Robot Exclusion Standard (/robots.txt). Wget can be instructed to convert the links in downloaded HTML files to the local files for offline viewing.
WGET USAGE
~~~~~~~~~~
Transfer 4GB of file from website
# wget http://website.com/folder/bigisofile.iso
While downloading bigisofile.iso, suddenly, the remote host server went kaput due to power failure and came back after 30 minutes. Resume a partially downloaded file using wget like so
# wget -c http://website.com/folder/bigisofile.iso
Any interrupted downloads due to network and/or disconnection failure would be resumed and retried as soon as the connectivity is re-established using the wget argument -c
If a partially downloaded file exists from current folder, and wget was issued without -c , wget would continue downloading but saving the file on a differnt name like bigisofile.iso.1.
You cal also specify the number for wget retry thresholds by using the wget argument --tries. Below specified 10 retries before deciding to quit the wget.
# wget -c --tries=10 http://website.com/folder/bigisofile.iso
or
# wget -c -t 10 http://website.com/folder/bigisofile.iso
You can also apply the command above with FTP, HTTP and other retrieval protocols done from proxies like so
# wget -c --tries=10 ftp://website.com/folder/bigisofile.iso
For visual downloading of file using wget, you can issue it like o
# wget -c --progress=dot http://website.com/folder/bigisofile.iso
Rate limiting is also possible with wget using --limit-rate as an argument like so, which limits wget download rate to 100.5K per second
# wget -c --limit-rate=100.5k http://website.com/folder/bigisofile.iso
alternatively, wget limit rate of 1MB, it would be like so
# wget -c --limit-rate=1m http://website.com/folder/bigisofile.iso
Wget supports http and ftp authentication mechanism as well and can be used like so
# wget -c --user=user --password=passwd http://website.com/folder/bigisofile.iso
This can be overridden with alternative argument like so
# wget -c --user=ftp-user --password=ftp-passwd ftp://10.10.0.100/file.txt
# wget -c --user=http-user --password=http-passwd http://10.10.0.100/file.txt
Wget command can also be used on posting data to sites with cookies like so
# wget --save-cookie cookies.txt --post-data 'name=ben&passwd=ver' "http://localhost/auth.php"
And after a one time authentication with cookies shown above, we can now proceed to grab the files we want to retrieve like so
# wget --load-cookies cookies.txt -p http://localhost/goods/items.php
Recursion with wget is also supported. If you wish to download all files from a site recursively using wget, this can be done like so
# wget -r "http://localhost/starthere/"
Recursive with no directories creation is also possible. This approach downloads only the files and does not create recursive directories locally
# wget -r -nd "http://localhost/starthere/"
Retrieve the first two levels or more with wget is possible like so
@ wget -r -l2 "http://localhost/starthere/"
File globbing are also being supported by wget. File globbing special characters includes * ? [ ] . Here are more samples of wget with file glob arguments
# wget http://localhost/*.txt
# wget ftp://domain.com/pub/file??.vbs
# wget http://domain.com/pub/files??.*
# wget -r "*.jpg" http://domain.com/pub/
Absolute path for document link conversion is also being supported by wget to make local viewing possible using the downloaded files and images. This is possible using -k .
Log file is another nice feature we can get from wget by using -o like so
# wget -c -o /var/log/logfile http://localhost/file.txt
Running wget in background can be specified via wget or by bash shell same like running applications in background like so
# wget -b http://localhost/file.txt
or
# wget http://localhost/file.txt &
Wget is capable of reading URL files from files. This approach makes wget to function in batch mode like so
# wget -i URL-list.txt
The above argument does not expect any source URL from command line anymore.
Any values for retry timeouts, network timeouts, dns time outs using wget can also be defined explicitly like so
network time outs with wget specified for 3 seconds
# wget -T=3 URL
DNS time outs with wget specified for 3 seconds
# wget --dns-timeout=3 URL
Connect time outs with wget specified for 3 seconds
# wget -connect-timeout=3 URL
Read timeout with wget for 3 seconds
# wget -read-timeout=3 URL
Sleep between retrieval with wget can also be specified like so
# wget -w 3 URL
Forice wget to use IPv6 or IPv4 is done with arguments -6 and -4 respectively.
Disabling cache and cookies can be done with wget arguments using --no-cache and --no-cookies
Proxy authentication can also be supplied with wget using --proxy-user and --proxy-password like shown below
# wget --proxy-user=user --proxy-password=passwd URL
Additionally, HTTPS (SSL/TLS) are also being supported by wget using more arguments shown below. Words shown in brackets are the choices available for particular wget argument, and file refers to physical file and folder refers to physical folder
location locally.
--secure-protocol= (auto,SSLv2,SSLv3, TLSv1)
--certificate=client_certificate_file
--certificate-type= (PEM,DER)
--private-key=private_key_file
--private-key-type= (PEM,DER)
--ca-certificate=certificate_file
--ca-directory=directory_source
--no-parent needs to be specified when doing recursive wgets so as to avoid recursive search from parent directory
You can also redirect output to files by using pipe or linux redirection characters.
Happy wget!
Posted by
VeRTiTO
at
10:38 AM
0
comments
Links to this post
Labels: HowTos
BibleTime - Bible study from Linux howto
Well.
Linux is not only for techies as well all know, there are lot of reasons why.
Here is one reason why.
Do you like reading?
Are you interested on more reading without flipping any book pages?
How about reading with sigle tick of putting a bookmark?
Do you like reading about history, time and people?
Do you enjoy long word reading from your screen?
Do you like reading offline pages?
If so, read on.
Do you wish to study and read more of Bible scriptures from your Linux?
If so, here's a quick guide on how to install BibleTime.
BibleTime is a Bible study application for Linux. It is based on the K Desktop Environment and uses the Sword programming library to work with Bible texts, commentaries, dictionaries and books provided by the Crosswire Bible Society. BibleTime can run with GNOME too. You can install it using yum anytime as it also comes with GNU license.
BibleTime is available in several languages too. All of the language translation all listed on our translations page. The translations are available in the package bibletime-i18n. BibleTime FAQs can be seen from here.
Bibletime intergraded environment supports a full featured reading pane, full featured search tool, bookmarks and shortcut keys, viewing pane and toolbar customizations for multiple page viewing, display fonts and sizes are also included with the options. BibleTime currenly supports more than 30 major languages around and still currently expanded.
BibleTime also allows you to save the current viewpoint and pages currently being viewed before closing the application.
Quick installation.
INSTALLATION:
~~~~~~~~~~~~~~
# yum -y install bibletime
Yum installation would download around 2MB of package files and dependencies.
USAGE AND PROGRAM LAUNCH: Ctrl+F2, bibletime
During application startup, Bibletime initially prompts for remote installation of the remaining package and bible works from web to complete its software installation. From here, you can now specify and choose from which destination folder you wish to save it. Bookshelf files would be downloaded from Sword's remote site via FTP by clicking Connect to library as shown below:

At this point, you can optionally select your choice of language together with the downloads of remaining Bibletime works. Clicking Connect to Library button downloads all the remaining packages and language modules you have selected. This would take some time on slow connection. 
Bookshelf now then downloads your selected choice of language and additional bookshelf works from the web as shown below. This would not take time if you have a fast or broadband connection.
Furthermore, BibleTime prompts for optional configuration as shown below. A few of the configurable options you can choose from are BibleTime hotkeys, language module packs and display setup. You can get back from this option windows after successful installation.
Proceed by clicking Apply and OK for any changes made.
Finally, below is a running screenshot that shows two specific sections I personally chose from the BibleTime works. This sections have been tiled for wider and larger view of my screen.
One from Genesis 1:1 -
In the beginning God made the heaven and the earth. 2 But the earth was unsightly and unfurnished, and darkness was over the deep, and the Spirit of God moved over the water. 3 And God said, Let there be light, and there was light.
And another one from Revelation of John 1:1
[The] revelation of Jesus Christ, which God gave to Him to show to His slaves what [things are] necessary to occur with quickness. And He made [it] known, having sent through His angel to His slave John,
2 who testified to the word of God and to the testimony of Jesus Christ, as many [things] as he also saw.
3 ¶ Happy [or, Blessed] is the one reading [to the assembly] and the ones hearing the words of the prophecy and keeping [or, obeying] the [things] having been written in it, for the time [is] near!
Enjoy and cheers.
Posted by
VeRTiTO
at
7:40 AM
0
comments
Links to this post
Labels: HowTos
human readable DVD/CD drive technical details
Getting a brief and more verbose details of your DVD/CD drive technical data is not really simple to understand and interpret.
This blog entry provide more information incase you are currently experiecing DVD/CD drive linux detection or even DVD/CD drive malfunctioning. There's an instance wherein your currently detected DVD/CD drive is mishaving or malfunctioning. INt in a way it is not doing what it is expected to do.
Here's a quick linux command to retrieve DVD/CD drive details.
USAGE
~~~~~~
# cd-drive
Here's a long list of technical data shown in a human readable form.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The driver selected is GNU/Linux
The default device for this driver is /dev/cdrom
Drivers available...
GNU/Linux ioctl and MMC driver
cdrdao (TOC) disk image driver
bin/cuesheet disk image driver
Nero NRG disk image driver
CD-ROM drive supports MMC 3
Drive: /dev/cdrom
Vendor : LITE-ON
Model : DVD SHD-16P1S
Revision : GS03
Profile List Feature
Read only DVD
Core Feature
ATAPI interface
Morphing Feature
Operational Change Request/Notification not supported
Synchronous GET EVENT/STATUS NOTIFICATION supported
Removable Medium Feature
Tray type loading mechanism
can eject the medium or magazine via the normal START/STOP command
can be locked into the Logical Unit
Random Readable Feature
Multi-Read Feature
CD Read Feature
C2 Error pointers are supported
CD-Text is supported
DVD Read Feature
DVD+RW Feature
DVD+R Feature
DVD+R Double Layer Feature
Initiator- and Device-directed Power Management Feature
CD Audio External Play Feature
SCAN command is not supported
audio channels can be muted separately
audio channels can have separate volume levels
256 volume levels can be set
Ability for the device to accept new microcode via the interface Feature
Ability to respond to all commands within a specific time Feature
Ability to perform DVD CSS/CPPM authentication via RPC Feature
CSS version 1
Ability to read and write using Initiator requested performance parameters Feature
Vendor-specific code 10b Feature
Hardware : CD-ROM or DVD
Can eject : Yes
Can close tray : Yes
Can disable manual eject : Yes
Can select juke-box disc : No
Can set drive speed : No
Can read multiple sessions (e.g. PhotoCD) : Yes
Can hard reset device : No
Reading....
Can read Mode 2 Form 1 : Yes
Can read Mode 2 Form 2 : Yes
Can read (S)VCD (i.e. Mode 2 Form 1/2) : Yes
Can read C2 Errors : Yes
Can read IRSC : Yes
Can read Media Channel Number (or UPC) : Yes
Can play audio : Yes
Can read CD-DA : Yes
Can read CD-R : Yes
Can read CD-RW : Yes
Can read DVD-ROM : Yes
Writing....
Can write CD-RW : No
Can write DVD-R : No
Can write DVD-RAM : No
Can write DVD-RW : No
Can write DVD+RW : No
CD-ROM drive supports MMC 3
Drive: /dev/dvd
Vendor : LITE-ON
Model : DVD SHD-16P1S
Revision : GS03
Profile List Feature
Read only DVD
Core Feature
ATAPI interface
Morphing Feature
Operational Change Request/Notification not supported
Synchronous GET EVENT/STATUS NOTIFICATION supported
Removable Medium Feature
Tray type loading mechanism
can eject the medium or magazine via the normal START/STOP command
can be locked into the Logical Unit
Random Readable Feature
Multi-Read Feature
CD Read Feature
C2 Error pointers are supported
CD-Text is supported
DVD Read Feature
DVD+RW Feature
DVD+R Feature
DVD+R Double Layer Feature
Initiator- and Device-directed Power Management Feature
CD Audio External Play Feature
SCAN command is not supported
audio channels can be muted separately
audio channels can have separate volume levels
256 volume levels can be set
Ability for the device to accept new microcode via the interface Feature
Ability to respond to all commands within a specific time Feature
Ability to perform DVD CSS/CPPM authentication via RPC Feature
CSS version 1
Ability to read and write using Initiator requested performance parameters Feature
Vendor-specific code 10b Feature
Hardware : CD-ROM or DVD
Can eject : Yes
Can close tray : Yes
Can disable manual eject : Yes
Can select juke-box disc : No
Can set drive speed : No
Can read multiple sessions (e.g. PhotoCD) : Yes
Can hard reset device : No
Reading....
Can read Mode 2 Form 1 : Yes
Can read Mode 2 Form 2 : Yes
Can read (S)VCD (i.e. Mode 2 Form 1/2) : Yes
Can read C2 Errors : Yes
Can read IRSC : Yes
Can read Media Channel Number (or UPC) : Yes
Can play audio : Yes
Can read CD-DA : Yes
Can read CD-R : Yes
Can read CD-RW : Yes
Can read DVD-ROM : Yes
Writing....
Can write CD-RW : No
Can write DVD-R : No
Can write DVD-RAM : No
Can write DVD-RW : No
Can write DVD+RW : No
CD-ROM drive supports MMC 3
Drive: /dev/scd0
Vendor : LITE-ON
Model : DVD SHD-16P1S
Revision : GS03
Profile List Feature
Read only DVD
Core Feature
ATAPI interface
Morphing Feature
Operational Change Request/Notification not supported
Synchronous GET EVENT/STATUS NOTIFICATION supported
Removable Medium Feature
Tray type loading mechanism
can eject the medium or magazine via the normal START/STOP command
can be locked into the Logical Unit
Random Readable Feature
Multi-Read Feature
CD Read Feature
C2 Error pointers are supported
CD-Text is supported
DVD Read Feature
DVD+RW Feature
DVD+R Feature
DVD+R Double Layer Feature
Initiator- and Device-directed Power Management Feature
CD Audio Exte
rnal Play Feature
SCAN command is not supported
audio channels can be muted separately
audio channels can have separate volume levels
256 volume levels can be set
Ability for the device to accept new microcode via the interface Feature
Ability to respond to all commands within a specific time Feature
Ability to perform DVD CSS/CPPM authentication via RPC Feature
CSS version 1
Ability to read and write using Initiator requested performance parameters Feature
Vendor-specific code 10b Feature
Hardware : CD-ROM or DVD
Can eject : Yes
Can close tray : Yes
Can disable manual eject : Yes
Can select juke-box disc : No
Can set drive speed : No
Can read multiple sessions (e.g. PhotoCD) : Yes
Can hard reset device : No
Reading....
Can read Mode 2 Form 1 : Yes
Can read Mode 2 Form 2 : Yes
Can read (S)VCD (i.e. Mode 2 Form 1/2) : Yes
Can read C2 Errors : Yes
Can read IRSC : Yes
Can read Media Channel Number (or UPC) : Yes
Can play audio : Yes
Can read CD-DA : Yes
Can read CD-R : Yes
Can read CD-RW : Yes
Can read DVD-ROM : Yes
Writing....
Can write CD-RW : No
Can write DVD-R : No
Can write DVD-RAM : No
Can write DVD-RW : No
Can write DVD+RW : No
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Posted by
VeRTiTO
at
6:16 AM
0
comments
Links to this post
Labels: HowTos
sound-juicer - alternative audio CD ripper install
Here's a lean, clean and simple alternative on CD ripping tools particularly for multimedia and audio CDs.
sound-juicer is a lean GNOME-desktop CD ripper and GNOME player using GStreamer which aims to have a simple, clean, easy to use interface. sound-juicer has feature to save audio CDs to Ogg/vorbis format. sound-juicer currently supports encoding to several popular audio formats such as Ogg Vorbis and FLAC, additional formats can be added through GStreamer plugins.
Sound-juicer package is currently available in Debian, RedHat, Fedora, Mandrake, and Suse. You may visit the site for any additional linux distros.
INSTALLATION
~~~~~~~~~~~~
Here's how to install this audio CD ripper.
# yum -y install sound-juicer
BINARY LAUNCH:
Ctrl+F2, sound-juicer
Sample screenshot:![]()

Further reading can be found here.
Posted by
VeRTiTO
at
6:00 AM
0
comments
Links to this post
Labels: HowTos
Stellarium - watch the sky from Linux
Stellarium is a real-time 3D photo-realistic nightsky renderer. It can generate images of the sky as seen through the Earth's atmosphere with more than one hundred thousand stars from the Hipparcos Catalogue, constellations, planets, major satellites and nebulas.
Atlast, using Fedora Linux, Stellarium awakens my long-sleeping interests and passion with stars, lunars, astronomy, skies and other sky gazing bodies of galactical space. Stellarium shows a realistic sky in 3D mode, just like what you are seeing from a naked eye, binoculars or a telescope or even from your PC. This wonderful astronomical software is way too nice not to be installed from your linux box. If you are interested with star gazing moments during weekends or Sundays, this is the time to stargazed the sky right from your fingertips!
The Stellarium software comes as an opensourced cross-platform astronomical package. Stellarium can be installed from Macs, Windows, and Linux systems. Stellarium runs smoothly to Fedora linux with small memory foorprints that gives you a more rendered day and night sky visions. You can actually adjust and select a timeframe of the day or phase of Earth's movement to be referenced as your current viewpoint. Using this Stellarium feature, viewing the sky at sunrise, sunset, midnight, or early afternoon and viewing it above the ocean, under the trees, over the moon, or even from any country location can be done easily and instantly using Stellarium.
The installation process is as easy as 1 and 2. Read more from below.
INSTALLATION:
~~~~~~~~~~~~~
# yum -y install stellarium
This would download more than 30MB of package installer.
STEALLARIUM USER GUIDES:
~~~~~~~~~~~~
Stellarium comes with separate user guide package. It contains everything you want to know with Stellarium. If you wish to install stellarium user guides, here's how to install it.
# yum -y install stellarium-doc
STELLARIUM FEATURES
~~~~~~~~~~~~~~~~~~~~~
Here are more features of Stellarium:
Features (in version 0.9.0)
* default catalogue of over 600,000 stars
* extra catalogues with more than 210 million stars
* asterisms and illustrations of the constellations
* images of nebulae (full Messier catalogue)
* realistic Milky Way
* very realistic atmosphere, sunrise and sunset
* the planets and their satellites
Interface
* a powerful zoom
* time control
* multilingual interface
* scripting to record and play your own shows
* fisheye projection for planetarium domes
* spheric mirror projection for your own dome
* graphical interface and extensive keyboard control
* telescope control
Visualisation
* equatorial and azimuthal grids
* star twinkling
* shooting stars
* eclipse simulation
* skinnable landscapes, now with spheric panorama projection
Here are sample web screenshots:

And from my own screenshots:



What are you waiting for, do the yum thing now.
Posted by
VeRTiTO
at
12:01 AM
0
comments
Links to this post
Labels: HowTos
Wednesday, August 29, 2007
Munin - monitor linux hosts install howto
How to monitor server and client hosts using munin?
How to install munin as graph server and as client node host?
How to configure munin as a server and as a client?
How to graph data and statistics using munin in linux?
How to have MRTG-like monitoring graph in linux?
Munin is a highly flexible and powerful solution used to create graphs of virtually everything imaginable throughout your network, while still maintaining a rattling ease of installation and configuration.
This package contains data grapher that gathers data. You will only need one instance of it in your network. It will periodically poll all the nodes in your network it's aware of for data, which it in turn will use to create graphs and HTML pages, suitable for viewing with your graphical web browser of choice.
Munin can run in two monitoring modes, as a munin graph server watching current host from where it is currently installed, or a munin node being monitored by munin grap server.
Munin is written in Perl, and relies heavily on Tobi Oetiker's excellent RRDtool. Munin generates apache graph using this RRDTool. Munin also supports API plugins feature which currently are still being enhanced.
This entry covers Munin installation and configuration guides for Fedora 7 to monitor a host. This steps should work fairly fine with later Fedora versions and CentOs 4.x versions.
By default munin installation, munin can monitor and graph the following:
a. Filesystem usage on daily and weekly graph
b. Inode usage on daily and weekly graph
c. IOStat usage on daily and weekly graph
d. MySQL throughput on daily and weekly graph
e. MySQL queries on daily and weekly graph
f. MySQL slow queries on daily and weekly graph
g. MySQL threads on daily and weekly graph
i. Network interfaces usage, traffic and error statistics on daily and weekly graph
j. Netstat usage on daily and weekly graph
k. NFS server usage on daily and weekly graph
l. Postfix mail queue on daily and weekly graph
m. Fork rate usage on daily and weekly graph
n. VMStat usage on daily and weekly graph
o. System process on daily and weekly graph
p. Sendmail mail queue, mail traffic, email volumes on daily and weekly graph
q. CPU usage, entropy, interrupts, context switches on daily and weekly graph
r. Load average, memory usage, file table usage on daily and weekly graph
s. Inode table, swap Ins/Outs usage on daily and weekly graph
and more plugins to come!
INSTALLATION STEPS
==================
MUNIN GRAPH (SERVER) INSTALLATION MODE
------------------------------------
If you wish to install munin as a stand-alone munin graphing server and gather data only from where it would be installed, simply do the below munin graph server installation like so
# yum -y install munin
MUNIN NODE (CLIENT) INSTALLATION MODE
------------------------------------
But if you wish that your other host or node be monitored by a munin graph server, you need to install munin-node on that client host like so
# yum -y install munin-node
Doing the below installation for the munin graph server like so
# yum -y install munin munin-mode
would be just fine.
MUNIN GRAPH SERVER CONFIGURATION
--------------------------
After successful yum munin server installation, take note that this munin package
a. creates /var/www/html/munin folder as default munin home page folder
b. creates /etc/munin/* folder and configuration files
c. creates munin user account with /sbin/nologin shell
d. create a cronjob in /etc/cron.d/munin
e. does not open port 4949 from current linux firewall
And it creates a default /etc/munin/munin.conf values like show below
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
dbdir /var/lib/munin
htmldir /var/www/html/munin
logdir /var/log/munin
rundir /var/run/munin
tmpldir /etc/munin/templates
[localhost]
address 127.0.0.1
use_node_name yes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using the above values is enough for munin to act as a graph server from where it was installed.
http://host-ip-address/munin/
Munin creates graph in per second values, if you wish to modify it and change it for per minute,you need to edit /etc/munin/munin.conf and uncomment this line
graph_period minute
You need to allow the IP address where the munin graph server is running and add it to /etc/munin-node.conf. This can be done by adding
allow ^123\.123\.123\.1233$
assuming your munin graph server has an IP address of 123.123.123.123 .
Editing /etc/munin/munin-node.conf and adding the IP address of munin graph server should be done from all host of munin node client installation.
It is assumed here that both your crontab utility and apache web server services are currently running without any problems.
Now, follow the next steps
# chown munin.munin /var/www/html/munin -R
Restart your apache and crontab utility from munin grap server like so
# service httpd restart ; service crond restart
and restart the munin from the node host like so
# service munin-node restart
Give it some time for like 5 minutes and fire up your fave browser and point it to http://host-ip-address/munin/.
The browser should be able to show you the recently generated graph.
ADD NEW MUNIN CLIENT
~~~~~~~~~~~~~~~~~~~~
If you wish to add more host nodes to be included with munin graph server, launch your fave editor and edit /etc/munin/munin.conf from the munin graph server. Add the new host node like so
[newnode.domain.com]
address 192.168.0.154
user_node_name yes
Make sure you have added the IP address of munin graph server from /etc/munin/munin-node.conf from all munin node client hosts.
If your munin client host has more than one IP address and you wish to bind munin-node in one interface only, you can edit the line
host *
from /etc/munin/munin-node.conf and put your selected ethernet IP address.
If you wish to change the port number where munin will fetch and listen for stats, this can also be done by editing
port 4949.
Make sure your that this TCP port is open from current firewall settings of all munin node client.
Restart munin-node service and firewall from munin node clients like so
# service munin-node restart
# service iptables restart
Make sure all munin node hosts are network reachable by the munin graph server.
And you're done.
See my sample screenshots:


Posted by
VeRTiTO
at
3:21 PM
0
comments
Links to this post
Labels: HowTos
blocking yahoo chat messenger
A very old tip and trick on blocking yahoo chat messenger from connecting to internet, as per request.
Considering an approved management policies, there are several ways to block yahoo chat messenger from connecting to internet coming from inside your network, depending on what equipment and boxes you have on ground.
If you happen to have an approved global policy to totally block yahoo messenger from any internal systems, you can implement a network-wide blocking of yahoo chat messenger at the router level.
But if you happen not to have core routers from your network and your current connection is just being shared and NATted via your linux proxy box, blocking yahoo chat messenger is easy and possible by implementing it proxy-wide or individually per IP using linux proxy and firewall.
Firewall comes in many names in linux. With Fedora, the name of the firewall is called iptables by default, a successor long after ipchains reigned with RedHats.
If you are going to block yahoo chat messenger or any software from connecting to the web, basically, gathering port numbers and protocols being used by yahoo chat messenger or by that specific software needs to be established and listed out first.
Here are the known yahoo chat messenger (YM) ports
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
TCP Port 5050
TCP Port 5000-5001
UDP Port 5000-5010
TCP Port 5100 (webcam)
TCP Port 5101 (p2p)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Blocking all yahoo chat servers is not advisable as some company IT infrastructures make use of clustered servers with round-robin and/or load-balancing approach for these ports and/or web services requests from end users, thus new servers would not be blocked until you informed yourself immediately.
USING IPTABLES FIREWALL from Fedora
-----------------------------------
Following the port numbers and protocols mentioned above, you can append these line into your /etc/sysconfig/iptables to block YM from connectin to web via linux iptables like so
Additional lines for /etc/sysconfig/iptables
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 5000:5001 -j DROP
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 5050 -j DROP
-A RH-Firewall-1-INPUT -p udp -m udp --dport 5000:5010 -j DROP
-A RH-Firewall-1-INPUT -p tcp -m tcp --dport 5100:5101 -j DROP
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
USING SQUID from Fedora
-----------------------------------
An entry of Squid installation and setup would be done separately on another entry sooner or later. But, the above mentioned iptables YM block rules can also be defined and implemeneted into Squid access list.
If the clients are all using Squid for transparent connection, additinally the next Squid access list can also be added to /etc/squid/squid.conf. There is not further changes needed from the client PC.
Additional lines for /etc/squid/squid.conf
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
acl YM_ports port 5100
acl YM_ports port 5101
acl YM_ports port 5050
acl YM_ports port 5000-5010
http_access deny YM_ports
http_access deny CONNECT YM_ports
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After doing changes with your conf files, make sure you restart the said service like so
# service iptables restart
# service squid reload
USING Access List from Cisco Routers
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From router level, blocking YM can also be done using Cisco access list. Blocking by IP address, port numbers, destination and more are all possible with Cisco ACLs. Unfortunately, my apology for not listing it out here as that would not be linux related. :(
OTHER WAYS
~~~~~~~~~~~
Blocking Yahoo Chat messenger can also be done with different linux softwares like IPChains, IPCop, SquidGuard, Dansguardian and more. Additionally, this can also be done with all bandwidth control and monitoring appliances around the web.
Generally speaking, blocking YM takes TCP port numbers and protocol types. Doing it is a rule of thumb on blocking softwares from connecting to WWW.
Hope this fires up a starting point from your box, balu.
PS
Better to have this late blog reply than never, goodluck then.
Related Posts:
How To See Invisible YM Users
How To Setup Chikka SMS Messenger using Kopete Messenger
How to Install and Setup Google Chat Messenger
How To Setup Chikka SMS Messenger using GAIM Pidgin
How To Install GAIM Pidgin Messenger
How To Install KDE Kopete Messenger
How To Install AMSN Messenger
How To Setup and Install PSI Chat Messenger
Posted by
VeRTiTO
at
10:53 AM
0
comments
Links to this post
Labels: HowTos
Tuesday, August 28, 2007
string manipulation using cut linux command
Another way to parse and manipulate string characters is by using linux command cut.
Man page says
Cut removes sections from each line of files. Cut writes to standard output selected parts of each line of each input file, or standard input if no files are given or for a file name. An exit status of zero indicates success, and a nonzero value indicates failure.
Here are several examples of using cut linux command.
Sample 1:
Returns the first set of word marking space ' ' as a columnar separator
# who am i
returns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
root pts/2 2007-08-27 06:23 (:0.0)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Using cut for getting the first word 'root' would be
# who am i | cut -f1 -d' '
Sample 2:
Linux /etc/passwd password file is consists of many fields like username, groupid, name, and more. The fields are normally separated by a field : (colon) . To retrieve or list down all usernames from /etc/passwd password file would be like
# cut -d: -f1 /etc/passwd
Sample 3:
By specifying space ' ' as the delimited character or field marker to separate set of words, the below sample then instructs to cut the remaining words separated by space character and to retain only words from 1st, 2nd, 7th and 8th columnar position like so
# echo "I like bayabas, I always watch sesame street." | cut -d' ' -f1,2,7,8
would have a output return of
~~~~~~~~~~~~~~~~~~~~~~~~~
I like sesame street.
~~~~~~~~~~~~~~~~~~~~~~~~~
Sample 4.
Cut can trim down phrases too by specifying the Nth positional character which needs to be retained like so
# echo "I know Linux is good." | cut -c 8-
would have a return of
~~~~~~~~~~~~~~~~~~~~~~~
Linux is good.
~~~~~~~~~~~~~~~~~~~~~~~
Sample 5.
Another string parsing example using cut is by specifying a starting point from Nth position with an ending Nth positional character point. This would be like like FROM to TO like so
# echo "I know Linux is good." | cut -c 8-12
would also have a return of
~~~~~~~~~
Linux
~~~~~~~~~
Lastly, reversing the specification of FROM and TO would be and retaining the rest of the words like so
# echo "I know Linux is good." | cut -d' ' -f3,4 --complement
We removed the 3rd and 4th field from words separated by space ' ' character. This would return
~~~~~~~~~~~~~~~
I know good.
~~~~~~~~~~~~~~~
Cheers
Posted by
VeRTiTO
at
11:22 AM
0
comments
Links to this post
Labels: HowTos
graphing skystream DVB receiver's Eb/No and signal strength
What is Skystream DVD receiver?
What is the OID variable ID for Eb/No and signal strength values of Skystream DVB receiver?
What are the statistical values available from Skystream DVB receiver?
How to retrieve Eb/No value from Skystream DVB satellite receiver box from linux terminal?
How to retrieve signal strength value from Skystream DVB receiver box from linux terminal?
How to retrieve statistical values from non-SNMP variable of Skystream DVB from terminal?
How to create and generate a Eb/No and signal strength MRTG graph of Skystream DVD receiver?
One telecom and satellite device that still works inside my work area is SkyStream DVB receiver. Skystream DVB receivers are box appliances that make use and boot up from a customized modified linux-based kernel. This VSAT equipment is usually inserted and plugged between satellite dish connectivity and core firewalls and/or core routers, that is if you are managing broadband satellite networks.
This document entry is here to cover and monitor statistical values fetched from Skystream media routers. Google spiders, as of this writing, failed to show these OID variables and Skystream MIB variable files for further polling Skystream's Eb/No and signal strength values particularly from EMR-1600, EMR-5000, and EMR-5500 Skystream DVB receiver models.
SkyStream DVB Receiver Statistical Values
==========================================
Sourced from DVB TOC file.
The Satellite Receiver statistics page shows information gathered from the unicast and multicast streams forwarded to the EMR from the Satellite Receiver. The Satellite Receiver page contains the following information:
* LNB Mode: Shows current mode as None, Single, or Dual.
* L-Band Frequency: Shows the L-Band frequency setting for the tuner.
* 22kHz Switch: Shows if 22kHz Switch is enabled, disabled or set to automatic.
* Symbol Rate: Shows the number of symbols per second being received through the tuner. This parameter can be set in Preferences as either megasymbols or kilosymbols.
* LNB Voltage Control (polarization): Shows if the polarization is set to Vertical Right or Horizontal Left.
* LNB Offset: Displays the frequency offset of the LNB in megahertz.
* Viterbi Rate: Indicates the Forward Error Correction (FEC) ratio of payload bits to the total number of bits. For example, if FEC=3/4, then for every 4 bits, 3 bits are actual data and 1 bit is overhead for error correction.
* Channel Bit Rate: Shown as Mbps— "useful bandwidth" is a calculation using the following formula; symbol rate x 2 x viterbi rate 188/204.
* QSPK Spectral Inversion: Shows as "Normal-Not Inverted" or "Inverted" this is automatically detected from the signal.
* Signal Lock (QPSK Lock): A green bar with the word LOCK will appear when the frequency and symbol rate are locked. If the signal cannot be locked, the bar will be grayed out.
NOTE For some models, BPSK or QBSK can be selected from Maintenance—Preferences, Advanced Preferences.
* Data Lock (FEC Lock): A green bar with the word LOCK will be displayed if Symbol Rate, L-Band Frequency, and FEC are set properly. If data cannot be locked, a red bar is displayed with the words "NO LOCK" in the bar.
* MPE Lock: A green bar with the word LOCK will be displayed if data with an MPE header is being received. If data cannot be locked, a red bar is displayed with the words "NO LOCK" in the bar.
* Signal Strength: Shows a value and percentage for the signal strength being received from the satellite (-25 dBm to -65 dBm).
* Eb/N0: Displays the signal to noise ratio value detected by the Satellite Receiver in decibels.
* QPSK Bit Error Rate: Displays the measured QPSK bit error rate.
* Viterbi Bit Error Rate: Displays the measured error rate from the FEC algorithm.
* Reed Solomon Corrected Errors: Shows the errors that were fixed using the Reed Solomon algorithm. These errors indicate that some data was corrupted and then corrected. Errors are collected over time and will continue to build; a button is included on this page to clear the error counters.
* Reed Solomon Uncorrected Errors: Displays the total number of errors that the Reed Solomon Correction Algorithm detected but was unable to correct.
Skystream website is now part of Tandberg Television.
GOAL:
Retrieve Eb/No and signal strength values from any web-enabled satellite DVB receiver devices and media routers for further long-term graphing, analysis and monitoring.
STEPS:
A simple workaround solution using linux commands via terminal.
WORKAROUND SOLUTION WITHOUT USING SNMP:
Fireup your terminal and issue the command as follow
# elinks -dump 1 -auth=emrYOURusername:emrYOURpassword "http://YOUR-DVB-IP/cgi-bin/statistics?page=sat&session=sat"
As usual, changes needs to be done from the above shown commands:
emrYOURusername = would be admin's username
emrYOURpassword = would be admin's password
YOUR-DVB-IP = dvb's IP address
Resulting sample output:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Satellite Receiver Statistics
Parameter Satellite Receiver 1
LNB Mode None
L-Band Frequency 1000.0000 MHz
22kHz Switch Disabled
Symbol Rate 27.0047 Msymbols/s
LNB Voltage Control (polarization) Vertical - Right
LNB Offset 0.1650 MHz
Viterbi Rate 7/8
Channel Bit Rate 43.5517 Mbps
QPSK Spectral Inversion Normal - Not Inverted
Signal Lock (QPSK Lock) LOCK
Data Lock (FEC Lock) LOCK
MPE Lock LOCK
Signal Strength 72 %
Eb/N0 15.0277 dB
QPSK Bit Error Rate 0.0000
Viterbi Bit Error Rate 0.0000
Reed-Solomon Corrected Errors 0
Reed-Solomon Uncorrected Errors 7
Auto Refresh (_) Enable (_) Disable
Auto Interval ___ Sec [BUTTON] [BUTTON]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As you can see from above, these resulting output is supposed to be viewed as HTML page from browsing the IP address of the said box.
Using this linux command lynx, we have just dumped out the page into our screen. Basically, the important numerical value that is needed here are Eb/No and signal strength values.
Now, further string manipulation command is required if you wish to get t
he numerical value of Eb/No and signal strength. String manipulation in linux can be done many ways.
Here's one way to do it. From the last issued command, you just need to append linux filtering commands grep. By piping last screen output as an input to grep would be as follows
| grep 'Eb/N0\|Signal Strength'
to make the first linux command to look like
# elinks -dump 1 -auth=emrYOURusername:emrYOURpassword "http://YOUR-DVB-IP/cgi-bin/statistics?page=sat&session=sat" | grep 'Eb/N0\|Signal Strength'
This linux compounded commands would now give us what needed most, a 2 liner output like so:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Signal Strength 72 %
Eb/N0 15.0125 dB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you wish to feed this values into to MRTG scripts, further string manipulation is required.
Since we already know that the first value is the signal strength and the second value is the Eb/No., we need to remove the first 40 characters of each lines. This would be done using linux command cut like so
cut -c 40-
Then, fetching the first field like so
awk '{print $1}'
Finally we would arrive to a one shot linux command on getting Skystream DVB receiver's Eb/No and signal strength values, like so
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# lynx -dump -auth=emradmin:gulaydvb "http://YOUR-DVB-IP/cgi-bin/statistics?page=sat&session=sat" | grep 'Eb/N0\|Signal Strength' | cut -c 40- | awk '{print $1}'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Resulting output:
~~~~~~~~~~~~~~
72
15.0226
~~~~~~~~~~~~~~
which can be easily dumped to MRTG for further SNMP polling and graph generation. Using this approach, you can now graph and monitor the other Skystream DVB receivers's statistical values.
Additionally, creating graphs for skystream dvb's intel-based ethernet network cards would be simply done the normal way since ethernet cards for most appliances and boxes supports SNMP. Like shown below:
Now, google spiders can lead you to this page with regards to graphing Eb/No and signal strength from Skystream DVB receiver models.
Hope this helps.
Posted by
VeRTiTO
at
3:39 AM
0
comments
Links to this post
Labels: HowTos
Sunday, August 26, 2007
BZFlag - 3D multi-player tank game install howto
A very tactical nice 3D enabled multiplayer strategical linux battle tank game. The approach and skills required for this tank game appears to be similar to the strategy skills used from playing the old and famous tank game played under Nintendo boxes years ago. This nice battle tank game has much more 3D graphics and audio enhancements, runs in several OS platforms like Linux, Macs, Windows with easy installation steps. BZflag also allows you to create your own game server locally from network or even from internet game servers with customized tank and play settings.
BZFlag site describes:
BZFlag is a 3D multi-player tank battle game that allows users to play against each other in a networked environment. There are five teams: red, green, blue, purple and rogue (rogue tanks are black). Destroying a player on another team scores a win, while being destroyed or destroying a teammate scores a loss. Rogues have no teammates (not even other rogues), so they cannot shoot teammates and they do not have a team score. There are two main styles of play: capture-the-flag and free-for-all.
BZFlag is a free online multiplayer cross-platform open source 3D tank battle game. The name originates from "Battle Zone capture the Flag". It runs on Irix, Linux, *BSD, Windows, Mac OS X, and many other platforms. It's one of the most popular games ever on Silicon Graphics machines and continues to be developed and improved to this day. It's one of the most popular open source games ever. For more information, check out some of the reviews.
Easy installation steps of this multiplayer BZFlag 3D tank game. Issue the below commands
# yum -y install bzflag
Sample bzflag tank game screenshot:


Enjoy.
Posted by
VeRTiTO
at
11:44 PM
0
comments
Links to this post
Labels: HowTos
screenshot and snapshot creations howtos
How to create desktop screenshots from terminal?
How to create desktop screenshots from Linux X?
How to create thumbnail images of any picture file from terminal?
How to create thumbnail images of any picture file from Linux X?
How to create thumbnail screenshot of a page from terminal?
How to capture portion of the screen using Linux X?
How to capture portion of the screen using terminal?
How to resize any image file from terminal?
How to convert picture file formats from terminal?
How to convert PNG to JPG from terminal?
How to convert PNG to GIF from terminal?
How to install ImageMagick?
How to install KSnapShot?
How to create screenshots using ksnapshot?
How to create screenshots using gnome-screenshot?
Here are several ways to create desktop screenshot in Fedora Linux.
How to create desktop screenshots from terminal?
How to install ImageMagick?
# yum -y install ImageMagick
To selectively capture a portion of the screen using terminal, issue
# import test.png
# import test.jpg
and drag the mouse to select portion of the screen to be captured by import command.
A sample screenshot creation done from terminal 
To capture a 800x640 screen size of the screen using import from terminal, issue
# import -window root -geometry 800x640 test.png
To capture a 800x640 screen size after 5 seconds, simply
# sleep 5; echo Capturing screenshot... ; import -window root -geometry 1024x640 test.png
or
# import -window root -geometry 800x640 -pause 5 test.png
How to create thumbnail images of any picture file from terminal?
How to create thumbnail screenshot of a page from terminal?
How to convert an image from PNG to JPG from terminal using mogrify linux command?
How to convert an image from PNG to GIF from terminal using convert linux command?
How to resize any image file from terminal?
How to convert picture file formats from terminal?
Create a wide screen shot first
# import -window root test.png
Convert existing PNG to JPG and create a 250x90 thumbnail image at the same time
# mogrify -format jpg -auto-orient -thumbnail 250x90 test.png
Convert existing PNG to GIF and craete a 250x90 thumbnail snapshot
# convert test.png -auto-orient -thumbnail 250x90 test.gif
Sample converted thumbnail screenshot.![]()
Create a thumbnail screenshot.
# import -window root -geometry 250x90 test.png
Sample thumbnail screenshot of an opened terminal.![]()
How to create desktop screenshots from linux X?
Press Alt+Printscreen key to capture and create an image of the current active window.
Press Printscreen to capture and create a screenshot of the whole screen
How to install ImageMagick?
# yum -y install ImageMagick
How to install KPhotoAlbum.i386?
# yum -y install kphotoalbum.i386
How to create screenshots using ksnapshot?
How to capture screen portion/section from Linux X using ksnapshot?
How to create screenshots using ksnapshot?
How to create screen snapshots?
# ksnapshot
and choose Portion of the Screen from dropdown bar
How to create screenshots using gnome-screenshot?
# gnome-screenshot --interactive
More import readings from here.
That's it.
Posted by
VeRTiTO
at
10:56 PM
0
comments
Links to this post
Labels: HowTos
string parsing using bash
Unfortunately, Google doesn't know about this.
Even Google global indexes doesn't refer to any link with regards to this entry and topic. Interesting but weird.
~~~~~~~~~~~~~~~~~~~~
#!/bin/bash
var1=`ifconfig eth0`
var2=${var1#*addr:}
var2=${var2%% *}
~~~~~~~~~~~~~~~~~~~~
The output of the above bash script when executed would be the current IP address of eth0.
String parsing can be done using special bash characters as shown with the above bash script sample. The string parsing shown above can also be done directly from terminal like so
# var1=`ifconfig eth0` ; var2=${var1#*addr:} | echo ${var2%% *}
%%, % and #* are the special bash character search commands.
Now, the next question is how fast google indexes the web? I am going to measure it by publishing this post, I know Google indexes this entry so fast which I don't know why. I need to see if Google algorith can tag these characters as a bell for search queries as well.
STORY:
Before I started this blog entry. Searching Google DOES NOT give me any results from searching ANY character combinations shown below. I have searched it one line at at time and leads to ZERO result. See my search quries
"%%"
%%
"#*"
#*
##
"##"
*
#
Google index also suggested that I should remove quotes and results are all the same, NOT FOUND. I am posting my search screenshots below referring to NOT FOUND results by Google using the above search keyword.
So that we can conclude
a. If these characters are special for Google and removes them from any search keywords or character before searching global indexes.
b. After posting this entry, if Google global indexes can return something or refer to this blog entry right after several minutes of posting this? That basically means Google spiders knows these character keywords and therefor Google does not have it from their indexes before this blog entry was posted! Interesting.



Google not found search link 1, search 2, search 3,, search 4, yes google spiders failed to return results, perhaps its a special character for google algorithm as well. :)
I would edit this page back again IF and ONLY IF Google returns and crawls those special characters from this entry. And IF Google refers to this blog entry when somebody searches for those search key characters. :)
Later.
Posted by
VeRTiTO
at
6:13 AM
0
comments
Links to this post
Labels: HowTos
grep multiple character from string or file
This entry focus on filtering sets of character from string or from text file using grep.
Here's a quick usage of parsing and filtering multiple character using grep.
Say we have a sample testfile.txt that contains the following text data.
# cat testfile.txt
~~~~~~~~~~~~~~~~~~~~~~~~~
1 linux command line
2###########
3$$$$$$$$$$$
this is number 4
5 terminal
~~~~~~~~~~~~~~~~~~~~~~~~~
And we want to grep those lines that contain these three characters #4$
Here's how to quick do the task.
# grep '[:#4$]' testfile.txt
would give you a resulting lines of
~~~~~~~~~~~~~~~~~~~~~~
2###########
3$$$$$$$$$$$
this is number 4
~~~~~~~~~~~~~~~~~~~~~~
As you can see from above results, each lines containta one of the following chatacters:
#
4
$
This is applicable when you need to search for specific set of characters from string or file.
If you wish to grep for multiple set of strings using grep, you read it here.
Posted by
VeRTiTO
at
5:33 AM
0
comments
Links to this post
Labels: HowTos
enable and disable of telnet service
Telnet - user interface to the TELNET protocol
The telnet command is used to communicate with another host using the TELNET protocol. If telnet is invoked without the host argument, it enters command mode, indicated by its prompt ( telnet>). In this mode, it accepts and executes the commands listed below. If it is invoked with arguments, it performs an open command with those arguments.
Here's how to disable telnet from Fedora inet services.
Verify that your telnet service is currently running like so:
# telnet localhost 23
If the above command prompts your for username or password, yout telnet service is currently active.
Alternative ways to check for telnet service are as follow
# ss -a | grep telnet
# netstat -l | grep telnet
How to stop telnet service in Fedora?
# cd /etc/xinetd.d
Edit krb5-telnet and modify the below line
disable = no
TO
disable = yes
and restart INET service like so
# service xinetd restart
Verify that telnet service is not running anymore.
# ss -a | grep telnet
Done.
Posted by
VeRTiTO
at
12:59 AM
0
comments
Links to this post
Labels: HowTos
Saturday, August 25, 2007
grep multiple strings from a file
Supposed you need to filter different search filter words from a large text file.
Here's a quick entry that covers parsing and filtering multiple strings using grep in a command line.
Grep Multiple Strings From a File
My sample text looks like this# cat testfile.txt
~~~~~~~~~~~~~~~~~~~~~~~~
apple1
The quick brown fox
apple2
asd
The quick brown fox
apple3
asd
apple4
The quick brown fox
asd
~~~~~~~~~~~~~~~~~~~~~~~~
Here's how to grep multiple search string from a file?
Assuming that we need to filter out the below words from the above file.
apple1
apple2
apple3
apple4
Here's a quick way to filter multiple words from a string or file.
# cat testfile.txt | grep "apple1\|apple2\|apple3"
This gives you all lines with words apple1, apple2 and apple3.
If you wish to grep multiple strings for an exact match from string or file, follow through:
# cat testfile.txt | grep -w "apple1\|apple2\|apple3"
All is done.
Posted by
VeRTiTO
at
11:01 PM
0
comments
Links to this post
Labels: HowTos
remove spaces from filenames
Let us assume that we have a situation where in your boss wants you to remove all spaces from his MP3/OGG/WMV/MPG filenames and replace them with underscore character. To accomplish this task of replacing space character with underscore character is real easy for a common linux task and can be easily done using linux renaming tool command mv.
Now, picture that renaming and removing spaces from 100,000 MP3 filenames or any other multimedia file names?
How to rename multiple files?
How to rename multiple thousand files?
How to convert all lowercase alpha characters to uppercase from thousand filenames?
Ding! Here's how to accomplish these task.
Basically, replacing space character with underscore from the filename of a file is simple and would be done like so
# mv "file with space.mp3" file_with_space.mp3
Now, the next command assumes that you have thousands of hundred of thousands MP3 files with spaces between its filenames. And you want to remove space character and replace them with underscores. Just make sure you are currently inside the working folder of these MP3 files and issue
# for files in *.mp3; do mv "$files" `echo $files | tr ' ' '_'`; done
Wonderful linux.
Now, here's another one shot command to convert all lowercase filenames into uppercase filenames using the above approach plus tr linux command. tr is a string manipulation linux command and discussed here.
How to convert lower case filenames to uppercase filenames of hundred thousand files in one shot?
# for files in *.mp3; do mv "$files" `echo $files | tr '[:lower:]' '[:upper:]'`; done
You can replace *.mp3 with any other filename identifier or file glob.
Have a nice weekend with clicks to all! :)
Posted by
VeRTiTO
at
3:02 AM
0
comments
Links to this post
Labels: HowTos
ISO creation and CD/DVD burning from terminal
How to create ISO images from terminal?
How to create CD/DVD ISO image of files/folder from terminal?
How to create CD/DVD ISO image of CD/DVD disk from terminal?
How to burn ISO image file into floppy or CD/DVD disk from terminal?
How to burn ISO image file into floppy or CD/DVD disk from Gnome F7?
How to burn DVD .IMG file to DVD disk from terminal?
How to blank fast and erase files from CD-RW/DVD-RW disk from terminal?
How to mount/unmount ISO image from terminal?
How to create MD5 checksum of ISO image file from terminal?
How to verify MD5 checksum of ISO image file from terminal?
This blog entry assumes these below topics:
a. creation and verification of ISO image files
b. CD/DVD burning of ISO/IMG image files
c. mounting and unmounting of ISO image files
Here you go, straight questions and answers.
How to create ISO images from terminal?
Creating ISO images from terminal begins with the mkisofs and/or dd linux commands.
How to create MD5 checksum of ISO image file from terminal?
# md5sum myISOfile.iso > myISOfile.iso.md5
How to verify MD5 checksum of ISO image file from terminal?# md5sum -c myISOfile.iso.md5
How to create CD/DVD ISO image of files and/or folder from terminal?
For creating ISO image from folder# mkisofs -r -o myisofile.ISO myfolder
For creating ISO image from file# dd if=mybigfile of=myisofile.ISO
or# mkisofs -r -o myisofile.ISO mybigfile
# mkisofs -r -o myisofile.ISO *.mp3
How to create CD/DVD ISO image of CD/DVD disk from terminal?
How to create an ISO copy CD/DVD disk from terminal?
For non-bootable and data ISO image file, just mount the CD/DVD disk first like so# mount /dev/cdrom /mnt/myCDdrive
# mount /dev/dvd /mnt/myDVDdrive
And create the ISO image file from CD disk like so# mkisofs -o myCDiso.ISO /dev/cdrom
And from DVD disk# mkisofs -o myDVDiso.ISO /dev/dvd
An alternative would be done with the below command and without the need of mounting the disk as shown below.
This is also preferrable for creaing bootable CD disk.# dd if=/dev/cdrom of=myCDiso.ISO
And for DVD disk# dd if=/dev/dvd of=myCDiso.ISO
How to burn ISO image file into floppy or CD/DVD disk from terminal?
For floppy# dd if=myfloppyISOfile.ISO of=/dev/floppy
For CD/DVD# dd if=myCDISOfile.ISO of=/dev/cdrom
or
# dd if=myCDISOfile.ISO of=/dev/cdrom-sr0
and for DVD# dd if=myCDISOfile.ISO of=/dev/dvd
How to burn ISO image file into floppy or CD/DVD disk from Gnome F7?
Go to Gnome > Places > CD/DVD creator. Copy and paster files and folder and click Write to Disc
How to burn DVD .IMG file to DVD disk from terminal?# growisofs -Z /dev/dvd=myDVDimagefile.IMG
How to blank fast and erase files from CD-RW/DVD-RW disk from terminal?
This was also mentioned here.
CD-RW# cdrecord dev=/dev/cdrom blank=fast
DVD-RW# cdrecord dev=/dev/dvd blank=fast
How to mount/unmount ISO image from terminal?
To mount CD# mkdir /mnt/cdrom
# mount -t iso9660 -o loop /dev/cdrom /mnt/cdrom
To unmount# umount /mnt/cdrom
You might be interested on using the right click mouse button to open a link in background in a new browser window or separate tab with the below boxes in black.
That's it for now. Thanks!
Related Posts:
Linux CD/DVD Burnind Software - Brasero
Nero Burning Software in Linux
K9Copy - CD/DVD Disk Copier and Burner
Posted by
VeRTiTO
at
2:46 AM
0
comments
Links to this post
Labels: HowTos
send a message to user's terminal
Here's another alternative on sending messages to specific and currently logged in remote terminal user.
Write allows you to communicate with other users, by copying lines from your terminal to theirs.
This blog entry shows how to send message to specific and currently logged in user via terminal using write linux command. This approach comes handy during a non-X terminal communication exchanges between two currently logged in local box users from separate remote locations.
Here's the dirty and quick way to send messages to specific and currently logged in user.
If the other remote user 'vertito1' is currently logged in from tty2 of the remote box, you can send a message to that specific and currently logged in remote user. Do from local box as follows:
# write vertito1 tty2
Dude, no need to reboot this box.
Hit Control C when done
The above command is assuming that the other receiving user is not denying any terminal messages from his terminal setup. Denial of any messages can be done using mesg linux command.
If you wish the other user to see a portion of your remote screen as well, you can make use of copy and paste from your terminal. Any further lines you enter will be copied to the specified user’s terminal. If the other user wants to reply, they must run write as well.
To finish terminal converstaion, you simply type an end-of-file or interrupt character. The other user will see the message EOF indicating that the conversation is over.
Write blog entry done.
Posted by
VeRTiTO
at
2:00 AM
0
comments
Links to this post
Labels: HowTos
Friday, August 24, 2007
retrieve GMail emails via terminal using fetchmail
This entry will cover a one shot linux fetchmail command of retrieving GMail email messages using terminal without any further fetchmail configuration setup. Read on.
Fetchmail is one good linux tool for fetching and retrieving remote emails. Fetchmail works and retrieves emails from remote email servers and downloads them locally into your local linux box.
I agree that there are a lot of MUAs or email retrieval softwares available both from windows and linux world. If you wish to configure other mail retrieval softwares to retrieve emails from your GMail account, you can visit and read more from here.
Make sure your GMail account to allow POP3 retrieval from external source. If not, this can be with the below instructions.
Login into your GMail account. From there, click Settings from the right corner of your screen. Click Forwarding and POP from one of the tabbed menus and select Enable POP for all mail. From here, you have an option to keep a local copy of emails retrieved or delete the original copy when retrieved by external mail user agent. Click Save to make your changes permanent.
This entry would be accomplished without launching fetchmail in daemon service mode and/or without further configuration to fetchmail default .fetchmailrc configuration file. This entry also assumes that
1. fetchmail package is currently installed from current local box. If not, simply install fetchmail as follows:
# yum -y install fetchmail
2. sendmail, exim, qmail, postfix or any mail transfer agent (MTA) is currently installed and currently running from local box. If not, any mail delivery agent (MDA) like procmail, maildrop or deliver is currently available from local box. Proper configuration of these mentioned package would not be covered here though.
How to retrieve emails from GMail account using fetchmail via terminal?
If you issue the below command as root, the retrieved emails would automatically be dropped or delivered to root mail box. Also prepare your GMail password upon executing the below command.
# fetchmail -v -k -u YOU@gmail.com --ssl -P 995 pop.gmail.com -m "/usr/sbin/sendmail -i -f %F -- %T"
LEGEND:
-v for more verbose fetchmail settings
-k keeps and retains email copies from GMail
-P followed by GMail POP3s port number and POP host server
-m mail would be delivered by sendmail
Any non-zero returned exit status means failure.
You've Got Mail!
Fetchmail can do this GMail mail retrieval steps in various ways. The above is only one way to do it.
Here's another one-shot alternative way to retrieve GMail using fetchmail from terminal.
This time around, it is assumed that any mail transfer agent (MTA) like sendmail, exim or postfix is currently NOT installed. Fetchmail can deliver mails using other MDAs like procmail as an example.
Again, this is possible in one shot fetcmail command without further fetchmail configuration setup and procmail setup.
Here's how to fetch Gmail email using fetchmail and procmail. Simply do as follows:
# fetchmail -v -k -u YOU@gmail.com --ssl -P 995 pop.gmail.com -m "/usr/bin/procmail $h $g"
You've got mail again!
Posted by
VeRTiTO
at
4:13 PM
0
comments
Links to this post
Labels: HowTos
more of activating and deactivating network card
With my recent entry on doing start and stop with network card, which can be found here, here's another alternative on activating and deactivating your ethernet card.
This entry covers another alternative way of stopping and starting your ethernet interfaces using
neat-control. This simple linux command neat-control is available both in terminal and X mode.
USAGE
===========
GUI VERSION:
Simply launch neat-control from X by hitting Ctrl+F2 and entering neat-control. A sample screen shot below would appear from your screen giving you another approach to activate and deactivate ethernet card(s) from X.
TERMINAL VERSION:
The terminal version of neat-control from terminal is called neat-tui. Just issue
# neat-tui
Sample screenshot:
Posted by
VeRTiTO
at
3:32 PM
0
comments
Links to this post
Labels: HowTos
Thursday, August 23, 2007
set new mysql password
Appreciate your email.
Here's another email request on setting up a new password for a newly installed mysql.
How to set a new password for a newly setup MySQL server?
# mysql -u mysql
At the prompt
Finally, at the "mysql>" prompt, type:
set password = password("yournewpassword");
then type:
quit
Login with your new set mysql password like so
# mysql -u mysql -p
I hope I can answer them all! :)
Posted by
VeRTiTO
at
7:58 AM
0
comments
Links to this post
Labels: HowTos
TIP: enable thumbnail display images from apache
As an email request, here's how to enable your apache web server to enable display of thumbnail images from your personal web-based photo, image and gallery management using your photo management, php and apache.
This blog entry assumes that your apache serve is running without any problems and you have installed your photo management package with no problems too.
If you happen to have difficulty of displaying thumbnail images from your php-based web photo gallery, continue reading this entry.
What is php-gd?
The php-gd package contains a dynamic shared object that will add support for using the gd graphics library to PHP.
How to install php-gd package for fedora to enable display of thumbnail images from web photo management?
# yum -y install php-gd
This would install other image library modules for apache and php.
Here's a my own test screenshot after successful installation:
It works!
Posted by
VeRTiTO
at
3:35 AM
0
comments
Links to this post
Labels: HowTos
monitor large mailbox users
Monitoring mailbox users can be done in many serveral ways via web interface or via terminal or via bash scripts.
With the usual mbox type emails, incoming new email messages are automatically redirected to each users' own spool file. This spool mail is by default located and stored in /var/spool/mail. From there, the spool file just waits for its owner to pull or pop it out for retrieval via any mail retrieving software agents (MUAs) like Thunderbird, Outlook, Eudora, The Bat and the like.
Linux has been equipped with thousand usable tools that when combined creates another function from these combined set of linux tools. This document entry would cover how to monitor large mailbox (mbox) users using different linux commands and sends out mail notification.
This can be achieved with the following steps.
First, listing the file size of all spool mails listed under /var/spool/mail would be the first step in order to determine your top or large mailbox users. Listing file usage of /var/spool/mail can be done as follows:
# du -h /var/spool/mail/*
From the above, we are appending -h parameter for a more human-readable output form. Here's a sample result from issuing the above command:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0 /var/spool/mail/vertita
20K /var/spool/mail/vertito
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Secondly, the next thing to do is to sort these spool size in order. Sorting can be done from highest to lowest or vice versa. This is possible using sort linux command.
Sorting data gives us way to have the top and last list of data. From here, we just need to pipe out the resulting result from disk usage as an input value to sort linux command. Hence, we can now have a numerically sorted list of mailbox users as shown below:
# du -h /var/spool/mail/* | sort -rn
From the above, -r parameter is for reversal sorting. A sample output would be
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
832M /var/spool/mail/vertito1
.
.
0K /var/spool/mail/vertito100
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Finally, all we need is to have fetch only first or top 20 or 10 of them. Top 20 large mailbox users can be done by using the head linux command. Dumping the first two results from du and sort and redirecting it to head linux command would be done like so
# du /var/spool/mail/* | sort -rn | head -10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
879768 /var/spool/mail/vertito1
879572 /var/spool/mail/vertito2
846540 /var/spool/mail/vertito3
768680 /var/spool/mail/vertito4
695664 /var/spool/mail/vertito5
684264 /var/spool/mail/vertito6
577660 /var/spool/mail/vertito7
553740 /var/spool/mail/vertito8
520856 /var/spool/mail/vertito9
506880 /var/spool/mail/vertito10
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hola amigos! Now, you have the top 10 large mailbox users from your screen.
Now, remember this can be sent as an email on daily basis too by using linux mail command combined with crontab utility.
Linux job scheduling can be found here while sending mail from terminal sample can be found here and here.
Posted by
VeRTiTO
at
1:01 AM
0
comments
Links to this post
Labels: HowTos
Wednesday, August 22, 2007
using the linux yes command
One quick way of sending set of character to standard output repeatedly is using the linux command yes.
Here's how to print string of words repeatedly from your screen.
Prints words 10 times
# yes VeRTITO | head -10
~~~~~~~~~~~~~~~~
VeRTiTO
VeRTiTO
VeRTiTO
VeRTiTO
VeRTiTO
VeRTiTO
VeRTiTO
VeRTiTO
VeRTiTO
VeRTiTO
~~~~~~~~~~~~~~~~
Prints 999 times.
# yes 999 Too many | head -999
~~~~~~~~~~~~~~~~
Too many
Too many
Too many
Too many
....
~~~~~~~~~~~~~~~~
To print words forever would be
# yes This is forever
'This is forever' would be printed repeatedly until terminated.
Posted by
VeRTiTO
at
11:17 PM
0
comments
Links to this post
Labels: HowTos
string manipulation using tr linux command
tr a linux command that translate, squeeze, and/or delete characters from standard input, writing to standard output.
tr is one linux string manipulation tool that is installed by default installation with fedora boxes. tr currently focuses on deleting, squeezing, or translating string on a character per character basis or single byte characters.
USAGE
=======
tr set1 set2
set1 is any single byte character to be translated, squeezed, or deleted. set1 can be a set of CLASS blob characters.
set2 is the resulting translated single byte character
blob characters are:
[CHAR*REPEAT] REPEAT copies of CHAR, REPEAT octal if starting with 0
[:alnum:] all letters and digits
[:alpha:] all letters
[:blank:] all horizontal whitespace
[:cntrl:] all control characters
[:digit:] all digits
[:graph:] all printable characters, not including space
[:lower:] all lower case letters
[:print:] all printable characters, including space
[:punct:] all punctuation characters
[:space:] all horizontal or vertical whitespace
[:upper:] all upper case letters
[:xdigit:] all hexadecimal digits
[=CHAR=] all characters which are equivalent to CHAR
\\ backslash
\a audible BEL
\b backspace
\f form feed
\n new line
\r return
\t horizontal tab
\v vertical tab
Character translation occurs if -d is not passed as a parameter. -d parameter tells tr to delete the search blob character.
MORE USAGE
==========
How to convert all lowercase to uppercase letters of text file?
Assuming we have testfile.txt that contains the following text data
# cat testfile.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~
i am vertito
this IS a text file
~~~~~~~~~~~~~~~~~~~~~~~~~~~
To convert small letters to upper letters, this can be done as follows
# cat testfile.txt | tr "a-z" "A-Z"
or
# cat testfile.txt | tr [:lower:] [:upper:]
which gives a resulting output of
~~~~~~~~~~~~~~~~~~~~
I AM VERTITO
THIS IS A TEXT FILE
~~~~~~~~~~~~~~~~~~~~
and of course, converting upper letters to small letters would be like so
# cat testfile.txt | tr [:upper:] [:lower:]
How to replace a single character with a different character?
# cat testfile.txt | tr a @
~~~~~~~~~~~~~~~~~~~~
i @m vertito
this IS @ text file
~~~~~~~~~~~~~~~~~~~~
How to delete specified character from text files?
# cat testfile.txt | tr -d e
~~~~~~~~~~~~~~~~~~~~
i am vrtito
this IS a txt fil
~~~~~~~~~~~~~~~~~~~~
How to squeeze and delete repeated single byte character from text file?
Assuming we have a test.txt with the below data contents:
Sample test.txt file
# cat test.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I amm testing this mmessage
I ammm testing this mmmessage
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Squeezing and deleting repeated letters would be done with the next command.
For the above sample, we need to squeeze repeated character 'm'
# cat test.txt | tr -s m
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am testing this message
I am testing this message
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Done.
Posted by
VeRTiTO
at
6:07 PM
0
comments
Links to this post
Labels: HowTos
install and play 2D chess game in linux
Xboard is an X Window System based graphical chessboard which can be used with the GNU chess and Crafty chess programs, with Internet Chess Servers (ICSs), with chess via email, or with your own saved games.
More info of playing X based chess board game can be found here.
2D Chess Linux Game
Here's a quick way of how to install a 3D Chess board game in Fedora and Centos using yum.
# yum -y install xboard
This would install xboard including gnuchess as dependency.
Here's a snapshot:
My game screen shot
More FAQs, chess rules, settings, play level can be found here.
Posted by
VeRTiTO
at
5:05 PM
0
comments
Links to this post
Labels: HowTos
more firefox tips and tricks
One good thing about firefox settings aka firefox registry, is that you can edit them at your own will to suit your needs without having to dig down deeper from source code level.
Here are several firefox tips and tricks that makes your browsing faster, easier and more convenient, atleast to a larger number of firefox end users.
Make proper backups. To backup current firefox settings, you can issue
# updatedb
# locate prefs.js
and copy it to a different filename like prefs.js.old
If the below changes crashes your firefox, just copy your backup setting overwriting the other one then restart firefox. Do this at your own will, you've been warned. It worked with my box type, yours might be a different story.
However, if all things fail, just remove and re install firefox like so:
# yum -y remove firefox
# mv /root/.mozilla /root/.mozilla-old
# mv ~your-user-name/.mozilla ~your-user-name/.mozilla-old
# yum -y install firefox
without any consideration to previously installed firefox addons, plugins, cached sites or download history.
Firefox plugins are usually located to the below locations
/root/.mozilla/plugins
~your-username/.mozilla/plugins
You can create a backup copy of these folders and copy it back after your firefox reinstallation just incase.
However, IF you wish to continue, read on and goodluck.
To edit these firefox registry configuration values, simply launch firefox and go to address bar. Type
about:config
and hit Enter key.
To edit or change any registry values, simply type the configuration line from the filter bar address and firefox would interactively bring you to nearest match of your search.
How to disable IPv6 with firefox?
From filter box, type
network.dns.disableIPv6.
Hit Enter. The default value for this is false. From the preference window, just double click the line to change and toggle it to true value.
How to enable memory caching with firefox?
browser.cache.memory should be true
How to increase pipelining request in firefox?
network.http.pipelining.maxrequests preferably doubling the current value from 4 to 8. The value can be changed by double clicking on it.
How to enable HTTP pipelining with firefox?
network.http.pipelining preferably setting it to true
How to increase pipelining maximum request with firefox?
network.http.pipelining.maxrequests preferably 8 would be fine
How to enable network http proxy pipelining with firefox?
network.http.proxy.pipelining preferably set it to true
How to disable resizing of firefox window by websites?
dom.disable_window_move_resize should be true
How to automatically saved sessions and returning back to them between system restarts?
Click Edit > Preferences > Main Tab > Startup > Show my Windows and Tabs from Last Time
How to increase disk cache and memory cache with firefox?
browser.cache.disk.capacity preferably doubling the size would be better, say 80000
browser.cache.disk.enable should be enabled
browser.cache.memory.enable should be enabled
network.http.use-cache should be enabled
security.xpconnect.plugin.unrestricted preferably false
How to notify user for extenstion update
extensions.update.notifyUser preferably should be true
How to enable cookie only for current session with firefox?
network.cookie.enableForCurrentSessionOnly preferably should be true
How to expand live browsing connections?
network.http.max-connections preferably increasing it to 36 ot 48 if you browse to ofteb with lots of firefox tab pages
How to increase connection per site?
network.http.max-connections-per-server preferably increasing it to 15
How to update firefox?
# yum -y update firefox
Restart firefox and you're done.
HTH
Posted by
VeRTiTO
at
3:47 PM
0
comments
Links to this post
Labels: HowTos
recover root password on linux
Finally, the well known root password recovery is here to stay.
This old time favorite superuser root password recovery in linux comes as handy as a toolbox. Recovering root password in linux is as handy as newbie users during the very first linux installations.
The simplest way to recover root password before kernel can be accomplished with the following steps.
A. If you are sure you do not have any grub or lilo password set, basically you do not need to boot from boot CD or DVD. Without grub or lilo password set, recovering linux root password is as easy as booting the linux kernel into its linux single mode.
This linux single mode basically loads up minimal boot up sequence and drops you to a root shell. One way to boot from linux single mode is by passing an kernel arguments before kernel boot up.
How to make kernel boot into linux single?
How to pass kernel arguments before bootup?
During bootup, by default installation, Fedora, CentOS, and RedHat prompts for a few seconds before booting its linux kernel. This is a chance for the user to edit any needed kernel arguments before the normal kernel boot up process.
You must hit any key from this prompt. Then select the line that starts with kernel. From this line, press the letter 'e' for editing and appending additional kernel parameters. Our intention here is to pass additional kernel parameter called 'linux single'. You will be taken to boot menu list from where you can now append the below line:
linux single
This parameter boots the kernel in linux single mode. As an example
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
title Fedora 7 (2.6.21-1.3194.fc7)
root (hd0,0)
kernel /vmlinuz-2.6.1.3194.fc7 ro root=/dev/VolGroup00/LogVol00 rhgb quiet linux single
initrd /initrd-2.6.1.3194.fc7.img
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Noticed the a bold emphasis from the kernel line with 'linux single' or 'single' kernel parameter. After passing the linux single word, hit 'b' or Enter key to normally resume kernel boot up process. You will dropped into normal shell prompt. At this point, you are the superuser root. Issue
# passwd
to set a new root password like so
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Changing password for user root.
New UNIX password:
BAD PASSWORD: it is WAY too short
Retype new UNIX password:
passwd: all authentication tokens updated successfully.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
After succesfully changing root password, reboot properly by issuing
# reboot
This would reboot your system. You can now use your new root password
B. If you happen to have a grub or lilo password, a boot CD/DVD or disk 1 of your linux installation is required to achieve the same steps of changing your root password. Alternatively, you can boot from other linux OS like Knoppix or any LIVE CD / LIVE DVD, as long as it matches your box architecture.
All you need to do is insert your bootup CD or DVD from your CD/DVD drive and boot from the CD/DVD drive. Any attempt to boot from this first installation CD would take you to a startup menu wherein you can also pass additional kernel parameters.
From there, pass the required 'linux single' kernel parameter. This would also take you to normal shell prompt wherein you can issue the linux command passwd to change your root password. After this, simply issue the linux command reboot.
The above approach works all the time.
You are now back with your newly changed root password after booting up normally.
Posted by
VeRTiTO
at
2:51 PM
0
comments
Links to this post
Labels: HowTos
Tuesday, August 21, 2007
establish ssh connection from different port
We all know that starting ssh daemon server listens by default to port number 22. Normally, any user connecting to port 22 would launch ssh client without any port number specification considering that ssh server was launched with default port 22 as its binded or listening ssh port number. Changing ssh default port number is one good practice of securing ssh.
Now, with the situation of having a non-default ssh port number, here is how to establish ssh connection to any ssh server with a different ssh port number or with non-default ssh port number.
How to connect to ssh server with a non-default port 22?
Assuming ssh server was started to listen from port 2221.
# ssh user@ssh.server.IP.address -p 2221
Done.
Posted by
VeRTiTO
at
2:49 PM
0
comments
Links to this post
Labels: HowTos
uniq linux command
Linux is full of powerful terminal tools that are designed to do separate functions. These linux tools are so great, they are like individual lego blocks. When you fit these set if lego blocks together, it creates a new set of linux tool providing a new way to achieve your goal without going deeper on coding and programming to do the same similar job.
Here's another linux tool called uniq. Uniq linux command function to omit or report repeated lines.
Shown below are the different usage for uniq commands.
Supposed we have a testfile.txt that contains the following text data.
# cat testfile.txt
~~~~~~~~~~~~~~~~
abc
abc
abc
efg
xyz
xyz
~~~~~~~~~~~~~~~~
Here is how to print unique lines of text file.
# uniq testfile.txt
~~~~~~~~~~~~~~~~~~~~~~
abc
efg
xyz
~~~~~~~~~~~~~~~~~~~~~~
How to print and count the number of occurrence of each line from text file?
# uniq -c testfile.txt
~~~~~~~~~~~~~~~~~~~~~~
3 abc
1 efg
2 xyz
~~~~~~~~~~~~~~~~~~~~~~
How to print all repeated or duplicated occurrence of each line from text file?
# uniq -d testfile.txt
~~~~~~~~~~~~~~~~~~~~~~
abc
xyz
~~~~~~~~~~~~~~~~~~~~~~
How to print all unique occurrence of each line from text file?
# uniq -u testfile.txt
~~~~~~~~~~~~~~~~~~~~~~
efg
~~~~~~~~~~~~~~~~~~~~~~
Now, let modify testfile.txt to look like so
~~~~~~~~~~
abcd
abc
abc
efg
xyz
xyz
~~~~~~~~~~
Now, here's how to print uniq occurrences found on the first N characters of line from text file?
Assuming we would only compare the first 2 characters of each line and print unique occurrences.
# uniq -w 2 -u testfile.txt
~~~~~~~~~~
efg
~~~~~~~~~~
How to compare the first 2 characters of each line and print only the duplicated occurrences.
# uniq -w 2 -d testfile.txt
~~~~~~~~~~
abcd
xyz
~~~~~~~~~~
How to avoid comparing the N character of each line from text file using uniq linux command?
Assuming we want to avoid comparison of the first 2 characters of each line from text file and print only the unique occurrences with its corresponding number of occurrences.
# uniq -s 2 -u -c testfile.txt
~~~~~~~~~~~~~~~~~~
1 abcd
1 efg
~~~~~~~~~~~~~~~~~~
And another more, here is how to print only the duplicated lines of occurrences with comparison point starting after the 2nd character of a each lines using uniq linux command?
# uniq -s 2 -d -c testfile.txt
~~~~~~~~~~~~~~~~~~
2 abc
2 xyz
~~~~~~~~~~~~~~~~~~
Redirection of standard output is always possible with these linux commands.
Finished!
Posted by
VeRTiTO
at
10:51 AM
0
comments
Links to this post
Labels: HowTos
remove blank lines using grep or sed
Here's a quick rundown on how to remove blank lines between contents from text files using linux command sed and grep.
Suppose we have a text file named testfile.txt . With the below content samples.
# cat testfile.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
1
2
3
5
6
7
~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As you can see from above content, there are multiple blank lines. Our objective here is to eliminate those blank lines lines, thus suppressing the text file.
This entry covers how to remove blank lines of text files using sed and grep. As follow
# grep -v '^$' testfile.txt
# sed -e '/^$/d' testfile.txt
You can redirect the output from your screen into a file using linux redirection approach. As follows:
# grep -v '^$' testfile.txt > testfile1.txt
# sed -e '/^$/d' testfile.txt > testfile2.txt
Verify that we have achieved our objective of removing blank lines from a file.
# cat testfile.txt
~~~~~~~~~~~~~~~~~~~~
1
2
3
5
6
7
~~~~~~~~~~~~~~~~~~~~
Done!
Posted by
VeRTiTO
at
7:12 AM
0
comments
Links to this post
Labels: HowTos
date and time sync via NTP server howto
Syncronizing your current date and time is as important as making database backups. Without proper accurate stamped date and time, any backup file with any stamped date on it would be meaningless. Without correct time and date, those scripts that depend on date and time schedule would be executed inaccurately and would give you result on a wrong date and time stamp.
There are many ways to adjust, correct and synchronize your system date and time via terminal. Changing and syncing hardware and system clock has been covered from recent entry which can be found here.
If you happen not to have any local NTP server from your network, here's an entry to update, set and adjust your system date and time from external NTP servers around the globe using ntpdate and rdate.
How to synchronize system date and time from NTP pool servers around the web. Do as follows.
Assuming we would like to sync our system date and time with 2.fedora.pool.ntp.org NTP time pool server. This blog entry covers doing it using ntpdate linux command via terminal.
Ntpdate man says:
ntpdate sets the local date and time by polling the Network Time Protocol (NTP) server(s) given as the server arguments to determine the correct time. It must be run as root on the local host. A number of samples are obtained from each of the servers specified and a subset of the NTP clock filter and selection algorithms are applied to select the best of these. Note that the accuracy and reliability of ntpdate depends on the number of servers, the number of polls each time it is run and the interval between runs. Makes use IPv4 and IPv6 on adjusting system date and time.
Getting the current system date and time is needed for comparison values.
# date
Now let us proceed.
SYNCING WITH NTP SERVER MANUALLY
================================
How to synchronize system date and time with NTP time server using ntpdate?
# ntpdate 2.fedora.pool.ntp.org
Alternative time pool servers are:
~~~~~~~~~~~~~~~~~~~~~~~~
0.fedora.pool.ntp.org
1.fedora.pool.ntp.org
time.nist.gov
~~~~~~~~~~~~~~~~~~~~~~~~
If you wish to query date and time only, this would be done like so
# ntpdate -q 2.fedora.pool.ntp.org
If you have a local time server near to your network, this would be
# ntpdate yourlocal.timeserver.host
If the above command failed, and you are more likely behind the firewall. This is how to update date and time behind the firewall
# ntpdate -u yourlocal.timeserver.host
Sync date and time using IP address is also possible like so
# ntpdate 216.194.70.2
SYNCING TIME LOCALLY USING RDATE
=======================================
Rdate linux command gets and update time via network.
Again, initially get your current date and time system values for comparison.
# date
To print current date and time values from local NTP server using rdate, this could be done like so:
# rdate -p local.NTP.IP.address
To sync date and time locally from your NTP server or from the network using rdate would be:
# rdate -s local.NTP.IP.address
To sync date and time locally using rdate via UDP instead of TCP as its transport, this could be done like so:
# rdate -u local.NTP.IP.address
SYNCING DATE/TIME PERMANENTLY AND AUTOMATICALLY USING NTP DAEMON
================================================================
How to sync date between or after reboot?
How to synchronize date and time automatically in linux?
How to install NTP daemon service in linux?
If your server has never been rebooted, there should be a lot of difference and time skipped by the server during high load processes. Because of this, unattended syncing of date and time is needed to be checked, monitored and synced automatically. This approach calls for making NTP act as a NTP daemon service.
How to install NTP daemon service to automatically check and update date/time values from NTP server?
NTP daemon can be installed by doing so:
# yum -y install ntp
With default installation, NTP daemon service could be started and run faily well as follows
# service ntpd start
NTP daemon service makes use of /etc/ntp.conf . Watch the date/time differences from the result of issuing date command and after starting NTP daemon service.
To check for NTP daemon service status would be
# service ntpd status
Making NTP daemon service permanent between reboots would normally be like so
# chkconfig --levels 35 ntpd on
Note:
3 represent runlevel 3, that is bootup to command line with no GUI and 5 represents with X.
Further ntp.conf customization would not be included here, I am going to create a separate entry for creating a NTP server out of Fedora box. Changing timezone via terminal would also not be covered and created here. They would be covered on a separate entry too sooner or later.
If you wish to sync your hardware clock from your system clock or vice versa, there is howto that can be easily viewed here.
Posted by
VeRTiTO
at
5:48 AM
0
comments
Links to this post
Labels: HowTos
who am I
As linux users, we make use of who as one linux tool command. Most of the time, who linux command functions on determining currently logged on box users. There are times those simple linux commands are taken for granted or unconsciously skipped out for far more linux terminal command studies. Many of them. One is who.
Here are more usage of who linux commands.
Who am I ?
# who am i
How to know the last time of system reboot?
# who -b
How to know last change of system clock?
# who -t
How to print system login processes?
# who -l
How to know and print dead system processes?
# who -d
How to print number of logged on users ?
# who -q
How to print, same as without argument, but with PIDs, currently logged in users?
# who -u
How to print and know current running runlevel?
# who -r
How to know which currently logged in users are currently denying, deflecting or avoiding any future system wide messages?
# who -T
Who are you?
# who are you
:)
Posted by
VeRTiTO
at
4:46 AM
0
comments
Links to this post
Labels: HowTos
delete spam email and folder regularly howto
Fighting spam email is a worldwide daily combat challenge. Email spam fight is just another daily server wide monitoring function of any sysad administering those email servers. Global spam email attacks and happens everyday regardless of country, server setup, domains, geolocation and public IP address you might have. Take a look of the top country source of spam emails from here.
This entry covers how to delete bulk or spam folder of mbox/maildir/mdir type emails on regular monthly basis. This would be done using linux find command, delete command, and crontab utility statements via terminal.
Assuming the script would be created by root. Launch your fave editor and create a sample script delete_spam.sh with similar contents like so:
delete_spam.sh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/bash
find /home -name Spam -exec rm -f {} \;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INTERPRETATION:
The 'find' linux command attempts to locate mbox file type named 'Spam'. Locating the file started from /home folder and done recursively. If a file type named Spam is found, rm -rf forcefully deletes the file and proceed with the next search result until all directory folders have been traversed.
Why home? This blog entry has assumptions that all spam mail files or folders are all stored under each user's home folders located under /home.
Why search for mbox type file only?
If you wish to delete IMAP folders, or any user folder, replace the find command with
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# find /home -name myimapfolder -type d -exec rm -f {} \;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Make them root executable like so.
# chmod 700 delete_spam.sh
Now, have a crontab schedule with crontab utility. The script would be executed on regular monthly basis, for example like so:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
33 01 28 * * /root/scripts/delete_spam.sh > /dev/null 2>&1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
INTERPRETATION:
delete_spam.sh is executed once every 1:33AM every 28th of the month without any history logs.
Why not 30th of the month? Because of February month.
Some servers use IMAP folders or maildir type of emails. On those ones, you just need to fine tune and adjust file name search criteria. This can be done by specifying a folder instead of a filename as a search criteria. Here are more samples.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
find /home -name Spam -exec rm -f {} \;
find /home -name Bulk -exec rm -f {} \;
find /home -name Virus -exec rm -f {} \;
find /home -name Spam.db -exec rm -f {} \;
find /home -name Spam.cache -exec rm -f {} \;
find /home -name spam-mail -exec rm -f {} \;
find /tmp -name att* -exec rm -rf {} \;
find /tmp -name *.tmp -exec rm -rf {} \;
find /home -name mymaildir -type d -exec rm -rf {} \;
find /home -name myfoldername -type d -exec rm -rf {} \;
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Take note that, it is advisable that all email users must be well informed that these spam emails and/or spam folders are deleted regularly on a monthly basis as shown with above script examples.
That is all folks.
Posted by
VeRTiTO
at
3:19 AM
0
comments
Links to this post
Labels: HowTos
hello world bash and perl script
I remember my very first hello world program when I was at younger age. I was 13. I created a hello world program using Basic programming language. Basic language at that time was capable of creating 2D games already which can be played from your TV screen via Atari game console. A cassette tape was the technology back then before and I used it on saving my hello world program as a storage devices. River Raider was a very well known 2D war plane strategy game before that time.
Now, this entry is very simple. Covering a hello world script using bash and perl.
Creating Hello world bash script. Yes, launch your fave CLI editor and save hello.sh with the following contents:
Hello.sh
~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/bash
echo Hello World!
~~~~~~~~~~~~~~~~~~~~~~~~~~
Alternatively, a hello world perl script.
Hello.pl
~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/usr/bin/perl
print "Hello World\n"
~~~~~~~~~~~~~~~~~~~~~~~~~~
Make them root executable like so.
# chmod 755 hello.sh hello.pl
Very basic. That is all.
Posted by
VeRTiTO
at
3:09 AM
0
comments
Links to this post
Labels: HowTos
passwordless rdesktop session with XP howto
This blog entry simply covers how to connect to XP clients remotely using rdesktop with supplied login name and password as argument and avoid putting username and password over and over again when remotely connecting to XP machines.
This entry also assumes the following:
a. that XP clients have a properly configured firewall for allowing remote connections.
b. that XP clients have enabled RTP request session
c. that XP clients are within the broadcast network of connecting remote host
Here are two approach on how to connect to XP machines remotely using rdesktop with supplied username and password as command line arguments.
# rdesktop windows.machine.IP.address -u XP-username -p XP-password
You can create a desktop shortcut and place it over your X panel. This can be done using Custom Application Launcher. Simply right click from the panel > Add to Panel > Custom Application Launcher and enter rdeskop details from there.
VERIFICATION:
Click on the desktop or panel shortcut, now you have a virtual passwordless rdesktop session with a XP machine.
Done.
Posted by
VeRTiTO
at
2:14 AM
0
comments
Links to this post
Labels: HowTos
force VGA screen resolution and screen mode
As included from previous blog entry of changing VGA setting or VGA screen resolution using Gnome system-config-display, which can be found here, here's another entry on how to force VGA screen resolution into your X settings directly via terminal.
As you know, X uses default configuration files, one of them is /etc/X11/xorg.conf. X reads this file during the process of launching and logging into X via runlevel 5. Settings for mouse, keyboard, VGA card, display resolution, regional language, screen types, VGA drivers and other modules used by X are basically declared and can be found from this X conf file.
If you want to change your VGA settings directly via terminal or force screen VGA resolution changes due to some *unknown driver issues, you can edit this file directly. Remember to do proper backups when editing linux configuration files.
1. Backing up xorg.conf
# cp /etc/X11/xorg.conf /etc/X11/xorg.conf.good
2. Launch your favorite terminal editor and edit xorg.conf
3. Inside xorg.conf, find the "Section Screen" which declares supported screen resolution for your currently detected VGA card. A sample of screen section layout is shown below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Section "Screen"
Identifier "Screen0"
Device "Videocard0"
Monitor "Monitor0"
DefaultDepth 16
SubSection "Display"
Viewport 0 0
Depth 16
Modes "800x600" "640x480"
EndSubSection
EndSection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
NOTE:
If you strongly believe and have proof that your VGA card supports a non-declared screen resolution besides from the above shown modes or if your VGA card driver manuals or websites showed that your VGA card supports the screen resolution you wish to achieve, proceed with the following with caution.
4. Here, assuming that we are going to force a VGA screen resolution mode of 1024x768 into xorg.conf and you are done with xorg.conf backup file. Edit the xorg.conf lines that says 'Modes' under Screen Section like shown below
From
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modes "800x600" "640x480"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
To
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Modes "1024x768" "800x600" "640x480"
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and save xorg.conf.
5. Close all opened applications. Restart X by hitting Ctrl+Alt+Backspace key combinations and see the effects of xorg.conf changes.
Success?
If X hangs after giving it some time like 60 seconds or more, and you wish to revert back recent changes from your xorg.conf, simply press Ctrl+F1 and login as root via TTYs. Then copy your backup xorg.conf.good file overwriting the non-working xorg.conf. Go back to X mode by hitting Ctrl+F7 and from there, try to hit Ctrl+Alt+Backspace for another X restart attempt.
Success?
If X does not restart again, try to go back to currently logged in root user via Ctrl+F1. As root, issue one of the following to stop a malfunctioning X or restart a new process from one of the below X commands.
To stop X
# gdm-stop
To restart X
# gdm-restart
To have a safe mode restart of X
# gdm-safe-restart
To launch a new X
# startx
There are times you need to kill an existing non-functioning Gnome X process by using kill.
Gnome X has a feature of detecting non-responsive and redundant failed launchng of Gnome X. If any attempts to launch X failed for several consecutive times, Gnome X automatically prompts you to have a new X setup and launches a new X setup. This is the same like launching it during a fresh linux installation.
This works for me during my old laptop, I hope it works for you too with your Fedora boxes as well.
Posted by
VeRTiTO
at
12:51 AM
0
comments
Links to this post
Labels: HowTos
Monday, August 20, 2007
RealPlayer 10 for linux install howto
Now, everybody can enjoy playing MP3s, Ogg Vorbis, Theora, RealAudio, RealVideo, H263, AAC in Fedora Linux. Sequel to recent RealPlayer installation via RPM, this blog entry would be done and tested using self-extracting BIN file from RealPlayer. The RealPlayer installation steps are almost identical with minor installation differences and more RealPlayer installation screenshots.
For RealPlayer fanatics, here's an entry that covers installation procedures of RealPlayer for Fedora Linux .
RealPlayer@ 10 supports RealAudio, RealVideo 10, MP3, Ogg Vorbis and Theora, H263, AAC and more. Get ready for accelerated video, full screen playback, and a lot more to play. You can now watch and listen to embedded video right in your Web browser without opening RealPlayer. Enjoy media from your favorite music and news sites with just one click. RealPlayer 10 for Linux is based on the open source Helix player.
INSTALLATION:
=============
1. Issue the following commands as root
# yum -y install compat-libstdc++-33.i386
2. After succesful yum installation, you can now proceed to download RealPlayer 10 for Linux from this site.
3. Go to downloaded file location and make the self-extracting binary file as file executable like so
# chmod 755 RealPlayer10GOLD.bin
4. And execute
# ./RealPlayer10GOLD.bin
You are going to see similar screen displays like the one below.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Extracting files for RealPlayer installation........................
Welcome to the RealPlayer (10.0.9.809) Setup for UNIX
Setup will help you get RealPlayer running on your computer.
Press [Enter] to continue...
Enter the complete path to the directory where you want
RealPlayer to be installed. You must specify the full
pathname of the directory and have write privileges to
the chosen directory.
Directory: [/usr/local/bin]:
You have selected the following RealPlayer configuration:
Destination: /usr/local/bin
Enter [F]inish to begin copying files, or [P]revious to go
back to the previous prompts: [F]:
Copying RealPlayer files...configure system-wide symbolic links? [Y/n]: ....
Enter the prefix for symbolic links [/usr]: .........
RealPlayer installation is complete.
Cleaning up installation files...
Done.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LAUNCH: Ctrl+F2, realplay
Below are the initial series of RealPlayer 10 for Linux program execution. You just simply click Forward from here.
Followed by RealPlayer 10 license agreements and release notes.

RealPlayer 10 default installation options for updates.
And finally ready to launch RealPlayer 10 for Linux application.
Here are my screenshots, playing one of great songs by Josh Groban.
It works in Fedora!
RealPlayer website can be found here.
All trademarks and products mentioned here are managed and owned by respective companies.
Posted by
VeRTiTO
at
2:00 PM
0
comments
Links to this post
Labels: HowTos
Saturday, August 18, 2007
Grip - CD ripper install howto
As a complete and powerful Fedora desktop, Fedora 7 also provides CD ripping softwares. One of them is Grip.
Grip is a GTK+ based front-end for CD rippers (such as cdparanoia and cdda2wav) and Ogg Vorbis encoders. Grip allows you to rip entire tracks or just a section of a track. Grip supports the CDDB protocol for accessing track information on disc database servers. In other words, Grip lets you grip and encode existing WAV files to another media formats like MP3, FLAC or OGG.
Here are some nice things about Grip features:
* Full-featured CD player with a small screen footprint in "condensed" mode
* Database lookup/submission to share track information over the net
* HTTP proxy support for those behind firewalls
* Loop, shuffle, and playlist modes
* Ripping of single, multiple, or partial tracks
* Encoding of ripped .wav files into MP3 files (as well support for OGG and FLAC)
* Simultaneous rip and encode
* Support for multiple encode processes on SMP machines
* Adding ID3v1/v2 tags to MP3 files
* Cooperating with DigitalDJ, my SQL-based MP3 jukebox
Like most known CD ripper, Grip interactively checks for ID tags, names, and more details of current media file beings rip for optional submission and database addition to freedb.freedb.org. More info can be found here.
INSTALLATION:
Here is how to convert, rip, and encode WAV files to MP3, FLAC and OGG.
# yum -y install grip
EXECUTION:
Ctrl+F2, grip
Screenshot in action:
Posted by
VeRTiTO
at
4:25 AM
0
comments
Links to this post
Labels: HowTos
Friday, August 17, 2007
Banshee - music management and playback
What? An alternative music player again? But hey, its free opensourced linux world anyway.
Alternatively, here's another multimedia player around the linux application arena.
Banshee.
Banshee allows you to import CDs, sync your music collection to an iPod, play music directly from an iPod, create playlists with songs from your library, and create audio and MP3 CDs from subsets of your library. Check out their dazzling website from here.
Banshee easily import, manage, and play selections from your music collections in general. Easily sort and filter your library in Banshee. The "Recommendation" plugin shows related artists and other information as you listen to music.
With banshee, you have flexibility and total control of your music management and selection over your music files from your harddisk or from your IPod, integrated with music voting features via stars, music tags by words, location and year and more!!! You should try it, it's one of my personal favorites!
INSTALLATION:
==============
Available from Fedora repo. Yum can download a 10MB rpm package for you and install it automatically by doing so, as root:
# yum -y install banshee
LAUNCH
=========
Ctrl+F2, banshee
Screen shot during banshee application launch.
A running Gnome banshee in action:
If your installation and attempt to play music files failed, you may try to visit Banshee FAQs here.
Very cool way of managing music files from your Fedora box.
I am giving thie Banshee 4.5 stars **** !!!!
Posted by
VeRTiTO
at
9:14 AM
0
comments
Links to this post
Labels: HowTos
gnome music applet install howto
Gnome Music Applet is a small, simple GNOME panel applet that lets you control a variety of different music players from the panel. Music Applet provides easy access to information about the current song and the most important playback controls.
Gnome Music Applet is the successor to the Rhythmbox Applet and currently supports the following music players:
* Banshee
* Exaile
* MPD
* Muine
* Rhythmbox
* Quod Libet
* XMMS1 and XMMS2
* Quod Libet
You can view more info from their website here. Gnome-music-applet is available from fedora repo can be installed once again by using yum as follows:
INSTALLATION:
=============
# yum -y install gnome-applet-music
GNOME USAGE:
=============
Right click to a vacant postion from your panel, select 'Add to Panel' and you will be prompted with similar window as shown below. Scroll down until you are seeing "Music Panel" and hit 'Add'.
After adding the gnome music applet, you would notice that your panel has a new icon similar to a jukebox. Now simply double click on this panel icon, the panel player would immediately appear from an expanded panel. A similar mini button would appear from your current gnome panel as shown below.
Moreover, your current gnome music player default plugin would also be launched prompting you for further music selections. Alterantively, you can change your preferred player by choosing Plugin menu after right-clicking the gnome music applet.
You can also right click on the gnome music player and further customize its panel appearance and other options like shown above. Try to minimize your default music player and a new popoup notification appears like so

Great, now you have a music playing from the background and an iconized gnome music applet with accessible and convenient music control relocated away from your screen work areas.
Have a happy linux weekend!
Cool applet! I gave it 3.5 stars ***.5 !!!
Posted by
VeRTiTO
at
7:34 AM
0
comments
Links to this post
Labels: HowTos
Pirut and yum-updatesd - software management
This blog entry covers how to managed currently installed or missing packages from Fedora using Gnome.
The closest term most people calls this is the Add/Remove software of Fedora Linux.
Pirut (pronounced "pirate") provides a set of graphical tools for managing Fedora Linux softwares.
Pirut tool makes use of GUI presenting packages to be added, removed, and updated to your current Fedora box. Pirut is actually the graphical front end for yum that does this add, remove and update software packages. Pirut also comes with Search, View, and Install menu facility that helps a lot on searching particular 'unknown' package.
INSTALLATION:
================
Installation is very simple. As root, issue this command
# yum -y install pirut
LAUCH:
Ctrl+F2, pirut
I would also recommend for most Fedora desktops that want to stay up-to-date , to install an update notification utility.
Yum-UpdatesD
============
yum-updatesd provides notification of updates which are available to be applied to your system. This notification can be done either via syslog, email or over dbus.
INSTALLATION:
=============
Use the champ, yum as follows
# yum -y install yum-updatesd
LAUNCH
=======
# service yum-updatesd start
# service yum-updatesd status
If you wish to make this permanent, you can modify your startup program like so
# chkconfig --levels 5 updatesd on
When yum-updatesd detected from yum repos that your box needs immediate updates, you will be notified about this by a popup message box. Cool.
Automatically, upon bootup, yum-updatesd checks for immediate updates that needs to be automatically downloaded and installed into your Fedora box. This is quite recommended on Fedora box that has fast web connections.
However, if you have a slow dialup connection, doing the update via yum CLI on a important-package at a time on daily basis would be fine but tedious.
See screenshot in action
That's is all.
Posted by
VeRTiTO
at
7:09 AM
0
comments
Links to this post
Labels: HowTos
Alacarte - editing panel menus install howto
One way to edit your Gnome panel menus in Fedora is to use Alacarte package.
Alacarte is a menu editor for GNOME that lets you get things done, simply and quickly. Operations for this package is very simple, ADE, as in Add, Delete and Edit menus.
To quickly verify if you already have Alacarte package without using yum and rpm, simply go to root prompt from your terminal, and as root issue any of the below commands.
# whereis alacarte
# which alacarte
# locate alacarte | grep bin
Or type "ala" without the quotes and hit TAB key. If you get the whole world of Alacarte, that basically means alacarte is already installed and you just need to execute Alacarte.
INSTALATION
=============
On the other hand, you might be missing Alacarte, here is how to install Alacarte package.
As root, simply issue the below linux command
# yum -y install alacarte
You're done.
LAUNCH:
=========
Ctrl+F2, alacarte
My Alacarte screenshot in action:
Posted by
VeRTiTO
at
6:49 AM
0
comments
Links to this post
Labels: HowTos
access NTFS drive in Fedora
If you happen to have a dual boot hard drive between Fedora and Windows OS, and you wish to have read and write access to your windows partition from Fedora OS, consider adding this entry.
If you happen to be initially switching from windows OS to Fedora distro, continue reading this entry.
If you happen to like Fedora but you just don't want your windows partition be deleted so other home and/or office users can still use your PC, continue reading this entry.
So much for the happening, here's an entry that would basically cover these intentions.
How to have read / write access to your windows harddrisk and partitions? That is the question.
All we need is yum to do the task for us.
INSTALLATION:
===============
As follow, do as root
# yum -y install ntfs-3g
That's it. You can now read and write to your windows drive and/or partition. Do not forget to mount your windows partition or harddrive. This can be simply done like so
If you have a newly plugged windows harddrive and currently running Fedora, simply issue as root.
Assuming /dev/sdb is your newly plugged windows harddrive
# mkdir /mnt/windows
# mount /dev/sdb /mnt/windows
# cd /mnt/windows
# ls -la
How to know identify which partitions or harddisk does your windows boots from?
As root, issue the next command as follows
# fdisk -l | grep NTFS
For dual-boot machines with both Fedora and windows OS in a single harddisk, simply issue as root
Assuming /dev/sda5 is your windows partition
# mkdir /mnt/windows
# mount /dev/sda5 /mnt/windows
# cd /mnt/windows
# ls -la
And you're done.
If you wish to know of Linux NTFS project, you can get more info and visit the site here. If you are still having some trouble mounting and accessing your windows harddrive, you may check the FAQ from here.
The Linux NTFS project can have read/write access with partitions from Windows XP,NT,2000,2003.
All Microsoft products and other trademarks mentioned here are all propriety and managed by their own respective companies.
Posted by
VeRTiTO
at
6:22 AM
0
comments
Links to this post
Labels: HowTos
FileLight - graphical disk usage and statistics
We all know most user's desktop runs and boots operating system from their harddisk. Simply from a harddisk, which is usually composed of files and folders. But trying to think how these data are scattered out or organized and logically located without overwriting each other and knowing where the other sector part ends and continued from your harddisk would be almost impossible for an average desktop user like me!
And the light showed up.
Presenting FileLight.
A graphical disk usage and statistics tool. Graphical visualization is always nice, its light for the eyes and not heavy for the brains.
Filelight graphically represents a file system as a set of concentric segmented-rings, indicating where diskspace is being used. Segments expanding from the center represent files (including directories), with each segment's size being proportional to the file's size and directories having child segments.
Filelight gathers folder and file information from your harddisk including harddisk technical information and presents this data in an interactive map of concentric segmented-rings that helps any type of users visualise his own disk usage on your computer. Using this graphical approach, filelight allows a user to exactly pinpoint from which part of the harddisk geometry shown from the graph a file or folder is located.
Here is another easy part that goes with FileLight.
How to install FileLight in Fedora 7?
-------------------------------------
Fedora makes package installation easier and seamlessly smoother than every Fedora distro released!
INSTALLATION:
-------------
Yum downloads 150K of rpm package from Fedora repo. As follow
# yum -y install filelight
Launch: Ctrl+F2
View my harddisk pie chart:
Another useful tool for most linux users around.
Hope this interests all of us.
Posted by
VeRTiTO
at
3:56 AM
0
comments
Links to this post
Labels: HowTos
TestDisk- partition tool install howto
TestDisk is a powerful free linux tool that can check, undelete partitions.
TestDisk is a powerful free data recovery software! It was primarily designed to help recover lost partitions and/or make non-booting disks bootable again when these symptoms are caused by faulty software, certain types of viruses or human error (such as accidentally deleting your Partition Table). Partition table recovery using TestDisk is really easy.
Testdisk is cross-platform software. Currently runs under DOS (either real or in a Windows 9x DOS-box), Windows (NT4, 2000, XP, 2003), Linux, FreeBSD, NetBSD, OpenBSD, SunOS and MacOS. Testdisk currently works with FAT12, FAT16, FAT32, NTFS, EXT2, EXT3, BeFS, CramFS, HFS, JFS, Linux Raid, Linux Swap, LVM, LVM2, NSS, ReiserFS, UFS, and XFS.
Below are known available features of testdisk:
* Fix partition table, recover deleted partition
* Recover FAT32 boot sector from its backup
* Rebuild FAT12/FAT16/FAT32 boot sector
* Fix FAT tables
* Rebuild NTFS boot sector
* Recover NTFS boot sector from its backup
* Fix MFT using MFT mirror
* Locate ext2/ext3 Backup SuperBlock
Running TestDisk:
Everything starts with further configuration setup of a package. Testdisk offers an option to log technical details and various folder/file information gathered during the entire process. By default, testdisk logs to testdisk.log. Below are more basic options on log output handling.
---------------------------------------------------------_
Use arrow keys to select, then press Enter key:
[ Create ] Create a new log file
[ Append ] Append information to log file
[ No Log ] Don't record anything
---------------------------------------------------------_
Moving forward after log file option, the below are the options presented from terminal by testdisk before any partition operation begins.
At this point, TestDisk had successfully detected your harddisk. TestDisk now offers you the type of partition that TestDisk would start working on. See below selections. Linux partition would not be presented below as you can see. Pressing Intel/PC would automatically make TestDisk to work on linux partition.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[Intel ] Intel/PC partition
[Mac ] Apple partition map
[None ] Non partitioned media
[Sun ] Sun Solaris partition
[XBox ] XBox partition
[Return ] Return to disk selection
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Testdisk now presents you with further action to currently selected partition using the above menus.
---------------------------------------------------------
[ Analyse ] Analyse current partition structure and search for lost partitions
[ Advanced ] Filesystem Utils
[ Geometry ] Change disk geometry
[ Options ] Modify options
[ MBR Code ] Write TestDisk MBR code to first sector
[ Delete ] Delete all data in the partition table
[ Quit ] Return to disk selection
---------------------------------------------------------
If you choose to Anlyse a partition, you will be ask for more questions in a wizard type of question. Most of them have default values. Testdisk can also search for lost Vista partitions as well. You can further change TestDisk setup by going to Options as shown above.
Below details would be presented after selecting Option menu:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expert mode : No
Cylinder boundary : Yes
Allow partial last cylinder : No
Dump : No
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Be careful with the other menus. It is advisable not to play testdisk operations with your live partition unless you know your intentions very well.
INSTALLATION
============
Simply issue the yum thing like so
# yum -y install testdisk
Launch: Ctrl+F2
More info can be found here.
TestDisk is really a nice partition linux tool.
I am giving this tool 4 stars **** !!!!
Posted by
VeRTiTO
at
2:54 AM
0
comments
Links to this post
Labels: HowTos
Thursday, August 16, 2007
using /dev/null in linux terminal
Here it is, several usage of /dev/null special file.
We all know that /dev/null acts like a black hole in the universe. Anything you throw at it would be totally gone forever. Any attempts to read or write from it result to nothing. This means any data written to this /dev/null is just discarded and gone. This also mean that any data reads from this special file always returns end of file (EOF).
However, /dev/null can be quite useful in several ways too. Do not issue any commands mentioned here unless you know what you are doing. You've been warned. However, you can continue to read more from below.
How to zap a file without changing file ownership and permission?
From below sample, bigfile is owned by owner1, and you are root, truncating bigfile to a zero sized file without any to file permission and file ownership changes can also be done as follows.
# ls -la bigfile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rw-rw-rw- 1 owner1 owner1 123123123123 2007-08-16 19:04 bigfile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
As root:
# cp /dev/null bigfile
# ls -la bigfile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rw-rw-rw- 1 owner1 owner1 0 2007-08-16 19:05 bigfile
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Ofcourse, file time stamps would be modified.
Now, we know that cat command display file contents into your scree. Let us try to suppress stdout. As root
# cat bigfile.txt > /dev/null
would show you nothing.
This is applicable also with stderr
# rm bigfile.txt 2> /dev/null
(Press Enter)
which obviously gives you nothing.
Now, how about issuing them both at the same time like so
# cat bigfile.txt 2> /dev/null > /dev/null
Interpretion:
If bigfile.txt does not exist, there will be no error message output from your screen since we supressed stderr. If bigfile.txt does exist, the file contents will not be displayed to stdout as well. So, you get no output at all using the above command. One probable usage for the above usage could be integrated whe using crontab utility which was covered here.
Try file copying over or overwriting /dev/null and see how it works
# cp bigfile.txt /dev/null
Another alternative use.
We have discussed before of creating file without editing it is by using linux command touch. Instead of using touch to create a zero sized file, we can make use of /dev/null to attain the same file output like so
# cat /dev/null > newfile.txt
Thinking wider, logically, this means that any log messages supposedly to be written to, say /var/log/secure can be zapped and suppressed as well, perhaps by an already inside hacker.
Well, it is ONLY here as further usage combination example. As root
# cp /dev/null /var/log/secure
# rm -rf /var/log/secure
# ln -s /dev/null /var/log/secure
Any future security messages supposedly to be logged to /var/log/secure would now be thrown to black hole (/dev/null) using the above command.
This is a bad practice and only here to elaborate more usage and security features that would be possible using /dev/null linux command.
Here's another one.
Let us say you have just downloaded a package installer. You have installed this package before with your previous work or company. And you are very aware that the package when installed asks too many questions answerable yes or no, or with default values.
And you know you'll just going to press the ENTER key for these question, /dev/null can be helpful here as well.
Execute the package or script like so
# ./new-program < /dev/null &
# ./new-program.sh < /dev/null &
If you happen to delete your /dev/null file, and you wish to recreate it back, simply follow here.
NOTES: Linux manual says, if /dev/null file is not writable and readable for all users, several application would act strangely.
If you think this /dev/null a.k.a. black hole has been interesting and useful for you, you might be interested with the black box from the middle of your screen as well. :)
Posted by
VeRTiTO
at
10:59 AM
0
comments
Links to this post
Labels: HowTos
yahoo messenger in fedora install howto
I know, installing yahoo messenger in linux is a very old odd entry. Why bother.
Atleast for one, and for my record as well, this blog entry covers Yahoo Messenger for linux installation howto.
For the new comers, Yahoo! Messenger (YM) once roamed Linux world before. This YM for linux is known to run on Intel chipsets and has been tested with early version of RedHat OS, FreeBSD and even Debian OS. If you are using Fedora 7 and you wish to give this old YM version a try, you can just follow the next easy steps.
More Yahoo! Messenger for linux can be found here and here.
HOW TO INSTALL Yahoo! Messenger on Fedora 7 OS
==============================================
1. Download YM for RedHat 9 here or issue from your linux box like so
# wget -c "http://us.dl1.yimg.com/download.yahoo.com/dl/unix/rh9.ymessenger-1.0.4-1.i386.rpm"
2. Go to the dowloaded file and use rpm binary to install the rpm package like so
# rpm -ivh rh9.ymessenger-1.0.4-1.i386.rpm
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Preparing... ########################################### [100%]
1:ymessenger ########################################### [100%]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
LAUNCH: Ctrl+F2, ymessenger
Initial installation are being presented from your screen as follows.
Simply click Next with these installation process
YM is just a click away, click Next to continue
Finally.
The login screen
and About screen. As you can see from the below captured windows, YM is still version 1.0.4!
Again, these steps have been tested this with my own box. I tried to login to yahoo messenger servers and it works. However, my guess is that voice and webcam would be yet supported by this YM installation :( But nice, it still works with Fedora 7.
Cheers
*All commercial products, copyrights and trademarks mentioned from these entries are definitely managed and owned by their own propriety owners and distributors.
Related Posts:
How To See Invisible YM Users
How To Setup Chikka SMS Messenger using Kopete Messenger
How to Install and Setup Google Chat Messenger
How To Setup Chikka SMS Messenger using GAIM Pidgin
How To Block YM Messenger
How To Install GAIM Pidgin Messenger
How To Install KDE Kopete Messenger
How To Install AMSN Messenger
How To Setup and Install PSI Chat Messenger
Posted by
VeRTiTO
at
10:23 AM
0
comments
Links to this post
Labels: HowTos
check and repair MS-DOS file systems howto
Using linux, there are ways to check and repair for MS-DOS type of file systems. This has been possible using dosfsck linux command.
dosfsck verifies the consistency of MS-DOS file systems and optionally tries to repair them.
dosfsck repairs MS-DOS file system in this order
- FAT contains invalid cluster numbers. Cluster is changed to EOF.
- File’s cluster chain contains a loop. The loop is broken.
- Bad clusters (read errors). The clusters are marked bad and they are removed from files owning
them. This check is optional.
- Directories with a large number of bad entries (probably corrupt). The directory can be dropped.
- Files . and .. are non-directories. They can be dropped or renamed.
- Directories . and .. in root directory. They are dropped.
- Bad file names. They can be renamed.
- Duplicate directory entries. They can be dropped or renamed.
- Directories with non-zero size field. Size is set to zero.
- Directory . does not point to parent directory. The start pointer is adjusted.
- Directory .. does not point to parent of parent directory. The start pointer is adjusted.
- Start cluster number of a file is invalid. The file is truncated.
- File contains bad or free clusters. The file is truncated.
- File’s cluster chain is longer than indicated by the size fields. The file is truncated.
- Two or more files share the same cluster(s). All but one of the files are truncated. If the file
being truncated is a directory file that has already been read, the file system check is restarted
after truncation.
- File’s cluster chain is shorter than indicated by the size fields. The file is truncated.
- Clusters are marked as used but are not owned by a file. They are marked as free.
- Invalid parameters in boot sector.
- Absence of . and .. entries in non-root directories
When dosfsck checks a file system, it accumulates all changes in memory and performs them only after all checks are complete. This can be disabled with the -w option.
USAGE:
------
To automatically repair a floppy disk, you can issue the following commands.
# dosfsck -a -v /dev/fd0
To mark all unreadable clusters as bad
# dosfsck -t -v /dev/fd0
Everything happens in memory unless you specify all changes to be written to disk immediately like so
# dosfsck -t -v -w /dev/fd0
Posted by
VeRTiTO
at
5:54 AM
0
comments
Links to this post
Labels: HowTos
using fdformat and mkdosfs from terminal
fdformat does a low level format on a floppy disk. device is usually one of the following (for floppy devices, the major = 2, and the minor is shown for informational purposes only).
The generic floppy devices, /dev/fd0 and /dev/fd1, will fail to work with fdformat when a non-standard format is being used, or if the format has not been autodetected earlier. In this case, use setfdprm(8) to load the disk parameters.
The only option available for this linux command is:
-n No verify. This option will disable the verification that is performed after the format.
USAGE:
------
fdformat device
SAMPLE:
# fdformat /dev/fd0
# fdformat /dev/fd1
Other choices for device are
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/dev/fd0d360 (minor = 4)
/dev/fd0h1200 (minor = 8)
/dev/fd0D360 (minor = 12)
/dev/fd0H360 (minor = 12)
/dev/fd0D720 (minor = 16)
/dev/fd0H720 (minor = 16)
/dev/fd0h360 (minor = 20)
/dev/fd0h720 (minor = 24)
/dev/fd0H1440 (minor = 28)
/dev/fd1d360 (minor = 5)
/dev/fd1h1200 (minor = 9)
/dev/fd1D360 (minor = 13)
/dev/fd1H360 (minor = 13)
/dev/fd1D720 (minor = 17)
/dev/fd1H720 (minor = 17)
/dev/fd1h360 (minor = 21)
/dev/fd1h720 (minor = 25)
/dev/fd1H1440 (minor = 29)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# man fdformat
MKDOSFS
mkdosfs linux command creates MS-DOS file system using linux. msdosfs can also check the device for bad blocks before the creation of filesystem begins. File allocation table (FAT) types can also be an argument on formatting floppy disk using this command. msdosfs also has this feature of setting up volume ID, volume name and custom sector per cluster and logical per cluster customization for the floppy.
mkdosfs is based on mke2fs which also based on mkfs
USAGE
=====
# mkdosfs /dev/fd0
# mkdosfs /dev/fd1
Format with bad blocks checking
# mkdosfs -c /dev/fd0
For 32 bit FAT types with bad block checking
# mkdosfs -c -F 32 /dev/fd0
For 32 bit FAT types with bad block checking with volumd ID and volume name
# mkdosfs -c -F 32 -i 2e24ec82 -n volumename /dev/fd0
Alternatively, there is another linux command that is functions exactly the same like mkdosfs.
I am referring to mkfs.vfat, which can create MS-DOS file system using terminal in linux.
# ls -la /sbin/mkdosfs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rwxr-xr-x 3 root root 29880 2007-04-03 20:17 /sbin/mkdosfs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and
# ls -la /sbin/mkfs.vfat
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rwxr-xr-x 3 root root 29880 2007-04-03 20:17 /sbin/mkfs.vfat
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Noticed the difference? See more
# man mkfs.vfat
# man mkdosfs
Thanks for visiting!
HTH
Posted by
VeRTiTO
at
5:37 AM
0
comments
Links to this post
Labels: HowTos
Tremulous - Quake 3 install howto
Tremulous by Darklegion Development is a teamwork oriented First-person shooter with elements of real time strategy. Originally developed and released as a Quake 3 mod, Tremulous has since been released as a standalone game using the open source quake 3 engine. Players join either the human or alien team, and can play a fighting, or building class.
Player advancement is different depending on which team you are on. As a human, players are rewarded with credits for each alien kill. These credits may be used to purchase new weapons and upgrades from the "Armoury". The alien team advances quite differently. Upon killing a human foe, the alien is able to evolve into a new class. The more kills gained the more powerful the classes available.
The overall objective behind Tremulous is to eliminate the opposing team. This is achieved by not only killing the opposing players but also removing their ability to respawn by destroying their spawn structures.
Tremulous has been nominated as a finalist in the Sourceforge Community Choice Awards. You can vote for them here.
This game has FREE (as in Freedom) source code available for download. This usually means that it can be compiled and run on nearly every platform available. Some games have specific system requirements, and may not be compatible with all versions of Linux. See the homepage of the game for more information.
You can visit their site here, there, and here.
Sample screenshot from web:

HOW TO INSTALL
---------------
For x86 archs, you can just do the yum thing. Yum will download around 110MB of rpm package. So if you have a slow connection, might as well let somebody download it for you.
# yum -y install tremulous.i386
Now, here's my initial screenshot when I was choosing one of the internet gaming servers from web.
I love this 3D strategy game a lot, is really very nice! Adiseable if you have more memory resources and your VGA supports 3D features.
*** Pinoys: If you do have a real slow connection and wishes me to download the rpm for you, that would be no problem, just let me know around here. In fact, I have already downloaded the rpm file as you can see. And I would fly back to Manila for you to have a copy of it into your USB disk, but that would be possible in 2 months time from now :( But really, I would be in Manila soon!
Posted by
VeRTiTO
at
2:56 AM
0
comments
Links to this post
Labels: HowTos
block consecutive IP address using scripts
How to block long list of consecutive IP address?
How to call linux route command inside a script?
How to block consecutive IP address using bash script or perl script?
How to block local IP address permanently?
The are times that a server does not need to listen and process any TCP/UDP request for a long list of consecutive local IP addresses.
This blog entry provides a starting point of creating server scripts to block a long list of consecutive IP address from the server for permanent blocking.
To start, launch your fave editor and create a IPblock.sh bash script like with contents similar to the next few lines. This blog entry assumes that you have bash shell and perl currently installed from the machine.
From below example, we are permanently blocking IP address from
192.168.0.10 to 192.168.0.254.
Here's a simple sample script that does the job.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/bin/bash
echo Blocking started ...
for ((i=10;i<=254;i=i+1)); do
/sbin/route add -host 192.168.0.$i reject
done
echo Done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
This can also be accomplished using perl script which does the same function. Create a separate IPblock.pl perl script like so.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#!/usr/bin/perl -w
my $i;
for ($i=10; $i<=254; $i++ ) {
system ("/sbin/route del -host 192.168.0.$i reject");
}
}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Make sure these scripts are root executable like so
# chmod 700 IPblock.sh
# chmod 700 IPblock.pl
Now, to execute individually
# ./IPblock.sh
# ./IPblock.pl
Additionally, the above scripts can be scheduled for regular execution if you need them so by using crontab utility.
Posted by
VeRTiTO
at
12:40 AM
0
comments
Links to this post
Labels: HowTos
Wednesday, August 15, 2007
using floppy linux command from terminal
How to probe for floppy devices?
How to update or create floppy configuration file and overwrite existing /etc/floppy setup?
How to display available floppy drive with current configuration settings from /etc/floppy?
How to show capacity and format sizes with current floppy disk?
How to format floppy disk from terminal using floppy?
How to format a floppy with verification bit turned on from terminal using floppy?
How to create a FAT (DOS) floppy filesystem?
How to create a EXT2 (Linux) floppy filesystem
Man floppy says:
The floppy utility does low-level formatting of floppy disks. floppy uses a simple interface for formatting disks in floppy controller drives and in ATAPI IDE floppy drives, such as LS-120 "Superdisk" drives. ATAPI IDE support requires a patch to the Linux kernel. Without a patched kernel floppy can only format disks in floppy controller drives.
NOTE: Use caution in formatting anything other than standard 3.5" 1.4MB floppy disks in ATAPI IDE floppy drives. Most LS-120 drives, for example, accept a request to format 120MB high density disks, but most 120MB disks are not designed to be formatted. Low-level formatting will ruin them permanently.
Here's a quick way on handling floppy disk via CLI using floppy linux command. This blog entry assumes that all cables to your floppy drive are all working and properly connected. It is also assummed that a floppy disk is currently inserted into the floppy drive. Make sure you do not have any vital data with the floppy disk as we are going to work with it using the below commands.
How to probe for floppy devices?
# floppy -p
would give you similar results
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
floppy 0.12 Copyright 2001, Double Precision, Inc.
floppy /dev/fd0: 3.5" HD
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The above means, floppy had detected a single floppy drive and assigned it to /dev/fd0. The drive capacity is 3.5" HD .
How to update or create floppy configuration file and overwrite existing /etc/floppy setup?
# floppy --createrc >/etc/floppy
# cat /etc/floppy
would give you similar results like below
~~~~~~~~~~~~~~~~~~~~~~~~
floppy A /dev/fd0
~~~~~~~~~~~~~~~~~~~~~~~~
How to display available floppy drive with current configuration settings from /etc/floppy?
# floppy --showrc
How to show capacity and format sizes with current floppy disk?
# floppy -c /dev/fd0
How to format floppy disk from terminal using floppy?
# floppy -f /dev/fd0
How to format a floppy with verification bit turned on from terminal using floppy?
# floppy -f -v /dev/fd0
How to create a FAT (DOS) floppy filesystem?
# floppy --fat -f /dev/fd0
How to create a EXT2 (Linux) floppy filesystem
# floppy --ext2 -f /dev/fd0
More info for floppy
# info floppy
Posted by
VeRTiTO
at
8:28 AM
0
comments
Links to this post
Labels: HowTos
display word or text file in reversed pattern
Here's a quick way of display text based files in reversed style line per line or character per character, using tac and rev linux commands. As you can notice, tac is the reversed spelling of cat. Tac basically functions the same like `cat` linux command on displaying text files but it is done on reverse pattern or order.
Assumming we have a file named file.txt. To display file.txt contents using cat, we usually do it like so:
# cat file.txt
~~~~~~~~~~~
1
2
3
4
5
~~~~~~~~~~~
Using tac linux command with the intention of reversing the contetnts fo the file in reversed line per line basis, we would have the reversed display of the file like so:
# tac file.txt
~~~~~~~~~~~
5
4
3
2
1
~~~~~~~~~~~
stdout redirection can also be applied with this command to redirect output to another text file like so:
# tac file.txt > reversedfile.txt
Noticed that the reversal was done on line per line basis and not by character per character.
If you wish to reverse a file or word character per character, this is how to do that.
# echo "12345" | rev
displays
~~~~~~~~~~~~~~~~~
54321
~~~~~~~~~~~~~~~~~
Hence, applying rev linux command to linux text files would show us the below results
# cat file.txt
~~~~~~~~~~~~~~~
12345
abcde
~~~~~~~~~~~~~~~
Doing the reversal on character per character basis would now be
# cat file.txt | rev
~~~~~~~~~~~~~~~
54321
edcba
~~~~~~~~~~~~~~~
which can be redirected to file like so:
# cat file.txt | rev > reversedcharacter.txt
Done!
Posted by
VeRTiTO
at
5:24 AM
0
comments
Links to this post
Labels: HowTos
convert a file to equivalent hex/binary code
Decade and years ago, PCTools was one of top list most widely used tool on viewing files with equivalent hexa codes.
Here's how to convert or view a text on its equivalent hex codes.
Assuming file.txt
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Hey diddle diddle,
The cat and the fiddle,
The cow jumped over the moon,
The little dog laughed to see such a sight,
And the dish ran away with the spoon.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to view a file named file.txt in hex code format?
# xxd < file.txt
Below is the screen dumped:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
0000000: 2020 2020 4865 7920 6469 6464 6c65 2064 Hey diddle d
0000010: 6964 646c 652c 0a20 2020 2054 6865 2063 iddle,. The c
0000020: 6174 2061 6e64 2074 6865 2066 6964 646c at and the fiddl
0000030: 652c 0a20 2020 2054 6865 2063 6f77 206a e,. The cow j
0000040: 756d 7065 6420 6f76 6572 2074 6865 206d umped over the m
0000050: 6f6f 6e2c 0a20 2020 2054 6865 206c 6974 oon,. The lit
0000060: 746c 6520 646f 6720 6c61 7567 6865 6420 tle dog laughed
0000070: 746f 2073 6565 2073 7563 6820 6120 7369 to see such a si
0000080: 6768 742c 0a20 2020 2041 6e64 2074 6865 ght,. And the
0000090: 2064 6973 6820 7261 6e20 6177 6179 2077 dish ran away w
00000a0: 6974 6820 7468 6520 7370 6f6f 6e2e 0a0a ith the spoon...
00000b0: 2020 2020 5468 6973 2077 6f72 6420 6973 This word is
00000c0: 206e 6f74 2069 6e20 7468 6520 6469 6374 not in the dict
00000d0: 696f 6e61 7279 204c 696e 7578 0a20 2020 ionary Linux.
00000e0: 2073 6f6c 6172 6973 0a solaris.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to covert text file to hexa file format?
This is simply dumping or redirecting the hexa code stdout output to a file as follows
# xxd < file.txt > newhexfile.txt
If you require to dump the first 100 characters of a file, do as follows
# xxd -l 100 < file.txt
How to convert file to binary digits rather than hex codes?
# xxd -b < file.txt
# xxd -b < file.txt > newbinaryfile.txt
How to view file on on EBCDIC character encoded format?
# xxd -b -E < file.txt
How to have a plain hex dump file or postscript continuous hexdump file style?
# xxd -p < file.txt
Gone are the days of hex viewer from Norton Utilities and PC Tools.
HTH
Posted by
VeRTiTO
at
4:04 AM
0
comments
Links to this post
Labels: HowTos
spell check text file from terminal
This blog entry is here to do spell check of text file(s) remotely via terminal or without using X. This can be done non-interactively and interactively using linux spell and aspell binary.
Here are more details.
Assuming we have an existing file named file.txt .# cat file.txt
Hey diddle diddle,
The cat and the fiddle,
The cow jumped over the moon,
The little dog laughed to see such a sight,
And the dish ran away with the spoon.
This word is not in the dictionary linux
How to spell check text file in terminal non-interactively?
# spell file.txt
gives out mispelled or unknown dictionary words belowlinux
If you wish to spell check interactively, this can be done as follows# aspell -c file.txt
Launching the above commands open up somewhat read only text editor from your screen. Aspell presents you interactively with suggested spelling words that is currently based on aspell dictionary lookup table.
The menus are presented in a friendly way. Mispelled and unknown dictionary words are being highlighted for further action. These available action for mispelled and unknown words are available from choosing single shortcut keys as shown with the lower portion of the screen.
From the above screenshot, solaris is unknown to english dictionary that is why it was highlighted for further correction and/or spell check action.
Spell checking are based on English language as its default, which can be modified by changing the command line arguments. There are more than 100 language options to choose from and Tagalog is one of them! Aspell website can be visited here. If you wish to check all supported languages, you can simply view them by# info aspell
If you wish to view or dump current aspell configuration, do as follow (/etc/aspell.conf)# aspell config
Another binary that comes with aspell rpm package is ispell.
How to check the spelling of a text file interactively using ispell?
# ispell textfile.txt
HTH
Related Post:
Spell Check from Command Line Terminal
Posted by
VeRTiTO
at
3:23 AM
0
comments
Links to this post
Labels: HowTos
create screen timer from linux howto
Creating stopwatch or timer from your screen can be done so many ways. This can be applied when you need to track or watch the exact time duration for certain execution of a particular script commands or application.
How to create a timer using linux CLI commands?
Here are few ways to achieve the timer or stopwatch concept from command line terminal. As follow
1. This command shows real time values from your screen that is being updated every microsecond.
# watch -n 0 date
2. Issuing this command does not provide live screenview of current elapsed time or timer stats. Only then if you press Ctrl+C to stop the process, you'll get to see the elapsed time.
# time cat
# time tee
3. And the below approach makes use of available linux and bash commands like so
# while true; do clear; echo `date`; sleep 1s; done
It still works in Fedora!
HTH
Posted by
VeRTiTO
at
2:54 AM
0
comments
Links to this post
Labels: HowTos
recreate deleted /dev/null
Wikipedia says:
The null device is a special file that discards all data written to it (but reports that the write operation succeeded), and provides no data to any process that reads from it (it returns EOF). In Unix programmer jargon, it may also be called the bit bucket or black hole.
The need to recreate /dev/null does not comes often all the time. But incase the special file was mistakenly deleted, here's a quick way on how to recreate a new /dev/null file.
From Fedora and CentOS box, simply issue as root
# cd /dev
Issuing the below command
# ls -la
should give you the below result if /dev/null does not exist
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ls: cannot access null: No such file or directory
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Creating it would just be issuing the below as root
# mknod /dev/null c 1 3
After creating the special file owned by root alone, we need to change its mode bits as follows
# chmod 666 /dev/null
Alternatively, this can be done in one shot:
# mknod -m 666 /dev/null c 1 3
Now, try the below command for verification that /dev/null was created successfully
# ls -la /dev/null
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
crw-rw-rw- 1 root root 2, 2 2007-08-15 08:11 null
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
It works!
Posted by
VeRTiTO
at
12:13 AM
0
comments
Links to this post
Labels: HowTos
Tuesday, August 14, 2007
harddisk monitoring using smartctl
The smartmontools package contains two utility programs (smartctl and smartd) to control and monitor storage systems using the Self-Monitoring, Analysis and Reporting Technology System (SMART) built into most modern ATA and SCSI hard disks. In many cases, these utilities will provide advanced warning of disk degradation and failure.
Man smartctl says:
smartctl is a command line utility designed to perform SMART tasks such as printing the SMART self-test and error logs, enabling and disabling SMART automatic testing, and initiating device self-tests. smartctl also provides support for polling TapeAlert messages from SCSI tape drives and changers.
Most BIOS that ships with a computer nowadays comes with SMART BIOS feaure. This S.M.A.R.T. BIOS feature can be toggled by entering the BIOS setup before OS boots up. If you found it disabled from the BIOS you can enable them from there or using smartctl tool.
Here's quick ways to install and manage smartctl for your hard drive from Fedora OS.
FEDORA 7 INSTALLATION:
~~~~~~~~~~~~~~~~~~~~~~
# yum -y install smartmontools
USAGE AND PARAMETERS:
~~~~~~~~~~~~~~~~~~~~~~
How to start and check smartctl daemon service?
# service smartd status
# service smartd start
smartctl uses /etc/smartd.conf as its configuration file.
From this file, there is a line that says
DEVICESCAN
The above line makes sure that smartd daemon service starts by scanning and monitoring all attached ATA and SCSI. It is possible not to automatically scan and monitor all attached harddisk by explicitly specifying your harddisk line per line with arguments and by commenting out DEVICESCAN line from smartd.conf. You can also send notifications by email like so
#DEVICESCAN
/dev/sda -S on -o on -a -I 194 -m email@domain.com
The /dev/sda the device to be processed and monitored.
The -S enables automatic Attribute autosave.
The -o enables the automatic off-line testing.
The -a instructs smartd to monitor all SMART features of the disk.
The -I 194 means to ignore changes in Attribute #194, because disk temperatures change often
The -m followed by an e-mail address to which warning messages are sent.
Sysctl makes use of /var/log/messages as its log file for any error and warning issues detected along the harddisk checking.
If you wish to enable smartd daemon service between reboots, you know what to do, like so
# chkconfig --levels 35 smartd on
How to know if harddisk type?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# fdisk -l | grep Disk | head -1
returns
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Disk /dev/sda: 40.0 GB, 40019582464 bytes
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now, how to know if your non-SATA harddisk supports SMART?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# smartctl -i /dev/sda
# smartctl -A /dev/sda
Now, how to know if your SATA harddisk supports SMART?
# smartctl -i -d ata /dev/sda
and for Array SCSI disks
# smartctl -i -d cciss,0 /dev/cciss/c0d0
# smartctl -i -d cciss,1 /dev/cciss/c0d0
How to get vendor harddisk specific attributes?
How to get the harddisk temperature ?
# smartctl -A -d ata /dev/sda
ID 194 and its value would be line for harddisk temperature in IDE/SATA harddisk
For Array SCSI
# smartctl -A -d cciss,0 /dev/cciss/c0d0
# smartctl -A -d cciss,0 /dev/cciss/c0d0
The above commands would also tells you the number of minutes left until the next internal SMART test.
which display more harddisk information such as harddisk types, models, serial number, firmware versions, ATA version and more details.
***Note, I have read somewhere that /dev/hda is gradually being phased out as a detected harddisk name.
How to enable SMART with harddisk?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# smartctl -s on /dev/sda
And for SATA
# smartctl -s on -d ata /dev/sda
and for Compaq Array SCSI drives
# smartctl -s on -d cciss,0 /dev/cciss/c0d0
# smartctl -s on -d cciss,1 /dev/cciss/c0d0
How to check for SMART health status after enabling it?
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# smartctl -H /dev/sda
and for SCSI Array disks
# smartctl -H -d cciss,0 /dev/cciss/c0d0
# smartctl -H -d cciss,1 /dev/cciss/c0d0
The above would show you a PASSED or OK considering that your harddisk is running in good condition, if not, it is advisable to immediately backup all your data and settings immediately before your harddisk fails!
You can also check for SMART error log if there is any, by doing so:
# smartctl -l error /dev/sda
Offline testing can also be done using smartctl which does not affect current harddisk activity.
This can be done by issuing the following commands:
# smartctl -c /dev/sda
The above command shows how long this short and extended test routine would take. You can choose several harddisk test from the below arguments sample.
# smartctl -t offline /dev/sda
# smartctl -t short /dev/sda
# smartctl -t long /dev/sda
# smartctl -t conveyance /dev/sda
and finally, after waiting for several minutes for the above test to finish, you can now proceed on checking the error log again for any harddisk error found like so
# smartctl -l error /dev/sda
Smartctl note:
If the user issues a SMART command that is (apparently) not implemented by the device, smartctl will print a warning message but issue the command anyway (see the -T, --tolerance option below). This should not cause problems: on most devices, unimplemented SMART commands issued to a drive are ignored and/or return an error.
For more info,
# man smartctl
Further readings: http://www.linuxjournal.com/article.php?sid=6983
Posted by
VeRTiTO
at
5:40 PM
0
comments
Links to this post
Labels: HowTos
bind ssh to selected IP address
As we all know, by default installation and kickstart of openssh daemon service (sshd), it binds itself to all existing IP address from given host.
Alternatively, if you wish to bind sshd service to selected IP address, this is possible by simply editing /etc/ssh/sshd_config file.
First, always make a backup copy of conf files you wish to edit.
# cp /etc/ssh/sshd_config /etc/ssh/sshd_config.backup
Launch your fave text editor and edit /etc/ssh/sshd_config
Go to specific lines that shows
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ListenAddress *
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you wish to bind ssh to existing 2 IP address, let's say 192.168.200.1 and 192.168.100.1 , this could be done by changing the above sshd_config lines to
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
ListenAddress 192.168.200.1
ListenAddress 192.168.100.1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
and doing sshd daemon restart
# service sshd restart
and you're good to go.
One applicable instance that his can be useful is that when you have a group of ssh users and there are times you need to disconnect all those currently logged in ssh users except your own remote ssh connections. This can be simply done by shutting down the other interface from where those ssh users are currently connected. And ofcourse, you need to be currently connected with the other interface before shutting down the other interface or IP address.
That is all.
Posted by
VeRTiTO
at
5:26 PM
0
comments
Links to this post
Labels: HowTos
restrict su command to superuser only
Man su says:
su - run a shell with substitute user and group IDs
Restricting su command to root superuser only is really simple. Here are the quick steps.
First, determining the path location of the binary is required.
# which su
returns
~~~~~~~~~~~~~~~
/bin/su
~~~~~~~~~~~~~~~
Remember the current file mode bits and restrictions for su binary
# ls -la /bin/su
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rwxr-xr-x 1 root root 24284 Sep 28 2006 /bin/su
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Noticed that su binary is world executable and world readable. This basically means anybody can call and execute the su binary and gain access to perhaps stolen password with bash-enabled user accounts. If you wish to change this, you can issue the following command as follows
# chmod 700 /bin/su
So, only root and root alone can call su binary command.
Note that, it is not advisable to do this if your su binary is set to suid root, that has similar attributes like below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rwsr-xr-x 1 root root 27052 2007-04-02 16:33 /bin/su
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
as it could affect some apps and package that links to suid root-ted su binary.
The other way around is to modify su pam settings for authenticated usage of su binary.
That's all.
Posted by
VeRTiTO
at
4:03 PM
0
comments
Links to this post
Labels: HowTos
thunderbird install howto
I have just noticed that Mozilla Thunderbird is not installed from one of my desktop.
Thunderbird is safe, fast, and easy email user agent, with intelligent spam filters, quick message search, and customizable views. You can check thunderbird email features from this site. Mozilla Thunderbird 2 is reloaded and more powerful than ever. It’s now even easier to organize, secure and customize your mail.
A quick rundown on how to install thunderbird into your Fedora desktop.
INSTALL:
# yum -y install thunderbird
Launch:
Ctrl+F2, thunderbird
Alternatively, you can download thunderbird here.
Posted by
VeRTiTO
at
12:26 PM
0
comments
Links to this post
Labels: HowTos
dovecot POP3/POP3S server with SSL/TLS install howto
I have decided to blog an entry on installing Dovecot as POP3/POP3S server with SSL/TLS support on mbox-type mail settings.
Dovecot says:
Dovecot is an open source IMAP and POP3 server for Linux/UNIX-like systems, written with security primarily in mind. Dovecot is an excellent choice for both small and large installations. It's fast, simple to set up, requires no special administration and it uses very little memory.
You can find more of Dovecot here.
Some of the most notable features of Dovecot include:
* Dovecot is among the highest performing IMAP servers while still supporting the standard mbox and Maildir formats. The mailboxes are transparently indexed, which gives Dovecot its good performance while still providing full compatibility with existing mailbox handling tools.
* Dovecot's indexes are self-optimizing. They contain exactly what the user's client commonly needs, no more and no less.
* Dovecot is self-healing. It tries to fix most of the problems it notices by itself, such as broken index files. The problems are however logged so the administrator can later try to figure out what caused them.
* Dovecot tries to be admin-friendly. Common error messages are made as easily understandable as possible. Any crash, no matter how it happened, is considered a bug that will be fixed.
* Dovecot allows mailboxes and their indexes to be modified by multiple computers at the same time, while still performing well. This means that Dovecot works with NFS and clustered filesystems.
* Dovecot's user authentication is extremely flexible and feature rich, supporting many different authentication databases and mechanisms.
* Postfix 2.3+ and Exim 4.64+ users can do SMTP authentication directly against Dovecot's authentication backend without having to configure it separately.
* Dovecot supports easy migration from many existing IMAP and POP3 servers, allowing the change to be transparent to existing users.
* Dovecot supports workarounds for several bugs in IMAP and POP3 clients. Since the workarounds may cause the protocol exchange to be slightly less optimal, you can enable only the workarounds you need.
* Dovecot's design and implementation is highly focused on security. Rather than taking the traditional road of just fixing vulnerabilities whenever someone happens to report them, I offer 1000 EUR of my own money to the first person to find a security hole from Dovecot.
* Dovecot is easily extensible. Plugins can add new commands, modify existing behavior, add their own data into index files or even add support for new mailbox formats. For example quota and ACL support are completely implemented as plugins.
Status
* Complete IMAP4rev1 and POP3 support. IPv6, SSL and TLS are supported.
* Supports multiple commonly used IMAP extensions, including SORT, THREAD and IDLE.
* Shared mailboxes aren't officially yet supported, but ACL files are.
* Maildir++ quota is supported, but hard filesystem quota can be problematic.
* Dovecot is commonly used with Linux, Solaris, FreeBSD, OpenBSD, NetBSD and Mac OS X. See the Wiki page about OS compatibility for more.
INSTALLATION:
-------------
Here's how to install Dovecot serving POP3/POP3s request with SSL/TLS support
1. Yum install dovecot as follows:
# yum -y install dovecot
2. Go to /etc/ and make a backup of default dovecot.conf
# cp /etc/dovecot.conf /etc/dovecot.conf.orig
3. Launch your favorite text editor and modify /etc/dovecot.conf. Follow the below instructions:
Protocols we want to be service are pop3 and pop3s, the below lines should be present:
protocols = pop3 pop3s
IP or host address where dovecot would listen for connections. As of this time, it is not currently possible to specify multiple IP address but specifying "*" listens to all IPv4 IP address. "[::]" listens to all IPv6 IP address . Below is line would listen to all IPv4 IP addy.
listen = *
If you wish to change dovecot default port for POP3 and/or IMAP, you can enable the following options
protocol imap {
listen = *:10143
ssl_listen = *:10943
..
}
protocol pop3 {
listen = *:10100
..
}
You can change the port above. Ofcourse, you cannot put the same port for IMAP and POP3.
By default, plain text authentication is enabled. If you wish to disable plain text authentication and enable SSL/TLS, this can be done by doing so
disable_plaintext_auth = yes
Security feature to shut down all POP3 and IMAP processes when dovecot shutsdown, the below lines also shutsdown running POP3/IMAP processes if found.
shutdown_clients = yes
Log file can be customized as well. The below line would be the default value for dovecot log file.
log_path = /var/log/dovecot
For informational messages, you can include them to above log file or have a separate copy. This is optional as well and is not required. Just put a # key character if you wish to disable this feature.
info_log_path = /var/log/dovecot-info
By default, syslog facility is used. If further syslog customization is needed, this is possible by enabling the below lines and specifying a different syslog logging. This is optional and is not required.
syslog_facility = mail
Now, for SSL settings.
If you wish to enable SSL with Dovecot, the below line should be enabled with an IP address
ssl_listen = *
and enabling
ssl_disable = no
If you need to enable SSL/TLS certificate and private key, this can be done with the following lines. Make sure they are root readable only.
ssl_cert_file = /etc/pki/dovecot/certs/myexample.pem
ssl_key_file = /etc/pki/dovecot/private/myexample.pem
Creating the encoded X.509 SSL/TLS certificate can be done in more than 2 ways. Here is the easiest way to do it.
# cd /etc/pki/tls/certs
# make myexample.pem
and answer all the below questions
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Country Name (2 letter code) [GB]: US
State or Province Name (full name) [Berkshire]: LA
Locality Name (eg, city) [Newbury]: SF
Organization Name (eg, company) [My Company Ltd]: MyCompany
Organizational Unit Name (eg, section) []: Finance
Common Name (eg, your name or your server's hostname) []: host.mydomain.com
Email Address []: email@mydomain.com
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
I am not going to cover how to create this certificate file the harder way or in much details as that would be out of dovecot coverage. Verification of these PEM files would also not be covered by this dovecot blog entry. Generating RSA private keys would not also be covered here.
Just make sure they are readable only by root, as for this setup, dovecot master process would run as root, but login-process would be spawned by dovecot user account.
# chmod 400 /etc/pki/dovecot/certs/myexample.pem
# chmod 400 /etc/pki/dovecot/private/myexample.pem
# chown root:root /etc/pki/dovecot/certs/myexample.pem
# chown root:root /etc/pki/dovecot/private/myexample.pem
Optionally, if the key file is password protected, you can specify the password using the below parameter. This is not required for dovecot setup simplicity.
ssl_key_password = mypassword
And for trusted SSL certificate authorities, if any, this can be specified with the below lines. This is optional and not required by default.
ssl_ca_file = /etc/pki/dovecot/certs/ifany.ca
>The above certificate authorities and its creation or request would not also be discussed in details.
For verbose SSL error logging, this can enabled using the below argument
verbose_ssl = yes
An existing user to be used when the dovecot login process begins can be specified using the below line. As default, dovecot user is used, make sure dovecot user account is not bash-enabled account for security purposes.
login_user = dovecot
The only reason to implement a chroot login process is to run a chrooted dovecot. This is not mandatory and disabled by default. If you wish to enable it, you can specify this with the below line
login_chroot = yes
Alternatively, you can set the maximum process size if you use login_process_per_connection feature. This can be customized with the below line. The default value is 32.
login_process_size = 64
If you are implementing dovecot with SSL/TLS feature, login process are created with its own process, which is more secure. Disabling it would make the dovecot login process faster which is a trade off of not having a more secure process.
login_process_per_connection = yes
Docevot spawned children limit can be customized using the next line. If you have thousand of dovecot user at a time, it is adviseable to increase the value here.
login_max_processes_count = 128
login_max_connections = 256
auth_worker_max_count = 30
Customized login greetings can be done like the below. When you do a telnet to dovecot port, this is what you get from the port reply.
login_greeting = Lets RockNRoll
Leave the below setup to its default values for logging format to logfiles
login_log_format
login_log_format_elements
If you wish to require a valid SSL client certificate, which is optional, this can be done using the below argument. It is disabled by default.
ssl_require_client_cert = yes
Locking the mailbox for the entire POP3 session is not adviseable.
pop3_lock_session = no
With the above setup, considering that you are not implementing a database of user accounts or mdir email settings, dovecot can be started successfull at this point.
# service dovecot start
Dovecot should start successfully.
If you wish to customized dovecot.conf further, you can proceed by reading more of dovecot feature and customization from its dovecot.conf.
More arguments and extra checking shown below
If the user-given username contains a character not listed in here, the login automatically fails. This is for additional anti brute-force and dictionary attacks security settings.
auth_username_chars = abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ01234567890.-_@
If a more verbose logging is required, this can be done with the following
auth_verbose = yes
auth_debug = yes
auth_debug_passwords = yes
Further mbox-specific settings can also be customized. Below are some customizeable values
mbox_read_locks = fcntl
mbox_write_locks = fcntl
mbox_lock_timeout = 300
mbox_dirty_syncs = no
mbox_lazy_writes = no
mbox_min_index_size = 0
mbox_dotlock_change_timeout = 60
There is no required modication that needs to be done under POP3 specific settings. It should work with default values.
STARTING DOVECOT:
-----------------
# service dovecot start
CHECKING DOVECOT PROCESS/PORTS:
--------------------------------
# netstat -latpanu | grep dovecot
# ss -a | grep pop3
# cat /etc/services | grep pop3
# telnet ip-address-here 110
# ps axuw | grep dovecot
LOG MONITORING:
---------------
# tailf /var/log/dovecot
HTH
For further reading, you can visit these pages:
Dovecot site here: , and here, more authentication wiki here, and virtualusers here.
Posted by
VeRTiTO
at
10:30 AM
0
comments
Links to this post
Labels: HowTos
qpopper POP3 server install howto
Nowadays, there are lots of POP/POP3 server packages to choose from, some of them comes as an enterprise versions that includes the whole mail collaboration packages with webmail, mail server packages, and POP/POP3 feature and more.
This blog entry focuses on installing QPopper from Eudora. I met Qpopper from earlier RedHat versions years ago and had served many POP3 connections from those old cloned pentium server boxes that I have managed pretty well.
Qpopper site says:
Qpopper is most widely-used server for the POP3 protocol (this allows users to access their mail using any POP3 client). Qpopper supports the latest standards, and includes a large number of optional features. Qpopper is normally used with standard UNIX mail transfer and delivery agents such as sendmail or smail.
Qpopper's goals are: security, stability, safety, features, and performance. Check more from their site. and here .
You can browse the latest Qpopper beta from here.
Now, I have decided to try a QPoppper test install once again of this Qpopper package into my Fedora 7 box and put an entry here as I go along live installing it and see if I can do it still.
Here's how to install QPopper.
1. Download the latest tar balls from ftp://ftp.qualcomm.com/eudora/servers/unix/popper/beta/ . I have decided to download qpopper4.1a5.tar.gz for this purpose. You can do this by issuing
# wget -c ftp://ftp.qualcomm.com/eudora/servers/unix/popper/beta/qpopper4.1a5.tar.gz
2. Untar the tar ballz like so
# tar zxvf qpopper4.1a5.tar.gz
3. Go to extracted files and folder
# cd qpopper4.1a5/
4. Now do configure stuff with specified options
# ./configure --enable-log-facility --enable-log-login --enable-server-mode --enable-specialauth --enable-standalone --enable-timing
You can specify other configure options like so
--with-pam=pop3 for PAM authentication
--with-openssl
# make ; make install
popper binary would be installed in /usr/local/bin by default. So the next setup lines would have a reference to popper binary on that folder location. Default log file would be /var/log/qpopper.log
5. Create /etc/xinet.d/pop3 file
service pop3
{
disable = no
socket_type = stream
wait = no
user = root
bind = MY-IP-ADDRESS-HERE
server = /usr/local/bin/popper
server_args = -s -R -t /var/log/qpopper.log
log_on_success += HOST DURATION
log_on_failure += HOST
}
6. Do restart xinetd service as follows
# /sbin/service xinetd restart
If you wish to implement Qpopper on production servers, make sure Qpopper starts permanently between reboots by doing so:
# chkconfig --levels 35 xinetd on
If not, you can skip the step above this line.
7. Do some test if QPopper was installed properly via xinetd by doing a telnet connection into that port 110 of binded IP address, as follows
# telnet MY-IP-ADDRESS-HERE 110
If you have successfull Qpopper installation, it should give you similar lines like I had
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Escape character is '^]'.
+OK Qpopper (version 4.1a5) at ver starting.
^]
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Note, you can not telnet to port 110 of localhost if you bind it only to the public IP address
Success.
Wow, these are just 7 quick and smooth QPoppper installation steps with Fedora 7 distro !
Qpopper can work with Fedora 7 still, just like old RedHat days! :)
Doing it via yum
# yum search qpopper
does not return any search results.
HTH
Posted by
VeRTiTO
at
7:51 AM
0
comments
Links to this post
Labels: HowTos
Monday, August 13, 2007
my other linux pages
Hi all! Thanks for visiting and posting comments to A Linux SysAd Blog. I appreciate.
FYI, I have just created a separate blog entry that would cover mostly growing Linux news around the OS arena, and other not so technical linux pointers that might be of extra tips and dings to others too!
Should you be interested anyhow, here's the link.
http://linuxpages.blogspot.com/
Have a nice day to all!
Thanks so much.
VeRTiTO
Posted by
VeRTiTO
at
8:58 AM
0
comments
Links to this post
Labels: HowTos
Sunday, August 12, 2007
more ssh log parsing and monitoring
Server SSH log files provides us information from simple system to critical system security message.
This is a continuation of parsing ssh log file blogged recently which can easily be found here. I have chosen for now, to look back of parsing ssh log files as openssh is one of the most useful, most powerful tool and widely used linux command on managing servers specially remote ones.
From previous blog entry, it was also covered an issue wherein we can generate these top lists of message details of a particular grep result that we can find from parsing /var/log/secure* log files.
Here are quick ways of doing it via CLI terminal. These examples could serve also as starting point to parse more search key strings not only from any ssh log files, but also to other daemon service log file such as dovecot, postfix, sendmail, apache, mysql, iptables, DNS, chilli, radius, voip applications, and more linux service log files.
Here goes.
How to generate top 10 list of most authenticated ssh logins by a user regardless of date and IP address based from /var/log/secure* log files?
One shot command:
# cat /var/log/secure* | grep Accepted | awk '{print $9 " " $11 }' | sort | uniq -c | sort -rn | head -10
Sample filtered output:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
153 vertito 192.168.100.3
124 vertito 192.168.100.25
56 vertito 192.168.100.18
41 vertito1 192.168.100.30
37 v 192.168.100.25
32 vertito2 192.168.100.3
6 vertito3 192.168.100.25
5 vertito5 192.168.100.10
2 vertito1 192.168.100.14
1 root 192.168.100.3
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interpretation:
There were 154 successful ssh logins made by bash-enabled user account named vertito coming from 192.168.100.3 IP address, it was the highest in number based on the recent query.
Just add more parameter to show the results with corresponding dates like so:
We are only adding $1 and $2 , which are the month and the day of the month respectively.
# cat /var/log/secure* | grep Accepted | awk '{print $9 " " $11 " " $1$2}' | sort | uniq -c | sort -rn | head -10
You can actually create a bash script that does this one liner command and redirect the output to a file. From there, the bash script counts the output list from the command or from the generated file. If the count is more than a threshold, then further notification and action is done by sending email to server admins.
Linux commands comes in many variety and flexible ways specially when combined and redirected to or from another linux command.
Now, let's get the most authenticated IP address of any ssh user account.
How to generate top list of most commonly IP address on all successful logins from ssh default log file regardless of user names and dates?
# cat /var/log/secure* | grep Accepted | awk '{print $11 }' | sort | uniq -c | sort -rn
Sample results, modified to hide real IP address
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
186 192.168.200.3
168 192.168.200.25
56 192.168.200.18
41 192.168.200.30
5 192.168.200.10
2 192.168.200.5
2 192.168.200.14
1 192.168.200.17
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Interpretation:
There were 186 times of successful authenticated ssh logins from IP address 192.168.200.3, it was the most used IP address with successful ssh authentications.
Now, how about getting the top 10 of the most highest number of successful ssh authentications based from day of the month?
# cat /var/log/secure* | grep Accepted | awk '{print $1 " " $2 }' | uniq -c | sort -rn | head -10
Result:
~~~~~~~~~~~~~~~
62 Jun 10
33 Jun 23
29 Jun 25
19 Jun 26
18 Jun 8
18 Jun 1
16 Jul 9
13 Jun 12
13 Jun 11
12 Jun 7
~~~~~~~~~~~~~~~
Interpretation:
There were 62 successful ssh authentication attempts last June 10. It was the highest in number of most successful ssh logins based from /var/log/secure* log files.
From the above example, remember that we are only 'grep'-ing "Accepted" as a search key. Accepted refer to successful ssh logins whether by password authentication or private/public key authentications depending on your ssh server configs.
You can expand these queries to a more wider scope and also apply them to any other log files of your server with proper search key or filter words such as 'refused' , 'denied' and more. Hope to cover the other log files too sooner or later. These bash commands combination can also be converted to perl expressions as well, that can also be issued from command line terminal.
If this blog entry has been useful and/or informative to you in any way, you know what to do.
Goodluck!
Posted by
VeRTiTO
at
3:17 PM
0
comments
Links to this post
Labels: HowTos
checking daemon service bash script
How to restart daemon service if found not running?
How to check for service at regular time interval?
How to send notification from terminal?
How to find PID of daemon?
How to have a heartbeat-like checking of service?
How to create a script that checks for linux service?
This blog entry serves as a basic start for creating bash shell scripts that checks daemonized linux service regularly.
A real quick bash script on how to check postfix and sendmail daemon service every 5 minutes.
The below example checks sendmail damon service as an example. All lines that start with # character are bash comments for clarity.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
#! /bin/bash
PATH=$PATH:/usr/bin:/bin
# fetch system date below
date=`date "+%A %m-%d-%Y %r"`
# we use pidof to get the daemon PID
# we use awk to get the first child PID only for possible daemon children thread
ayos=`/sbin/pidof sendmail | awk '{ print $1}'`
# if PID has a value greater than 0 then the service is alive then
if [ $ayos > 0 ] ; then
# everything is OK
echo service is alive
exit 0
fi
# goes here if there is no existing PIDs, thus we need to restart it
# and sends email notification to admins
if [ $ayos = 0 ]; then
echo Dead, starting sendmail daemon service now...
# SERVICE RESTARTS SHOULD COME FIRST BEFORE SENDING OUT ANY EMAIL NOTIFICATIONS
# (thx to srineer)
/sbin/service sendmail restart
echo "Restarted at $date" | mail -s "sendmail from server restarted" youremail@yourdomain.com
fi
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can execute this script from command line or from crontab jobs. Crontab jobs sample can be from this link. Adding it to crontab jobs like so
# */5 * * * * /root/myscripts/check_service.sh > /dev/null 2>&1
Make sure the scripts is root executable like so
# chmod 700 check_service.sh
and you're good to go.
Alternatively, this can modified further to fit other daemon services like postfix, dovecot, apache, mysql, spamassassin, mailscanner, antivirus, bind DNS, radius, and other daemon services that make use of PIDs!
HTH
Posted by
VeRTiTO
at
1:36 AM
0
comments
Links to this post
Labels: HowTos
Saturday, August 11, 2007
HTML CHM help file viewer install howto
Saturday.
I was curious downloading some ebooks in a publicly available FTP site convinced me to download an old RedHat/Fedora ebook. After downloading the file successfully,I suddenly realized that I mistakenly downloaded the ebook in a MS compiled help file format instead of the usual Adobe Reader file format. How unfortunate as I left my seat infront of the screen for a 6 minute download and suddenly realized I have downloaded a CHM ebook file.
MS compiled help file (CHM) are indexed html file with a file extension of .chm . Viewing this type of files are somewhat similar to viewing HTML pages. However, the context format are properly organized and indexed as if you are reading a book with quick indexed links and menus available in a dropdown tree-like indexed links located at the leftmost side of the viewing pane.
Ofcourse, an attempt to open it inside my fedora box failed as the viewer is not yet installed.
Here is quick simple solution on how I manage to open this CHM file ebook.
Here's how to install CHM file viewer in Fedora and CentOS linux.
KchmViewer - CHM file viewer
----------------------------
KchmViewer is a chm (MS HTML help file format) viewer, written in C++. Unlike most existing CHM viewers for Unix, it uses Trolltech Qt widget library. It is compiled with full KDE support, including KDE widgets and KIO/KHTML.
Since the binary starts with K, it is part and designed for KDE, but it would work with Gnome with resolved dependencies.
Here is the full list of kchmviewer features taken from the site.
* Standalone viewer, depends on Qt only. Does not require KDE, but can use it for extra functionality if configured with --with-kde. Does not require or use Gnome, gtk or wxWindows libraries.
* When compiled with KDE support uses a KIO slave, KHTML, KDE widgets and DCOP support.
* Safe and harmless. In Qt mode ignores JavaScript, and warns you before opening an external web page, or switching to another help file. While using KHTML, executing Javascript is an option.
* Supports tab browsing.
* Correctly detects and shows encoding of any valid chm file.
* Correctly shows non-English chm files, including Cyrillic, Chinese, Japanese and others.
* Correctly searches in non-English chm files even using chm built-in search index (but does even better with its own search engine).
* Correctly shows tables of content and indexes even in broken CHM files.
* Shows an appropriate image for every TOC entry.
* Has complete chm index support, including multiple index entries, cross-links and parent/child entries in index.
* Persistent bookmarks support. Allows to store bookmarks even if "Favorites" window was not enabled for this chm file. Stores not only the page, but also the screen position for every bookmark. You can edit/delete bookmarks.
* For any opened chm file stores the last opened window, window size, search and bookmark history, font size and other settings, so when you open this file again, everything is always on the place.
* Has easy and powerful search-in-page support.
* Allows to increase or decrease the font size, so handicapped people can read texts easily.
* Has standard Back/Forward/Home navigation.
* Has next-in-content-table and prev-in-content-table navigation.
* Can print the opened pages on a standard printer (usually via CUPS).
* Can show HTML source of CHM pages either using internal viewer, or external, specified by user.
* Correct ms-its link support: can switch CHM files by clicking links in different CHMs.
* Supports full-screen, and turning off content window.
* Has advanced built-in search engine, which:
o does not require the search index to be present in chm file.
o indexes all the characters, including symbols, which allows you to search for code like "$q = new SWFAction()"
o supports all the languages chm file could be written in, including those using Cyrillic, European or multi-byte chatsets.
o supports phrase search.
* KDE version supports automation through DCOP interface.
How to install kchmviewer?
# yum -y install kchmviewer
Launch: Ctrl+F2, kchmviewer
which downloads around 300K of rpm installer and dependencies!
Posted by
VeRTiTO
at
4:33 PM
0
comments
Links to this post
Labels: HowTos
du - the disk usage linux command howto
du stands for disk usage. This simple linux command provides a summary of harddisk or storage space disk usage. It has many parameter arguments that can provide results in many screen format. du command can also summarize files and directories in a recursive manner.
Here are several usage of to use the du (disk usage) command.
# cd /home/vertito
To list the files and directories from there
# ls -la
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
-rw-r--r-- 1 root root 29 2007-08-11 11:57 file.txt
drwxr-xr-x 2 root root 4096 2007-08-11 11:57 folder1
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Show summary in bytes
# du -b
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4096 ./folder1
8221 .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
# du -a
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4 ./file.txt
4 ./folder1
12 .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now, let us get a more human readable results
# du -ah
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.0K ./file.txt
4.0K ./folder1
12K .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The above shows that my file.txt has about 4K of filesize rounded to nearest power of 1024K including . an ..
Now, let us it in bytes
# du -ab
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 ./file.txt
4096 ./folder1
8221 .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
The above is the same results you get from issuing ls -la command. 8221 is . and ..
Now let us do it once again in human readable form
# du -abh
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
29 ./file.txt
4.0K ./folder1
8.1K .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
You can also exclude file glob pattern or shell expression for files like so
# du -abh --exclude='file.txt'
# du -abh --exclude='*.txt'
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.0K ./folder1
8.0K .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Recursive directory disk usage summary can also be achieved by doing the default usage without any parameters
# cd /home
# du
You can also limit the recursive search dept like so
# du --max-depth=2
which search on the 2nd level of directory only and ignores any folder found above the 2nd level folders.
Getting the summarized return in a human readable form
# du -sh
Alternatively if you wish to get the last time modification
# du -ah --time
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
4.0K 2007-08-11 11:57 ./file.txt
4.0K 2007-08-11 11:57 ./folder1
12K 2007-08-11 11:57 .
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
If you are using mbox type of mail storage handling, these commands can be handy checking and reporting partition and/or folder disk usage when incorporated inside a shell scripts. Furthermore, you can create and generate your TOP 10 users with largest mails on monthly or weekly basis that could give you more detailed email report and alerts from it..
At regular interval and again using a script, you can also watch and monitor folder/partition usage changes and alerts you for certain specified thresholds like for /home or /var/ftp or /tmp.
And more.
These are all available from man du.
Have a nice weekend!
Posted by
VeRTiTO
at
4:36 AM
0
comments
Links to this post
Labels: HowTos
Friday, August 10, 2007
gnome language translator install howto
How to translate from one language to another locally from your linux machine?
How to install Gnome-based language translator?
How to translate word and languages from CLI terminal?
How to translate a URL from CLI terminal?
GNOME Translate is a GNOME interface to libtranslate library. It can translate a text or web page between several natural languages, and it can automatically detect the source language as you type. It also makes use of generic module supporting web-based translation services, libtranslate. More info from Gnome translate can be found here.
Nowadays, with several web-based language translator, the process of having language translation is very simple as long as you have web access. Users just need to visit their site and paste from there those words or even the paragraphs that need to be translated. One famous web translator is Babelfish before Google launched their own famous URL and language translator, which is publicly available here.
Here's one quick way of installing Gnome-translate
# yum -y install gnome-translate
Launch: Ctrl+F2, gnome-translate
Gnome Language Translation Process:
The operation of this gnome-based language translator is very simple.
Assuming an internet connection is present, the user is presented with two box areas. One box area for the first language to be translated and another box area for the translated form. Gnome-translate makes use of several web-based language translator engine. These site engines can be modified by priority by going to Edit > Preferences.
How to translate a URL site or words via CLI terminal?
------------------------------------------------------
Translate the word "What" from English to French and prints it on standard output.
# echo "What" | translate -f en -t fr
Result:
~~~~~~~~~~~
Ce qui
~~~~~~~~~~~
and to Espanol
# translate -f en -t es vertito.txt
Result:
~~~~~~~~~~~~
Hola. ¿QuĂ©?
~~~~~~~~~~~~
How to translate a website URL?
How to dump the standard output of a translated URL page?
# elinks `translate -f en -t fr http://ilovetux.com`
# elinks `translate -f en -t fr http://ilovetux.com` > translated.html
How to do traslate a readable text document via CLI terminal?
# cat vertito.txt
Hello. What?
# translate -f en -t fr vertito.txt
Result:
~~~~~~~~~~~~~~~~~~~~~
Bonjour. Ce qui ?
~~~~~~~~~~~~~~~~~~~~~
*** There are instances that the web translator would block the IP temporarily IF a user reached his daily threshold of translating a language using their web based translation engine.
Watch out for an upcoming language translation alternative. I heard it comes with its own language translation engine. More info can be found here.
HTH
Posted by
VeRTiTO
at
5:16 AM
0
comments
Links to this post
Labels: HowTos
display linux memory information howto
Issue these commands to get more details of your hardware memory.
# cat /proc/meminfo
# free -l
Here's what I have:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
MemTotal: 1034748 kB
MemFree: 105860 kB
Buffers: 162688 kB
Cached: 132020 kB
SwapCached: 18908 kB
Active: 709068 kB
Inactive: 160420 kB
HighTotal: 130848 kB
HighFree: 260 kB
LowTotal: 903900 kB
LowFree: 105600 kB
SwapTotal: 2112508 kB
SwapFree: 2076880 kB
Dirty: 256 kB
Writeback: 0 kB
AnonPages: 558368 kB
Mapped: 12580 kB
Slab: 43300 kB
PageTables: 5572 kB
NFS_Unstable: 0 kB
Bounce: 0 kB
CommitLimit: 2629880 kB
Committed_AS: 1167612 kB
VmallocTotal: 114680 kB
VmallocUsed: 2816 kB
VmallocChunk: 111772 kB
HugePages_Total: 0
HugePages_Free: 0
HugePages_Rsvd: 0
Hugepagesize: 4096 kB
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
From 'free' command
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
total used free shared buffers cached
Mem: 1034748 965504 69244 0 163020 131216
Low: 903900 834916 68984
High: 130848 130588 260
-/+ buffers/cache: 671268 363480
Swap: 2112508 35628 2076880
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Posted by
VeRTiTO
at
1:01 AM
0
comments
Links to this post
Labels: HowTos
display the number of processor howto
If you've just bought a new desktop or laptop, and the box says the box is powered by 2 processors, you can actually verify that.
Here's how to display the number of processor of your linux box.
Simply issue as root
# cat /proc/cpuinfo | grep processor
Everything in linux is files. This command simply retrieves the number of processors that linux detected from /proc/cpuinfo and displays it. Usually, the processor number comes at the first set of line from issuing the command.
Here's what the command returned for me:
~~~~~~~~~~~~~~~~~~~~~~~~
processor : 0
~~~~~~~~~~~~~~~~~~~~~~~~
which means I have 1 processor with a processor ID number 0. Processor counting starts with 0.
So if you have a PC with core duo, you will probably have 2 lines that says 0 and 1.That is 2 processors.
HTH
Posted by
VeRTiTO
at
12:53 AM
0
comments
Links to this post
Labels: HowTos
3d tabletennis game install howto
How to install a 3D tabletennis game?
CannonSmash is a 3D table tennis game. The goal of this project is to represent various strategy of table tennis on computer game. This program requires OpenGL and SDL. If your machine doesn't have 3D
accelaration video card, this program runs very slowly. More can be found here.
INSTALL:
# yum -y install csmash
Launch: Ctrl+F2, csmash
I was searching for more 3D games and I come up with csmash.
This 3D strategy game is very interesting linux game that basically requires a quick reflex attack and counterattack decision making moves. In a split of a second, with this game, the player needs to consider, atleast more than five factors to have a very quick and accurate ball return to gain point or score against the opponent.
You can play it via LAN, internet, or against the computer. The game can be in 3D full screen or 3D window screen as you can see from the below screen shot. Very simple same like playing table tennis inside a house without exerting too much effort while standing. With same depth of decision making to gain points against the opponent. Real quick counter attack ball return decisions while the other player hits the ball back to you. This ball return exchanges continues until the ball landed out of the table. And this happens in a macro of a split second. This is exciting!
I am going to spend more time with this game during weekend, but for now, here's an initial screenshot taken from program launch.
Unfortunately, this program requires OpenGL and SDL. If your machine doesn't have 3D accelaration video card, this program hogs and runs very slowly.
From the above, you are seeing a transparent player. This screen display can be toggled to a multivector lines, a shoulder only feature or a transparent body.
There are also three levels of the game namely Easy, Normal, Hard. The Easy option is already challenging to table tennis player like me. Amazing game where you can have more type of opponent. Pen drive tactic, Shake Cut and Pen attack type of players, that offers variety of spin type return balls and ball speed returns. What more, scoring is done by computer with audio support.
I gave it 4 stars of linux 3D strategy game.
Enjoy!
Posted by
VeRTiTO
at
12:13 AM
0
comments
Links to this post
Labels: HowTos
Thursday, August 9, 2007
Nokia N70 on Fedora via USB data cable
How to transfer data from Fedora to Nokia N70 phone via USB data cable?
How to install obexfs?
Additionally, here's a quick dirty steps on how to transfer files from Fedora 7 box into your Nokia N70 mobile via USB data cable.
# yum install obexfs
Insert the USB data cable into your Nokia N70 and then plug the other end to one of the USB portsof your PC.
Check some output from the log files.
# tail -f /var/log/messages
Your Nokia N70 screen should show a small USB icon from its desktop screen. Now, try to connect to your Nokia N70 from terminal like so
# obexftp -u 1 -l
You can optionally change the 3rd column values from 1 to 4 as this represents the USB port number.
See more output of this command:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Connecting...done
[folder name="C:" user-perm="RW" mem-type="DEV" label="Phone memory"]
[folder name="E:" user-perm="RW" mem-type="MMC" label="Memory card"]
[folder-listing]done
Disconnecting...done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List out files from the N70 Image folder from Memory Card drive E: as shown above:
# obexftp -u 1 -c E:\\Images -l displays
which gives similar results below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
[folder-listing version="1.0"]
[parent-folder ]
[folder name="200707" modified="20070722T132832Z" user-perm="RWD" mem-type="MMC"]
[folder name="Opera" modified="20070722T220940Z" user-perm="RWD" mem-type="MMC"]
[file name="dad.mom.framed.jpg" size="3896041" modified="20070809T004126Z" user-perm="RWD"]
[file name="dayckids.jpg" size="49328" modified="20070809T004250Z" user-perm="RWD"]
[file name="DSC00628.jpg" size="143847" modified="20070809T004430Z" user-perm="RWD"]
[folder-listing]done
Disconnecting...done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Now, prepare a sample file like MP3 file for data transfer from PC to Nokia N70. Make sure you have a short MP3 filename and it ends with .MP3 or .MP4 filename extensions.
You can transfer files like so
# obexftp -u 1 -c E:\\Images -p TheReason.mp3
Similar results below:
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Connecting...done
Sending "E:\Images"... done
Sending "TheReason.mp3"...\done
Disconnecting...done
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
List again the files of that folder as follows
# obexftp -u 1 -c E:\\Images -l displays
Be reminded that Nokia N70 only supports USB 1.2. This means the data transfer rate is way to slow compared to USB 2.0 from digicams and videocams nowadays.
You can try to browse the video folder like so
# obexftp -u 1 -c E:\\Videos -l displays
It's dirty data transfer via USB data cable but better than nothing for now.
# man obexftp
No discredits intent, but my attempts to accomplish more communication and data exchange between Fedora 7 and Nokia using X based packages like xgnokii, wammu and kmobiletools failed. :( I am going to try at some time but not sooner.
If ever anyone here who has been successful doing establishing connectivity using gnokii, xgnokii, wammu, kmobiletools, or contacts/address book synchronization with Thunderbird or Firefox, that would really really BE a nice tip!
But for now,..consider it as another entry backlog for me, some other time then.
Posted by
VeRTiTO
at
2:08 PM
0
comments
Links to this post
Labels: HowTos
Fedora 7 as guest host from VirtualBox
This document is intended as a walksthrough for these simple installation process of having Fedora 7 as virtual guest operating system using VirtualBox. VirtualBox is one powerful virtualization product for server and home use. More info of VirtualBox can be found here. How to install VirtualBox is also available from this blogspot located here.
For those who wishes to evaluate Fedora 7, this entry would somehow give you an idea how to go through the process of having virtual F7 via VirtualBox. Installation process gets clearer and easier if screenshots maps are overviewed. Here are those screenshots.
The first few sets are wizard type screenshots of creating virtual machine for VirtualBox. The process of creating the virtual machine is simple. 


This is the amount of memory to be allocated to the virtual machine as shown below. Make sure you are not allocating all your base memory as it degrade performance with the master host.
The buttons and choices I have selected from these wizard window are the ones I have chosen before clicking the Forward button.
From below harddisk details, I have chosen fixed hard disk space for this one. VirtualBox tends to be more GUI friendly asking wizard type virtual machines specification in a step by step manner.


If you click these images, you can also read helpful contents of each wizard box prompts that provide more information of choosing specific options offerred from the wizard prompt.

Now comes the first part of installing Fedora 7 as virtual guest host for VirtualBox. Booting from DVD ISO image, as configured from the VirtualBox settings for the virtual machine, it now continues to load Installation Options as shown below.


Choosing only default values presented and default package selections, as you can see from these screenshots. 
The intent here was to have screenshot guides and overview Fedora 7 virtualization as guest host for VirtualBox. 
After all the selected default packages and firt boot configuration, a final reboot is required as show above. Below are last screenshots of Fedora 7 booting as virtual guest host for VirtualBox.
System initialization begins here.
User login prompt.
And the newly installed Fedora 7 guest host for VirtualBox!
The Fedora 7 virtual machine is now ready for further test evaluation.
The daemon service for VirtualBox can be managed as follows:
# service vboxdrv status
Congratulations, well done VirtualBox guys!
Keep it up, well done!
Posted by
VeRTiTO
at
12:01 PM
0
comments
Links to this post
Labels: HowTos
at - jobs scheduling howto
Here's another way to queue and execute jobs for later execution. This approach is handy when you need to execute a one time job scheduled in the future, that is ahead of the host current date and time.
This blog entry covers job scheduling using at.
ATD DAEMON SERVICE:
===============
Before anyone can make use at command, atd daemon service should be up and running. Like so:
# service atd start
# service atd status
Remember, if you need them to start permanently during after reboot, make sure you configure them like so:
# chkconfig --levels 35 atd on
# at -f myscript.sh -v 11:45
After this successful schedule, at return at job ticket ID 7 like so
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
job 7 at Fri Aug 10 10:54:00 2007
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
How to list out all 'at' scheduled jobs
# atq
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
7 Fri Aug 10 10:54:00 2007 a root
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
All 'at' jobs are listed as files from /var/spool/at .
How to delete 'at' job ticket ID?
# atrm 7
AT RESTRICTIONS
===============
/etc/at.allow - usernames listed here are permitted to use at mechanism
/etc/at.deny - usernames listed here are denied to use at mechanism;
if at.allow does not exist and at.deny exist with no usernames, all user accounts
are permitted to use at mechanism
If both of them does not exists, only root can use the 'at' mechanism.
How to get more detailed info of 'at' scheduled job?
# atrm -c 7
'AT' mechanism can also send email to the user when that particular job has completed.
More samples.
Executes myscript.sh around 11:45AM
# at -f myscript.sh 11:45AM
# at -f myscript.sh 11:45AM tommorrow
# at -f myscript.sh 11:45AM + 2 days
# at -f myscript.sh 11:45AM Aug 10
# at -f myscript.sh 11:45AM monday
# at -f myscript.sh 11:45AM next week
You can further study time specification from this file /usr/share/doc/at-3.1.10/timespec .
HTH
Posted by
VeRTiTO
at
2:36 AM
0
comments
Links to this post
Labels: HowTos
Wednesday, August 8, 2007
Nokia 70 linux connection via bluetooth dongle howto
How to detect bluetooth USB dongle?
How to start bluetooth daemon service?
How to detect Nokia N70 using Fedora 7 distro?
How to transfer files between Nokia N70 using Gnome via bluetooth USB dongle??
How to transfer files between Nokia N70 using CLI via bluetooth USB dongle??
How to install gnome obex server?
How to do bluetooth pairing device?
How to install KDE bluetooth tools?
What other document formats is supported by Nokia N70 file types?
I recently bought a Nokia N70 Music Edition (ME) phone. Not the latest nokia phone, but nice and sweet having 1 GB of memory disk too, same with N95. And it was only now that I managed to keep up with its menus, todos, and howtos. I finally find a glitch of my time establishing a connection between my current Fedora 7 box to this Nokia N70 ME via Bluetooth USB dongle I just borrowed. Nokia N70 phone details can be seen here.
Yes, it was very hard to do this! I have opened and googled