Thursday, 9 August 2012

Bash Script: String manipulation (Find & Cut)

${parameter#word}
${parameter##word}

Remove matching prefix pattern. If the pattern matches the beginning of the value of parameter, then  the  result  of  the  expansion  is the expanded  value  of  parameter  with  the shortest matching pattern (the ``#'' case) or the longest matching pattern (the ``##'' case) deleted. 

${parameter%word}
${parameter%%word}

Remove matching suffix pattern.  If the pattern matches a trailing portion of the expanded value of parameter, then the result of the expansion is the expanded value of parameter with the shortest matching pattern (the ``%'' case) or the longest matching pattern (the ``%%'' case) deleted. 

Below bash script explains the concepts of find and cut the string within the string, feel free to copy and use this script.

Source: cat string_cut.sh
#!/bin/bash

var="linuxdotnet.linuxdotnet.Linuxpoison"
echo
echo -e "Value of var is: $var"
echo "--------------------------------------------"
echo 'Find all *nux from the start of the string and cut ${var##*nux} :'
echo ${var##*nux}

echo "-------------------------------------------"
echo 'Find the first *nux from the start of the string and cut ${var#*nux} :'
echo ${var#*nux}

echo "-------------------------------------------"
echo 'Find all .* from the back of the string and cut ${var%%.*} :'
echo ${var%%.*}

echo "------------------------------------------"
echo 'Find first .* from the back of the string and cut ${var%.*} :'
echo ${var%.*}

Continue Reading...

Tuesday, 7 August 2012

Free eBook - Linux from Scratch

Linux from Scratch describes the process of creating your own Linux system from scratch from an already installed Linux distribution, using nothing but the source code of software that you need.

This 318 page eBook provides readers with the background and instruction to design and build custom Linux systems. This eBook highlights the Linux from Scratch project and the benefits of using this system.

Users can dictate all aspects of their system, including directory layout, script setup, and security. The resulting system will be compiled completely from the source code, and the user will be able to specify where, why, and how programs are installed.

This eBook allows readers to fully customize Linux systems to their own needs and allows users more control over their system.

Download Free Linux from Scratch PDF Guide - here


Monday, 6 August 2012

Network Traffic and Bandwidth Monitor - NTM (Network Traffic Monitor)

NTM (Network Traffic Monitor) is a monitor of the network and internet traffic for Linux. NTM is useful for the people that have a internet plan with a limit, and moreover the exceed traffic is expensive.

NTM (Network Traffic Monitor) features:
 * Choice of the interface to monitoring.
 * Period to monitoring: Day, Week, Month, Year or Custom Days. With auto-update.
 * Threshold: Auto-disconnection if a limit is reached (by Network Manager).
 * Traffic Monitoring: Inbound, outbound and total traffic; Show the traffic speed.
 * Time Monitoring: Total time of connections in the period.
 * Time Slot Monitoring: Number of sessions used.
 * Reports: Show of average values and daily traffic of a configurable period.
 * Online checking with Network-manager or by "Ping Mode".
 * The traffic is attributed to the day when the session began.
 * Not need root privilege.
 * Not invasive, use a system try icon.

NTM is write in python and is a open source software, the license is the GNU GPL v2.

Continue Reading...

Friday, 3 August 2012

Simple & Powerful GTK based Download Manager - UGet

Uget (formerly urlgfe) is a Free and Open Source download manager written in GTK+ , it has many of features like ...

 * Free (as in freedom , also free of charge ) and Open Source.
 * Simple , easy-to-use and lightweight.
 * Support resume download , so if your connection lost you don’t need to start from first.
 * Classify downloads , and every category has independent configuration and queue.
 * Queue download.
 * Integrate with Firefox through Flashgot plugin.
 * Monitoring clipboard.
 * Import downloads from HTML file.
 * Batch download , you can download many files has same arrange , like file_1 file_2 …. file_20 ,  you don’t need to add all links , just one link and changeable character.
 * Can be used from command line.
Continue Reading...

 
//PART 2