RSS Subscription
Linux Howtos & Tutorials

Enter your email:

Delivered by


NOTE:New tutorials are from LinuxCareer.com

Poll

Do you own or wish to have iPhone?
 


Linux eBooks FREE Download
A guide to programming Linux kernel modules
Introduction to Linux - A Hands on Guide
A Newbie's Getting Started Guide to Linux

Linux from Scratch - Create Your Own Linux System - Free eBook

Linux: The Hacking Solution (v.3.0)

SQLite 3 with PHP Essential Training – Free Video Training Tutorials

This guide will introduce you to the world of GNU/Linux

The GNU/Linux Advanced Administration

A Complete Beginner's Manual for Ubuntu 10.04 (Lucid Lynx)

Advanced Bash-Scripting Guide

Set up, maintain, and secure a small office email server

Partner Linux Sites:
How-To.LinuxCareer.com
Jobs.LinuxCareer.com
TuxMachines
Monsterb
LinuxBloggers
AdamsInfo
LinuxScrew
All For Linux

Linux administration notes & code snippets

Hotfile direct download with wget

Last Updated on Tuesday, 30 November 2010 15:18 Sunday, 21 November 2010 09:17

If you wish to download files from a hotfile.com ( file hosting ) using wget you need to have three things:

  • hotfile premium account
  • hotfile direct downloads enabled in you hotfile profile
  • OS with a wget command

Once you have all of the above, create a following script and insert your hotfile authentication credentials:

#!/bin/bash

MYUSERNAME=<your hotfile username here>
MYPASS=<your password here>

wget -q --save-cookies .hotfile-cookie --post-data \
"returnto=%2F&user=$MYUSERNAME&pass=$MYPASS&=Login"\
-O - http://www.hotfile.com/login.php
> /dev/null for i in $( cat $1); do wget -c --load-cookies .hotfile-cookie $i done rm .hotfile-cookie

The above script accepts a single argument and that is a file with all URLs you wish to download. One URL per line ! Make the script executable:

$ chmod +x hotfile-direct-download.sh

Execute the script and supply a single argument with all URLs to download:

$ ./hotfile-direct-download.sh URLs.txt

Share this linux post:

Submit Hotfile direct download with wget in Delicious Submit Hotfile direct download with wget in Digg Submit Hotfile direct download with wget in FaceBook Submit Hotfile direct download with wget in Google Bookmarks Submit Hotfile direct download with wget in Stumbleupon Submit Hotfile direct download with wget in Technorati Submit Hotfile direct download with wget in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.
Add a comment
 

Thecus N2100 entering a Redboot boot loader command interface

Saturday, 20 November 2010 20:33

If you own a Thecus 2100 NAS storage and you need to recover from some software accident you have two options. One is to use a USB serial connector or use telnet to stop booting sequence of Redboot loader. Here is how to do the second, easier option.

What you will need is:

  • PC or laptop with Ethernet card
  • your PC will preferably a running linux ( in my case I have Debian )
  • CAT5/6 Ethernet cable

Note:You need to have a Thecus Firmware version =< 2.1.05 . In my case I had 2.1.10 and it all worked perfectly.

To star first install iputils-arping and telnet packages on your PC / laptop:

# apt-get install iputils-arping telnet

Connect your PC with an Ethernet cable to your Thecus box to INTERFACE 1. Set your PC's ip address to 192.168.1.101. Let's assume that your PC's Ethernet card connected to Thecus 2100 is eth0:

# ifconfig eth0 192.168.1.101

Redboot sets its default IP address on Thecus 2100 to 192.168.1.100 so that is the reason we had set our PS's IP address on tha same subnet. All what needs to be done now is to execute a following command on your PC:

arping -f 192.168.1.100 && telnet 192.168.1.100 9000

Now just simply reboot or power on your Thecus N2100 and wait. Once you see a screen similar to the one below enter CTRL+C to abort execution of a boot script.

WARNING: interface is ignored: Operation not permitted
ARPING 192.168.1.100 from 192.168.1.101 eth0
Unicast reply from 192.168.1.100 [00:14:FD:30:16:4E]  11.605ms
Sent 16 probes (16 broadcast(s))
Received 1 response(s)
Trying 192.168.1.100...
Connected to 192.168.1.100.
Escape character is '^]'.
== Executing boot script in 2.920 seconds - enter ^C to abort
^C^C
RedBoot> 

Share this linux post:

Submit Thecus N2100 entering a Redboot boot loader command interface in Delicious Submit Thecus N2100 entering a Redboot boot loader command interface in Digg Submit Thecus N2100 entering a Redboot boot loader command interface in FaceBook Submit Thecus N2100 entering a Redboot boot loader command interface in Google Bookmarks Submit Thecus N2100 entering a Redboot boot loader command interface in Stumbleupon Submit Thecus N2100 entering a Redboot boot loader command interface in Technorati Submit Thecus N2100 entering a Redboot boot loader command interface in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.
Add a comment
   

Fetch stock quotes with perl Finance Quote module

Last Updated on Friday, 19 November 2010 16:25 Friday, 19 November 2010 15:48

This simple example uses Finance::Quote Perl module to fetch real time stock quotes for a companies listed in a CSV file. First we need to install Finance::Quote perl module: Feel free to get from a cpan or use package management tool to get from your linux distribution's repository. For debian o ubuntu do:

# apt-get install libfinance-quote-perl

Here is our sample CSV file containing list of ticker and exchange values:

stocks.csv:

AAON,NASDAQ
CMS,NYSE
TDSC,NASDAQ
CWST,NASDAQ
BDC,NYSE
EDN,NYSE

create a following perl script and save it as fetch-stock-price.pl:

#!/usr/bin/perl

use Finance::Quote;

my $q = Finance::Quote->new();
open (FIN, $ARGV[0]) || die ("Could not open $ARGV[0]");

while ($line = <FIN>) { ($field1,$field2) = split ',', $line;

my %hash = ( $field1 => $field2 ); chomp(%hash); foreach my $i (keys %hash) { my %data = $q->fetch( $hash{$i}, $i); print $hash{$i} . " " . $i . ": " . $data{$i, 'price'} . "\n"; } }
close (FIN);

At this point we need this script executable and execute it with an argument stocks.csv:

$ chmod +x fetch-stock-price.pl
$ ./fetch-stock-price.pl stocks.csv

OUTPUT:

NASDAQ AAON: 25.10
NYSE CMS: 17.95
NASDAQ TDSC: 27.10
NASDAQ CWST: 4.54
NYSE BDC: 33.06
NYSE EDN: 10.21

Share this linux post:

Submit Fetch stock quotes with perl Finance Quote module in Delicious Submit Fetch stock quotes with perl Finance Quote module in Digg Submit Fetch stock quotes with perl Finance Quote module in FaceBook Submit Fetch stock quotes with perl Finance Quote module in Google Bookmarks Submit Fetch stock quotes with perl Finance Quote module in Stumbleupon Submit Fetch stock quotes with perl Finance Quote module in Technorati Submit Fetch stock quotes with perl Finance Quote module in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.
Add a comment
   

Installation of MKVToolNix Matroska tools on Ubuntu Linux

Last Updated on Monday, 08 November 2010 14:48 Monday, 08 November 2010 14:42

This short article describes simple to follow steps on how to install a Cross-platform tools for Matroska MKVToolNix on ubuntu system. With these tools one can get information about (mkvinfo) Matroska files, extract tracks/data from (mkvextract) Matroska files and create (mkvmerge) Matroska files from other media files. Matroska is a new multimedia file format aiming to become the new container format for the future. All steps are performed on a command line only.

To begin installation of MKVToolNix on a ubuntu system first check what version of ubuntu you are running:

$ cat /etc/issue

From a following list pick a line with best fits your Ubuntu version:

7.10 "Gutsy Gibbon":
deb http://www.bunkus.org/ubuntu/gutsy/ ./
8.04 "Hardy Heron":
deb http://www.bunkus.org/ubuntu/hardy/ ./
8.10 "Intrepid Ibex":
deb http://www.bunkus.org/ubuntu/intrepid/ ./
9.04 "Jaunty Jackalope":
deb http://www.bunkus.org/ubuntu/jaunty/ ./
9.10 "Karmic Koala":
deb http://www.bunkus.org/ubuntu/karmic/ ./
10.04 "Lucid Lynx":
deb http://www.bunkus.org/ubuntu/lucid/ ./
10.10 "Maverick Meerkat":
deb http://www.bunkus.org/ubuntu/maverick/ ./

Now become a root user:

$ sudo bash

So for example if my Linux Ubuntu version is 10.10 the following command will add an appropriate MKVToolNix repository into my system:

# echo 'deb http://www.bunkus.org/ubuntu/maverick/ ./' >> /etc/apt/sources.list

In the next step we need to download GPG key:

# wget -q http://www.bunkus.org/gpg-pub-moritzbunkus.txt

Insert mkvtoolnix repository key into an apt key-ring:

# apt-key add gpg-pub-moritzbunkus.txt

Update your locale package list:

# apt-get update

and as a final step install MKVToolNix package:

# apt-get install mkvtoolnix

The installation of MKVToolNix is now completed and following commands are now available to your disposal:

mkvextract    mkvinfo       mkvinfo-text  mkvmerge      mkvpropedit

Share this linux post:

Submit Installation of MKVToolNix Matroska tools on Ubuntu Linux in Delicious Submit Installation of MKVToolNix Matroska tools on Ubuntu Linux in Digg Submit Installation of MKVToolNix Matroska tools on Ubuntu Linux in FaceBook Submit Installation of MKVToolNix Matroska tools on Ubuntu Linux in Google Bookmarks Submit Installation of MKVToolNix Matroska tools on Ubuntu Linux in Stumbleupon Submit Installation of MKVToolNix Matroska tools on Ubuntu Linux in Technorati Submit Installation of MKVToolNix Matroska tools on Ubuntu Linux in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.
Add a comment
   

Linux KDE4 user auto login command line version

Last Updated on Friday, 18 March 2011 14:21 Monday, 08 November 2010 13:00

If you have a version of KDE4 that does not allow you to enter into an administrative mode and configure autologin here is a command line version for this settings:

[X-:0-Core]
AutoLoginAgain=true
AutoLoginDelay=0
AutoLoginEnable=true
AutoLoginLocked=false
AutoLoginUser=lilo
ClientLogFile=.xsession-errors

Add the above lines to the and of your:

/etc/kde4/kdm/kdmrc

file. The above example will auto login a user named "lilo" into a KDE4 system using KDM and a login manager. The AutoLoginDelay option specifies how many seconds a kdm will wait until it will execute a user auto login procedure.

Share this linux post:

Submit Linux KDE4 user auto login command line version in Delicious Submit Linux KDE4 user auto login command line version in Digg Submit Linux KDE4 user auto login command line version in FaceBook Submit Linux KDE4 user auto login command line version in Google Bookmarks Submit Linux KDE4 user auto login command line version in Stumbleupon Submit Linux KDE4 user auto login command line version in Technorati Submit Linux KDE4 user auto login command line version in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.
Add a comment
   

Remove or substitute space within a file name

Last Updated on Thursday, 14 July 2011 18:34 Wednesday, 27 October 2010 14:17

Having a space in the file name is never a good idea. If you are in need to remove space from all file names within your current directory you can use a following command to do so:

 ls | grep " " | while read -r f; do mv -i "$f" `echo $f | tr -d ' '`; done

In case that you wish to substitute space within a file name to underscore ( or any other character ) use a following command to do so:

ls | grep " " | while read -r f; do mv "$f" `echo $f | tr ' ' '_'`; done

How it works? ls and grep will feed while loop with all files within a current working directory which contain a space in their file name. In the body of the while loop we will next execute mv command a translate it file destination with tr command. Make sure to keep -i option enabled when using mv command to avoid accidentally overwrite files.

Share this linux post:

Submit Remove or substitute space within a file name in Delicious Submit Remove or substitute space within a file name in Digg Submit Remove or substitute space within a file name in FaceBook Submit Remove or substitute space within a file name in Google Bookmarks Submit Remove or substitute space within a file name in Stumbleupon Submit Remove or substitute space within a file name in Technorati Submit Remove or substitute space within a file name in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.
Add a comment
   

Rename all file names from uppercase to lowercase characters

Last Updated on Wednesday, 27 October 2010 14:17 Wednesday, 27 October 2010 12:50

This command renames all files in your current working directory from uppercase to lowercase. Make sure to use -i with mv command so you do not accidentally overwrite some of your files. On a Linux command line File and file are to separate files. If you mv File to file you overwrite your current file.

for i in $( ls | grep [A-Z] ); do mv -i $i `echo $i | tr 'A-Z' 'a-z'`; done

Share this linux post:

Submit Rename all file names from uppercase to lowercase characters in Delicious Submit Rename all file names from uppercase to lowercase characters in Digg Submit Rename all file names from uppercase to lowercase characters in FaceBook Submit Rename all file names from uppercase to lowercase characters in Google Bookmarks Submit Rename all file names from uppercase to lowercase characters in Stumbleupon Submit Rename all file names from uppercase to lowercase characters in Technorati Submit Rename all file names from uppercase to lowercase characters in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.
Add a comment
   

Unable to ssh into VirtualBox guest machine

Last Updated on Monday, 25 October 2010 13:42 Monday, 25 October 2010 13:34

You have just installed and running some Linux distribution within the VirtualBox guest machine. At the same time, you have discovered that you are unable to create a ssh ( Secure Shell ) connection from your host operating system to your new VirtualBox guest machine. The default behavior of the VirtualBox does not allow that connection to happen.

There are two ( possibly more ) solutions to this problem. First solution is to create a bridged network interface and link your virtual guest by changing a guest's network interface settings. This may not be as easy as it sounds, but generally it works well and setup is easy. The second solution involves a port forwarding of a port 22 to your virtual guest machine. This solution is very easy to implement, but it does not work with older VirtualBox versions.

This article will guide you to implement the easier port forwarding solution. First check if your VirtualBox version supports a NAT port forwarding by executing a following command:

Check for VirtualBox NAT forward availability

$ VBoxManage modifyvm | grep natpf

If you do not observe any output you would need to upgrade your VirtualBox software. Next, open up a terminal on a host operating system.

create SSH port forward

Find a name of your virtual guest machine: NOTE: The following command needs to be run by a user who has an ownership of the above virtual machine as this command will display only virtual machines which a current user owns. In most cases this is NOT a root user.

$ VBoxManage list vms

Execution of a following command on the host operating system we redirect any traffic coming on port 2222 to a port 22 listening on a guest virtual machine with a name "Ubuntu_10.04".

$ VBoxManage modifyvm "Ubuntu_10.04" --natpf1 "host2guest-ssh,tcp,,2222,,22"

Login to guest SSH using port forward

All done. Now start your guest virtual machine and ssh to with a following command:

$ ssh -p 2222 username@localhost

If your guest operating system is using a static IP address you can modify the above port forward command to specify a guest IP address.:

$ VBoxManage modifyvm "Ubuntu_10.04" --natpf1 "host2guest-ssh,tcp,,2222,10.0.2.220,22"

Troubleshooting,

If you are still unable to ssh to your guest virtual machine check the following:

  • check whether your host operating system is listening on port 2222

$ netstat -ant | grep 2222

  • check if sshd is installed and running on your guest operating system.

Share this linux post:

Submit Unable to ssh into VirtualBox guest machine in Delicious Submit Unable to ssh into VirtualBox guest machine in Digg Submit Unable to ssh into VirtualBox guest machine in FaceBook Submit Unable to ssh into VirtualBox guest machine in Google Bookmarks Submit Unable to ssh into VirtualBox guest machine in Stumbleupon Submit Unable to ssh into VirtualBox guest machine in Technorati Submit Unable to ssh into VirtualBox guest machine in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.
Add a comment
   

Sikuli installation on Ubuntu Lucid Lynx Linux

Last Updated on Thursday, 21 October 2010 17:00 Thursday, 21 October 2010 16:50

Sikuli software helps a user to automate some many of the routine GUI task. It core it uses Java Runtime environment 6 and OpenCV ( Computer Vision library ) to recognize objects on the GUI desktop of acts upon instructions provided by a user to either click button or type text and etc.

This very short document describes how to install Sikuli on Ubuntu Lucid Lynx Linux system.

NOTE:

By saying installation we mean installation of Sikuli prerequisites, download of Sikuli and Sikuli execution. There is not need to install Sikuli as it can be directly executed from its source directory.

Installing Sikuli prerequisites

List of required Sikuli dependencies:

  • OpenCV 2.0
  • Sun Java Runtime Environment 6
  • control an EWMH/NetWM compatible X Window Manager ( wmctrl )

 

Ubuntu lucid Lynx had moved a Sun Java Runtime Environment 6 package away from a multiverse repository into proprietary repository "partner".

Therefore if you have not done so yet add partner repository to your apt sources list:

$ sudo add-apt-repository "deb http://archive.canonical.com/ lucid partner"
$ sudo apt-get update

Now we can install all Sikuli dependencies in one go:

$ sudo apt-get install wmctrl libcv4 libhighgui4 libcvaux4 sun-java6-jre

Download Sikuli software

Now that all Sikuli dependencies are installed the next step is to download Sikuli software and unzip it to a directory of our choice.

$ wget http://launchpad.net/sikuli/trunk/0.10.2/+download/Sikuli-IDE-linux-i686-0.10.2.zip

NOTE: Please check http://groups.csail.mit.edu/uid/sikuli/ for a latest version of sikuli. Now unzip Sikuli with unzip command:

$ unzip Sikuli-IDE-linux-i686-0.10.2.zip

Start Sikuli

navigate to a unziped directory and execute sikuli-ide.sh script.

$ cd Sikuli-IDE/
$ ./sikuli-ide.sh

All done!

NOTE: No installation is required. You can start skikuli directly from its source directory.

Share this linux post:

Submit Sikuli installation on Ubuntu Lucid Lynx Linux in Delicious Submit Sikuli installation on Ubuntu Lucid Lynx Linux in Digg Submit Sikuli installation on Ubuntu Lucid Lynx Linux in FaceBook Submit Sikuli installation on Ubuntu Lucid Lynx Linux in Google Bookmarks Submit Sikuli installation on Ubuntu Lucid Lynx Linux in Stumbleupon Submit Sikuli installation on Ubuntu Lucid Lynx Linux in Technorati Submit Sikuli installation on Ubuntu Lucid Lynx Linux in Twitter
 
Comments for this page are closed !!!
Please visit our new Linux Forum for additional help or discussion.
Add a comment
   

More Articles...

Page 4 of 16