Blog Stats

Posts Tagged ‘Utility’

Don’t know when you might feel the necessity to convert a pdf into a .jpg or a .png file, but in case you have to, then ImageMagick will make this job really easy for you. ImageMagick is a great opensource command line utility for image manipulation.

Since, we are dealing with image conversion we will use the “convert” script, provided by ImageMagick.

[shredder12]$ convert file.pdf image.png

If the pdf file(file.pdf) has only one page then a single image.png file will be formed. In case of multiple pages, same number of image-[n].png files will be produced. For example, a three page pdf will result into three image files – image-0.png, image-1.png and image-2.png.

If you want to combine/stitch all these images together to form a single one, something similar to taking a snapshot of the whole pdf, then just run the following command.

The file system management is fine in Linux, but effectively searching the file system for specific files like mp3 (.mp3) , text (.txt), movie (.avi, .divx etc.), pictures (.jpeg, .bmp, .png) or documents (.doc) is one thing that most oflinux users miss from their Windows Desktop.

The inbuilt search interface in most of the linux distros is not so user-friendly and effective, so we here present some of the better alternative Desktop search engines for linux:
Beagle

Beagle is one of the most useful and exhaustive desktop search replacement we could find for linux.
The list of supported files types is very large ranging from images, audio, video, documents, DEB and RPM packages, Email from Evolution and Thunderbird , IM logs and even RSS feeds.
You can even add a new file type by editing the file at : /etc/beagle/external-filters.xml

Beagle can be invoked and run either from Command line or Web interface, while Command line is more powerful as you can specify exact phrases, words or even logical operators (AND, OR) or even use metadata of audio and image files.

Beagle achieves efficiency by building non-redundant index of files, which is comparatively smaller than other engines.
For a 45 Gb partition, index was around 700 Mb.
Google Desktop Search

Google Desktop search for linux also supports many file types like Openoffice and MSoffice files, PDF, Html and others.
But downsides are:

1. It does not index zipped archives.
2. You cannot add new file types at all.
The noteworthy feature is you can point ot the exact directory where you are looking for a particular life. Otherwise, it is just useful for average office use and is useless for a power user like me.
DocFetcher

DocFetcher is coded in Java, so naturally it is fast in indexing and easy on CPU resources.
It also supports regular expressions, phrase search and logical operators (AND, OR, NOT). Like GDS (Google Desktop search) it also does not search zipped archives.

One interesting query feature found is: Boosting terms, using which you can assign custom weights to words, thus increasing or decreasing the level of matching of words.
Tracker

aria2 is a utility for downloading files. The supported protocols are HTTP(S), FTP, BitTorrent, and Metalink. It has a powerful segmented downloading ability, downloading a file from multiple sources and multiple protocols and utilizing your download bandwidth to the maximum. It supports downloading a file from HTTP(S)/FTP and BitTorrent at the same time, while the data downloaded from HTTP(S)/FTP is uploaded to the BitTorrent swarm. Using Metalinks chunk checksums, aria2 automatically validates chunks of data while downloading a file like BitTorrent.

It continually trims out slow servers and favors faster ones, and if a file’s sources contain both HTTP(S) / FTP and BitTorrent URIs, content downloaded through HTTP(S) / FTP will be uploaded to the BitTorrent swarm.

aria2c [OPTIONS] [URL | TORRENT_FILE | METALINK_FILE]…

Examples

HTTP/FTP Segmented Download

Download a file using 1 connection

aria2c http://host/file.zip

Note
To pause a download, press Ctrl-C. You can resume the transfer by run aria2c with the same argument at the same directory. You can change URLs as long as they are pointing to the same file.

Download a file using 2 connections

aria2c -s2 http://host/file.zip

Download a file from 2 difference HTTP servers

aria2c http://host1/file.zip ftp://host2/file.zip

Download a file from HTTP and FTP servers

aria2c http://host1/file.zip ftp://host2/file.zip

Download files listed in a file concurrently

aria2c -ifiles.txt -j5

Note
-j option specifies the number of concurrent downloads.

Metalink Download

Download files with remote Metalink

aria2c --follow-metalink=mem http://host/file.metalink

Download using a local metalink file

aria2c -p -t10 --lowest-speed-limit=4000 -Mtest.metalink

Note
To pause a download, press Ctrl-C. You can resume the transfer by run aria2c with the same argument at the same directory.

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. Every linux user use terminal, and using the terminal need from you to have some knowledge of command line, so today i choosed you a list of command line wget that perhaps you diden`t hear about them before.

1- Wget basic command list this surely you did hear see it and use it before:

Blacklisted is a compiled list of all known dirty hosts (botnets, spammers, bruteforcers, etc.) which is updated on an hourly basis. This command will get the list and create the rules for you, if you want them automatically blocked, append |sh to the end of the command line. It’s a more practical solution to block all and allow in specifics however, there are many who don’t or can’t do this which is where this script will come in handy. For those using ipfw, a quick fix would be {print “add deny ip from “$1” to any}. Posted in the sample output are the top two entries. Be advised the blacklisted file itself filters out RFC1918 addresses (10.x.x.x, 172.16-31.x.x, 192.168.x.x) however, it is advisable you check/parse the list before you implement the rules

You already know the Linux command called “top”, and also iotop and iftop (from previous Web Upd8 posts), but I bet you don’t know some of the other 14 top-like Linux apps:

htop – Undoubtedly the most famous of the top-like tools. It implements some extra options to the “top” command, like colors, ability to scroll horizontally and vertically, and a better interaction with the processes listed.

Modern mobile phones and PDAs have increasingly sophisticated data/internet connectivity. This is particularly great for browsing the web on the train, but it’s also good for keeping an eye on your servers while you’re out and about. (I once fixed my web server from the middle of a muddy field at the Glastonbury Festival, which I thought was quite good going.) Here’s a quick roundup of SSH applications available for various platforms.

G1 Android: ConnectBot (or get from Marketplace). Includes support for SSH keys, which is useful on a mobile platform where you may need to reconnect occasionally.

Palm/Treo devices: pSSH. SSH2 for Palm OS 5 and up; TuSSH is another alternative if you want SSH1 or Palm OS 4. It does warn that it may not be entirely secure and shouldn’t be used for security-critical applications in part because it doesn’t use device-specific random number generation. It’s got a neat on-screen keyboard, and it can support SSH key auth.

Blackberry: MidpSSH. There’s a useful documentation blog. This should also work on other Java-compliant devices. It supports a predictive text option, which may be useful if you have a device that doesn’t have a full keyboard. It supports public key auth, however, there is no facility for a passphrase for the key. It also has macro support to make typing long/common strings easier.

Symbian devices: The well-known free SSH client PuTTY is available for Symbian. It supports public key authentication but only for keys created using PuTTYGen in Windows. The download comes with excellent documentation, which is also available online.

Objective of this project is to let users boot their machines with bare minimal requirements on their side, and we will handle most of the problem that you may face in booting. All that user needs is Internet connectivity and a small program (gpxe) to boot the machine. This gpxe program provides network booting facility. You can download these program from our site (available at Downloads section). Also, you can find a list of distributions and tools that can be booted with BKO here. Your small 56KB gpxe program can boot any of these options!

copy it in floppy, USB or in CDROM (check download section for instructions)

Make sure that you know what kind of network you have (Which entries will be needed)

Boot from the media in which you had copied the gpxe Image

In case of Static networking, you need to provide information about your connection, but if you are having DHCP, it should work out of the box.

You will be presented with menu showing available options to boot from, select one of them.

Your system should boot in the sytem you select

Once you are done with it, reboot the system and remvoe the media, you should get back your old system

BKO is still under development. If you encounter any problems anywhere, please refer troubleshooting and FAQ page for explanation. If you don’t find any solution to your problem, then feel free to contact us.

If you have any interesting experience with BKO, then shoot an email to us

After configuring services on the network in Linux system, it’s important for you to keep tabs on the ports that are actually listening on the system’s network interfaces. This is all more important because open ports are evidence of an intrusion. There are a Linux monitoring tools that will allow you the knowledge of open ports. There are some basic approaches for listing the ports that are listening on the network. Let’s have a look at one of the most easiest reliable ones.

We would like to show you the ss command to inspect the socket statistics. This is more reliable command that displays more TCP and state information than any other tools.

The ss command provides information about

All TCP sockets.

All UDP sockets.

All established ssh / ftp / http / https connections.

All local processes connected to X server.

All the tcp sockets in state FIN-WAIT-1 and much more.

ss is used to dump socket statistics. It allows showing information similar to netstat. It can display more TCP and state informations than other tools

The Borne Again Shell, better known as bash, is the default for most Linux distributions. It’s extremely powerful as far as command shells go, and holds all kinds of nifty tricks for those willing to learn. One of the best features is, in my opinion, the command history system.

There are many options to use with the bash history, some of them I use nearly every time I open a command shell. Today I’ll be covering some of the most useful aspects of the history, but I certainly won’t be able to cover them all.

Up/Down Arrows

Many of you probably know this one, but for anyone who doesn’t, it’ll make your life a lot easier. Any time you’re in the command shell, simply use the up and down arrows on your keyboard to move through the list of previously entered commands. Next time you enter a long command that turns out to have a typo, you don’t have to retype the whole thing just hit the up arrow and make whatever edits are needed.

!!

A similar feature to the one listed above is the double bang (!!). Those characters entered in the shell represent the last typed command. Let’s say you’re trying to run a command only to find out that you need root privileges to do it. Instead of retyping the whole command, you can simply enter

sudo!!

Bash will substitute the !! for the previous command, as in the example below.

This also works further backward, you can do something like

!-5

to recall the command 5 entries back in the history.

!(word)

Perhaps a few days ago you typed a long, complex command into your shell, for example a series of options for “wterm”. You can find and re-enter than command by using the history’s built in search. You simply add the first few letters of the command after the ! and bash will find it.

Be careful with this one. You may end up running something other than what you expected. Don’t use this for potentially dangerous commands like “rm” or “fdisk”.

!?(word)

This is similar to the last feature in that it searches the history for the word entered, but unlike !(word) this will find the word anywhere in the command, not just the beginning.

Be careful with this one. You may end up running something other than what you expected. Don’t use this for potentially dangerous commands like “rm” or “fdisk”.

Ctrl-R

This one may be my personal favorite history tool. It’s a bit like the !? item above, but interactive. In your command shell, hit Ctrl-R, and it will begin a search. As you type, bash will search the history and show you the results as you type. When it shows the command you want, simply hit enter and it will run that command. This can be safer than things like !? because you can see what the command will be before you run it, so you don’t have to guess or rely on memory.

Manual Search

Perhaps you don’t like the way Ctrl-R works, or you want to see ALL the commands you typed, or just the ones that contain a particular word. The history command will show you your full command history, along with the history number of each command (hold that thought, we’ll cover those numbers in a moment).

You can also specify the number of items the history command will show. To see the last 10 entries in the history, you could type

history10

To see all history entries that contain a particular word, you can use grep to filter the results, like below.

!(number)

When you use the history command to view your command history list, you’ll notice each item in the list has a number associated with it. You can use that to recall that particular command. For example, item 87 could be run again by entering

!87

into your shell.

Word replacement

This one’s pretty great. How many times have you written out some big long command only to realize you put, say, hdd when you wanted hdc? Well bash has you covered. You can replace a word in the previous command with another using “^”, as in the example below

Managing Your History

By default, the history is saved in ~/.bash_history. You can deal with this file however you see fit, but there are some useful things you could try to manage it automatically. Namely, setting the environment variables HISTSIZE and HISTFILESIZE. To set the number of entries that can be saved in the history file to 1000, enter

exportHISTFILESIZE=1000

into your shell. This will limit the file to 1000 entries. If you want to make this change permanent, put that export command into your .bashrc or .bash_profile file.

You can access a remote file system securely using sshfs and fuse which is a command to mount a remote filesystem encrypted through ssh.

This way you will be able to access remote files as if they were on you machine, just remember that if the connection between the computers is slow, the access will also be pretty slow.

Package needed

sshfs
fuse-utils

Next step is to mount the fuse module

modprobe fuse

Next create the mount point

mkdir /mnt/remote-fs
chown [your-user]:[your-group] /mnt/remote-fs/

Add yourself to the fuse group

adduser [your-user] fuse

Untill here all the command should be issued as root, now switch to your users and mount the remote filesystem.

sshfs remote-user@remote.server:/remote/directory /mnt/remote-fs/

It will now ask you accept the key if this is the first time you connect to that PC using ssh, and then the password, or only the password if this is not the first time you use ssh to connect to the remote.server