- How to convert between packages (deb, rpm, tgz) using alien on Linux

alien is a program that converts between Redhat rpm, Debian deb, Stampede slp, Slackware tgz, and Solaris pkg file formats. If you want to use a package from another linux distribution than the one you have installed on your system, you can use alien to convert it to your preferred package format and install it. It also supports LSB packages

Warning:
Alien should not be used to replace important system packages, like init, libc, or other things that are essential for the functioning of your system. Many of these packages are set up differently by the different distributions, and packages from the different distributions cannot be used interchangeably. In general, if you can't remove a package without breaking your system, don't try to replace it with an alien version.

Installation:
Ubuntu user can install alien using following command: apt-get install alien
OpenSuSe user can install alien using "1-click" installer - here
Fedora user can install alien using command: yum install alien

Examples
Convert the package.rpm into a package.deb
alien --to-deb package.rpm

Convert the package.deb into a package.rpm
alien --to-rpm package.deb

Convert the package.rpm into a package.deb (converting to a .deb package is default, so you need not specify --to-deb), and install the generated package.
alien -i package.rpm

alien --to-deb --to-rpm --to-tgz --to-slp foo.deb bar.rpm baz.tgz
Creates 9 new packages. When it is done, foo bar and baz are available in all 4 package formats.


source:http://linuxpoison.blogspot.com/2010/05/13578167756284.html

- Block / Remove Internet Advertisements (Ads) using BFilter on Linux

BFilter is a filtering web proxy.

BFilter was originally intended for removing banner ads only, but since then its capabilities have been greatly extended. Unlike most of the similar tools, it doesn't rely on blacklists (although it does support them). The problem with blacklists is that advertisers are always one step ahead. You see an ad slip through, you update your blacklist, and in case it didn't help, you add a new entry yourself, here BFilter would detect ads heuristically, much like modern anti-virus software manages to detect many viruses unknown to it.

Features
  * HTTP/0.9 - HTTP/1.1, WebDAV support.
  * Persistent connections (HTTP/1.1 only).
  * Pipelining (HTTP/1.1 only).
  * HTTP compression.
  * Forwarding to another proxy (HTTP and SOCKS proxies).
  * A built-in javascript engine.
  * Heuristic Flash analyzer.
  * Ability to apply regular expressions to a page.
  * Blacklists, white-lists, hint lists.
  * All processing is done on the fly. It doesn't load the whole page before processing.

Installation:
Download Linux autopackage for BFilter UI - here
Make it executable and execute it using command: ./bfilter-gui-1.1.4.x86.package


Using  BFilter:
Using BFilter is very simple, go to terminal and type command: bfilter-gui to open up the application, here you can notice the bfilter icon in the system try, right click on the icon and select the configuration of type - Basic, Advance, Forwarding and Filter

Below example show the "Forwarding" setting for bfilter where Squid proxy server (cache server) sits between bfilter and Internet


After Bfilter configuration you also need to configure your web browser to point to Bfilter.

There are other ways to block Internet Advertisements:
Block Ads by using squid and Ad Zapper
Block Ads / Malware / Spyware using hosts file (Windows / Linux)


source:http://linuxpoison.blogspot.com/2010/05/13578167757686.html

- How to view and download lyrics for various Music Players on Linux - OSD Lyrics

OSD Lyrics is an application for downloading and showing up the lyric while you play your media on following supported media players.

Media Player Support
OSD Lyrics communicates with music players through IPC.
OSD Lyrics currently supports following media players: 
 * Amarok 1.4 (use --enable-amarok1 to compile)
 * Amarok 2.0
 * Audacious
 * Banshee
 * Rhythmbox
 * XMMS
 * Exaile

OSD Lyrics can download lyrics from following web sites:
 * Sogou http://mp3.sogou.com/
 * Qianqian http://www.qianqian.com/index.html 

Installation:
Ubuntu 9.10 or later
Go to terminal and type following command to install osd-lyrics:
sudo add-apt-repository ppa:osd-lyrics/ppa
sudo apt-get update
sudo apt-get install osdlyrics
Fedora:
Go to terminal and type following command to install osd-lyrics:
su -c 'wget http://dl.dropbox.com/u/1352061/liangsuilong.repo -P /etc/yum.repos.d/'
yum makecache
yum install osd-lyrics
or you can install osd-lyrics directly using rpm command
Download the osd-lyrics rpm file from here and install it using following command
rpm -ivh osd-lyrics-0.3.20100330-1.fc12.i686.rpm



source:http://linuxpoison.blogspot.com/2010/05/135781677514767.html

- How to mount samba share on Linux client

Samba can be used to allow connectivity between Linux and Windows. Samba can be used to share printers, share directories, connect to an windows domain, and many other useful features.

In order to mount your samba share to your Linux client open up the /etc/fstab file and insert the following line into this file

//172.19.12.137/Music /mnt/samba cifs credentials=/etc/accessfile 0 0

Now create a new file: /etc/accessfile with following contents
username=nikesh
password=some_password
Save the above file and restart your Linux client (or type command mount -a), after restart you should now able to access the share content from the samba server under /mnt/samba directory.

This is preferred over having passwords in plaintext in a shared file, such as /etc/fstab. Be sure to protect any credentials file properly and also note that there should not be any extra space in this file.

It there are any space in this credentials file you might get the following error on trying to mount the file system
mount error(13): Permission denied
Refer to the mount.cifs(8) manual page (e.g.man mount.cifs)


source:http://linuxpoison.blogspot.com/2010/05/135781677518318.html

- Performance tuning Linux Kernel with swappiness parameter

The swappiness parameter controls the tendency of the kernel to move processes out of physical memory and onto the swap disk. Because disks are much slower than RAM, this can lead to slower response times for system and applications if processes are too aggressively moved out of memory.

swappiness can have a value of between 0 and 100

swappiness=0 tells the kernel to avoid swapping processes out of physical memory for as long as possible
swappiness=100 tells the kernel to aggressively swap processes out of physical memory and move them to swap cache

The default setting in Linux is swappiness=60. Reducing the default value of swappiness will probably improve overall performance for a typical desktop installation. A value of swappiness=10 is recommended, but feel free to experiment.

To check the swappiness value use command: cat /proc/sys/vm/swappiness

To make a change permanent, edit the configuration file with your favorite editor:

vi /etc/sysctl.conf
and add following parameter to the end of the file like so:
vm.swappiness=10
Save the file and reboot.

Still, there are users who insist that, for example, a system backup should never force OpenOffice out to disk. They don't care how quickly a system maintenance application runs at 3:00 in the morning, but they care a lot about how the system responds when they are at the keyboard. This wish was expressed repeatedly until Andrew Morton exclaimed:
I'm gonna stick my fingers in my ears and sing "la la la" until people tell me "I set swappiness to zero and it didn't do what I wanted it to do.


source:http://linuxpoison.blogspot.com/2010/05/135781677516027.html

- How to Temporarily Switch Languages for One Application Only on Linux

To run a single application in another language (that has already been installed), use one of the following commands:

LANG=de_DE application to start any standard X application or GNOME application in German. For other languages, use the appropriate language code. Get a list of all language codes available using the locale -av command.

KDE_LANG=de application to start any KDE application in German. For other languages, use the appropriate language code.


source:http://linuxpoison.blogspot.com/2010/05/135781677519203.html

- ACPI related Linux kernel parameters

Some hardware types, mainly fairly old or very recent ones, fail to install. In many cases, this might happen because support for this type of hardware is missing from the installation kernel or due to certain functionality included in this kernel, such as ACPI, that still cause problems on some hardware.

There are various other ACPI-related kernel parameters that can be entered at the boot prompt prior to booting for installation:

acpi=off
This parameter disables the complete ACPI subsystem on your computer. This may be useful if your computer cannot handle ACPI at all or if you think ACPI in your computer causes trouble.

acpi=force

Always enable ACPI even if your computer has an old BIOS dated before the year 2000. This parameter also enables ACPI if it is set in addition to acpi=off.

acpi=noirq
Do not use ACPI for IRQ routing.

acpi=ht
Run only enough ACPI to enable hyper-threading.

acpi=strict
Be less tolerant of platforms that are not strictly ACPI specification compliant.

pci=noacpi
Disable PCI IRQ routing of the new ACPI system.

pnpacpi=off
This option is for serial or parallel problems when your BIOS setup contains wrong interrupts or ports.

notsc
Disable the time stamp counter. This option can be used to work around timing problems on your systems. It is a new feature, if you see regressions on your machine, especially time related or even total hangs, this option is worth a try.

nohz=off
Disable the nohz feature. If your machine hangs, this option might help. Generally, you do not need it.

Once you have determined the right parameter combination, you also need to writes them to the boot loader configuration (grub) to make sure that the system boots properly next time.


source:http://linuxpoison.blogspot.com/2010/06/13578167757601.html

- Limit file upload size on Apache

The LimitRequestBody directive allows the user to set a limit on size of the request. If the client request exceeds that limit, the server will return an error response instead of servicing the request.

The value of LimitRequestBody can be between 0 bytes (meaning unlimited) to 2147483647 (2GB).

For example,if we want to limit upload size to 100k for  /srv/www/htdocs/uploads, we need to add below commands to .htaccess or httpd.conf.
<Directory "/srv/www/htdocs/uploads">
    LimitRequestBody 102400
</Directory>
This directive gives the server administrator greater control over abnormal client request behavior, which may be useful for avoiding some forms of denial-of-service attacks.


source:http://linuxpoison.blogspot.com/2010/06/13578167759063.html

- Browsing Man and Info Pages using Konqueror Web Browser

In Konqueror, to view the man page for ls, type man:/ls in the location bar.
If there are different categories for a command, Konqueror displays them as links.


To display the info page for grep, for example, type info:/grep.


source:http://linuxpoison.blogspot.com/2010/06/135781677518110.html

- Installing Linux using VNC

Boot the system for installation using installation disc.

Enter the following text at the boot options prompt:
vnc=1 vncpassword=yourpassword
Replace yourpassword with the password to use for installation.

Select Installation then press Enter to start the installation.

Instead of starting right into the graphical installation routine, the system continues to run in text mode then halts, displaying a message containing the IP address and port number at which the installer can be reached via a browser interface or a VNC viewer application.

If using a browser to access the installer, launch the browser and enter the address information provided by the installation routines and hit Enter:
http://ip_address_of_machine:5801
A dialog opens in the browser window prompting you for the VNC password. Enter it and proceed with the installation.


source:http://linuxpoison.blogspot.com/2010/06/135781677515133.html

- Multimedia (MP3, MPEG-4, AVI, DiVX, etc.) support in Fedora 13

Why doesn’t Fedora support MP3 ‘out of the box’?

Fedora cannot include support for MP3 or DVD video playback or recording. MP3 formats are patented, and the patent holders have not provided the necessary licenses. Fedora also excludes other multimedia software due to patent, copyright, or license restrictions, such as Adobe Flash Player and RealNetworks RealPlayer.

That doesn’t mean you can’t play .mp3 files in Fedora, it just takes a bit of work (not much).

Follow these instructions to get mp3 and other multimedia support on your Fedora 13.
Open a terminal and become root, then run this command:

# rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
# rpm -ivh http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-stable.noarch.rpm

Now, Install all other plug ins..

# yum -y install gstreamer-plugins-bad gstreamer-plugins-ugly xine-lib-extras-nonfree gstreamer-ffmpeg

After successful installation, open Amarok or any other multimedia player and try to play the mp3 file and see if all goes fine and you are able to hear the music.

XMMS
To install xmms and make it MP3-capable, start by doing this:

# yum install xmms xmms-mp3

MPEG, QuickTime, AVI, and DVDs
MPEG (the format used on DVDs) represents itself as an open standard, but most Linux distributions won't ship software that read it because of blocking patents held by MPEGLA. AVI and Apple QuickTime have proprietary codecs covered by patents, so most Linux distributions won't ship software that decodes them, either.

Unfortunately, the alternate front end xine is even more broken. It can be installed this way:

# yum install xine xine-lib libdvdcss

Doing this will also install a number of support libraries, including the libdvdcss plugin

VLC Player:
# rpm -ivh http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-stable.noarch.rpm
# yum -y install vlc



source:http://linuxpoison.blogspot.com/2010/06/135781677513912.html

- cppcheck - A tool for static C / C++ code analysis

Cppcheck is an analysis tool for C/C++ code. Unlike C/C++ compilers and many other analysis tools, Cppcheck don't detect syntax errors. Cppcheck only detects the types of bugs that the compilers normally fail to detect. The goal is no false positives.

The time Cppcheck takes depends on how complex the code is. The more execution paths, variables, etc there are, the more analysis is made.In general the complexity grows much faster than the number of lines of code. Files with normal size are mostly much faster to analyse than big files.

Installation:
OpenSuSe user can install Cppcheck using "1-click" installer - here

Cppcheck usage:
Recursively check the current folder. Print the progress on the screen and write errors in a file:
cppcheck . 2> err.txt

Recursively check ../myproject/ and print only most fatal errors:
cppcheck --quiet ../myproject/

Check only files one.cpp and two.cpp and give all information there is:
cppcheck -v -a -s one.cpp two.cpp

Check f.cpp and search include files from inc1/ and inc2/:
cppcheck -I inc1/ -I inc2/ f.cpp


Below is the example of tunning ccpcheck on Linux kernel source code 2.6.31.5


Output contains lots of warnings ....


source:http://linuxpoison.blogspot.com/2010/06/13578167753122.html

- Download entire website using Wget for offline viewing on Linux

GNU 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 has been designed for robustness over slow or unstable network connections; if a download fails due to a network problem, it will keep retrying until the whole file has been retrieved.  If the server supports regetting, it will instruct the server to continue the download from where it left off.

Most of the Linux distribution comes with Wget installed, so you don't have to do anything to install Wget

Using Wget to download entire website:
Create directory where you are planing to store the website content: mkdir /home/nikesh/linuxpoison
use following command to download the website:
wget -r -Nc -mk http://linuxpoison.blogspot.com/
-r  Turn on recursive retrieving
-N  Turn on time-stamping
-m  Create a mirror
-k  Convert the link

After completion all content will get downloaded into your directory for  offline viewing.


source:http://linuxpoison.blogspot.com/2010/06/135781677519143.html

- Real-time Squid proxy server log on Web Browser - SqStat

The squid is an internet proxy server that can be used within a network to distribute an internet connection to all the computers within the network. One central computer is connected to the internet through any means such as dial-up, cable modem, ISDN, DSL, or T1, runs squid, and thus acts as the firewall to the internet. Because it is a proxy, it has the capabilities to log all user actions such as the URLs visited. There are many features that can be configured in squid.

Many times it's required to keep an eye on squid log to see who is accessing what for this there is a script (SqStat) which allows to look through active squid users connections using web browser. It use cachemgr protocol to get information from squid proxy server.

Installation and configuration of SqStat:
 * Download the package - here
 * Unpack the SqStat package in your webserver's document root - /srv/www/htdocs (OpenSuSe)
 * Copy file config.inc.php.defaults to config.inc.php, edit config.inc.php to specify your squid proxy server IP and port.
 * Edit your squid.conf to allow cachemgr protocol, sample shown below ...
acl manager proto cache_object
# replace 10.0.0.1 with your webserver IP
acl webserver src 10.0.0.1/255.255.255.255
http_access allow manager webserver
http_access deny manager
Point your browser to sqstat.php file and this is what you should see ...




source:http://linuxpoison.blogspot.com/2010/06/13578167758406.html

- lynis - Security and System auditing tool for Linux

Lynis is an auditing tool for Unix (specialists). It scans systems to detect software and security issues. Besides security-related information, it will also scan for general system information, installed packages, and possible configuration mistakes. The software is aimed at assisting automated auditing, software patch management, and vulnerability and malware scanning of Unix-based systems.

Lynis can be run as a cron-job, or from the command line. It needs to have full access to the system, so running  it  as root (or with sudo rights) is required.

The following system areas are checked:
 * Boot loader files
 * Configuration files
 * Common files by software packages
 * Directories and files related to logging and auditing

Installation:
OpenSuSe user can install Lynis using "1-click" installer - here
Lynis doesn't have to be installed, so it can be used directly from a (removable) disk.

Steps to run Lynis without installing:
 * Download the source from here
 * Create a directory ( /usr/local/lynis)
 * unpack the tar ball (tar xfvz lynis-version.tar.gz) into this directory.

Using/Running Lynis:
you can start it with 'lynis' (if installed and the file is available in your binary path) or 'sh lynis' or './lynis'.

Without parameters, Lynis will give you a valid list of parameters and return back to the shell prompt. At least the '-c' (--check-all) parameter is needed, to start the scan process.

Below is the Lynis report when run on my PC ...



source:http://linuxpoison.blogspot.com/2010/06/135781677514520.html

- How To Convert VMWare Image (.vmdk) to VirtualBox Image (.vdi) on Linux

First we need to install QEMU

QEMU is free software written by Fabrice Bellard that implements a fast processor emulator, allowing a user to run one operating system within another one. It is similar to projects such as Bochs and VMware Workstation
sudo aptitude install qemu
Now using qemu, first we need to convert a .vmdk (VMware image) to a .bin format, which can then be converted to a Virtualbox native .vdi format.
qemu-img convert /path/to/original.vmdk converted.bin
VirtualBox is a free, powerful and versatile virtualization program which is available for Linux, Mac, and Windows hosts, and can virtualize many different Operating Systems.
VirtualBox was originally developed by Innotek, but was purchased by Sun and renamed Sun xVM VirtualBox.

Now using VBoxManage utility that comes with Virtualbox we can easily convert the .bin file that we have generated using qemu to a native .vdi format:
VBoxManage convertdd converted.bin converted.vdi



source:http://linuxpoison.blogspot.com/2010/06/13578167754189.html

- Convert Linux man pages to PDF files

Anyone who are working on Linux / UNIX are aware of man pages, man - an interface to the on-line reference manuals.

man is the system's manual pager. Each page argument given to man is normally the name of a program,  utility  or  function. The manual page associated with each of these arguments is then found and displayed and these man pages are stored in some special format.

Now, suppose you need to convert these man pages to PDF files which are more readable and easy to print
Below simple command will convert any man pages to PDF file
man -t sendmail | ps2pdf - sendmail.pdf
Output of above command will be pdf file with name sendmail.pdf.


source:http://linuxpoison.blogspot.com/2010/06/135781677519185.html

- openSUSE 11.3 Countdown - Get your Counter

You can help spread the word for openSUSE 11.3 before it’s released!
The openSUSE project now has countdown banners that display the number of days before the next openSUSE release.


You can display the banner on your site, and the rendering is done via the openSUSE server. You can find the code and the right language for your site on http://en.opensuse.org/Countdown. You can link the banner to http://en.opensuse.org/OpenSUSE_11.3 which has information about the 11.3 release and information on testing prior to the final 11.3 release.

Thanks to everyone who contributed!
So, grab a banner and show your openSUSE pride.


source:http://linuxpoison.blogspot.com/2010/06/135781677515548.html

- How to access / mount Windows shares from Linux

Many times it required Linux users to access some share folder from Linux system, this can be achieve using mount command with CIFS.

The CIFS VFS is a virtual file system for Linux to allow access to servers and storage appliances compliant with the SNIA CIFS Specification version 1.0 or later.

Popular servers such as Samba, Windows 2000, Windows XP and many others support CIFS by default.   The CIFS VFS provides some support for older servers based on the more primitive SMB (Server Message Block) protocol (you also can use the Linux file system smbfs as an alternative for accessing these).

CIFS VFS is designed to take advantage of advanced network file system features such as locking, Unicode (advanced internationalization), hardlinks, dfs (hierarchical, replicated name space), distributed caching and uses native TCP names (rather than Netbios names).

Below is example of mounting the windows share folder on Linux:

First we need to make a directory on our Linux system where we can mount our windows share
mkdir /mnt/window
Mount suing cifs
# mount -t cifs //server-ip-or-name/share /mnt/window -o username=user,password=pass,domain=DOMAIN
Mount using smbfs
# mount -t smbfs //server-ip-or-name/share /mnt/window -o username=user,password=pass,domain=DOMAIN


source:http://linuxpoison.blogspot.com/2010/06/13578167756652.html

- Tweet from command line using curl

curl is a client to get documents/files from or send documents to a server, using any of the supported protocols (HTTP, HTTPS, FTP, GOPHER, DICT, TELNET, LDAP or FILE). The command is designed to work without user interaction or any kind of interactivity.

curl offers a busload of useful tricks like proxy support, user authentication, ftp upload, HTTP post, SSL (https:) connections, cookies, file transfer resume and more

curl is availabe mostly on all Linux distros but you can download a binary package from cURL's download page if you don't have it installed.

Open the terminal and past the below mentioned command to send the status to the twitter
curl --basic --user username:password --data status="Linux" http://twitter.com/statuses/update.xml
command explanation
--basic --user username:password

The above piece of code will authenticate your Twitter username and password.

--data status="Linux"

The above piece of code will send the data to the API i.e your new status which will be in the form of POST HTTP request.

http://twitter.com/statuses/update.xml

The main part of the code which is the URL of the Twitter API.


source:http://linuxpoison.blogspot.com/2010/07/13578167759812.html

- Search News, Bug fixes, Tips and Tricks, etc. for Ubuntu using Googlubuntu search Engine

Googlubuntu is a search engine created by Google to search news, bug fixes, tips and tricks, etc.. for Ubuntu and Kubuntu Linux


With this tool you can easily search, programs, tutorials, documents, grants, news and much more. For that Googlubuntu indexes sites in both Spanish and English.

Googlubuntu resources are from: Ubuntu.com, Kubuntu.com, Edubuntu.org, Launchpad.net, ubuntuforums.org, Kubuntuforums.net, ubuntuguide.org, getdeb.net, google groups «ubuntulinux» and «kubuntu», ubuntu-es.org, kubuntu-es.org, planetubuntu.es, ubuntips.com.ar, guia-ubuntu.org, cesarius.net, tuxpepino.wordpress.com, ubuntulife.wordpress.com, google groups on spanish.

In addition and if you're using Firefox, you can use Googlubuntu firefox plugin to add Googlubuntu search bar.


source:http://linuxpoison.blogspot.com/2010/07/13578167754436.html

- Install Group of Sofware on Ubuntu using Tasksel

Tasksel is an installation system that is an integral part of the Debian installer (it is also included in Ubuntu). Tasksel groups software packages by tasks and offers an easy way to install all the packages needed for that task. It provides the same functionality as using conventional meta-packages.

Installation
Tasksel is present on all versions of Ubuntu's installer

Usage
To run tasksel from the command line, type: sudo tasksel
the tasksel menu will be shown:
Already-installed tasks will have an asterisk beside their name. Select a task by scrolling down and pressing space. This will put an asterisk beside the selected task and mark it for installation. Removing an asterisk marks the task for removal. Once "ok" is selected the task installations and/or removals will take place using apt-get.

Command line arguments
You can also directly specify which task to install.
For instance, to add the Apache-MySQL-PHP stack to an existing system:
sudo tasksel install lamp-server
For complete options, see the tasksel manpage: man tasksel


source:http://linuxpoison.blogspot.com/2010/07/13578167755932.html

- Merge or Encrypt / Decrypt PDF files using pdftk

Pdftk is a simple command line tool for doing everyday things with PDF documents. Use it to merge PDF documents, split PDF pages into a new document, decrypt input as necessary (password required), encrypt output as desired, fill PDF forms with FDF data and/or flatten forms, apply a background watermark, report on PDF metrics, update PDF metadata, attach files to PDF pages or the PDF document, unpack PDF attachments, burst a PDF document into single pages, decompress and re-compress page streams, and repair corrupted PDF files (where possible).

Installation:
Ubuntu user can install pdftk using following command: sudo apt-get install pdftk

Using pdftk:
Once installed, we can merge pdf files using following command:
pdftk 1.pdf  2.pdf  3.pdf cat output 123.pdf
Encrypt a PDF using 128-Bit Strength (the Default) and Withhold All Permissions (the Default)
pdftk mydoc.pdf output mydoc.128.pdf owner_pw foopass
Decrypt a PDF
pdftk secured.pdf input_pw foopass output unsecured.pdf


source:http://linuxpoison.blogspot.com/2010/07/135781677514681.html

- How to Lock / UnLock (Enable / Disable) Linux User Account

Before you remove an account from a system, is a good idea lock it for one week to make sure that no one use it.

To lock, you can use the follow command:
# passwd -l username (where username is the login id).
This option is used to lock the specified account and it is available to root only. The locking is performed by rendering the encrypted password into an invalid string (by prefixing the encrypted string with an !).

After that, if someone try to loginusing this account, the system will return:
# su - username
This account is currently not available.

To Unlock the same account
Following command re-enables an account by changing the password back to its previous value i.e. to value before using -l option.
# passwd -u username
This removes the '!' in front of the encrypted password


source:http://linuxpoison.blogspot.com/2010/07/13578167751651.html

- How to get Technical and Tag information about a video or audio file - MediaInfo

MediaInfo supplies technical and tag information about a video or audio file.
It is free software (free of charge and free access to source code: GPL or LGPL licence)

With MediaInfo you can easily get the following information:
  * General: title, author, director, album, track number, date, duration...
  * Video: codec, aspect, fps, bitrate...
  * Audio: codec, sample rate, channels, language, bitrate...
  * Text: language of subtitle
  * Chapters: number of chapters, list of chapters

Following are the Video/Audio format supported by Mediainfo:
Video: MKV, OGM, AVI, DivX, WMV, QuickTime, Real, MPEG-1, MPEG-2, MPEG-4, DVD (VOB)...
(Codecs: DivX, XviD, MSMPEG4, ASP, H.264, AVC...)
Audio: OGG, MP3, WAV, RA, AC3, DTS, AAC, M4A, AU, AIFF...
Subtitles: SRT, SSA, ASS, SAMI...

Installation:
Ubuntu users can install it from the MediaInfo PPA:
sudo add-apt-repository ppa:shiki/mediainfo
sudo apt-get update
sudo apt-get install mediainfo
OpenSuSe:
OpenSuSe user can install MediaInfo - here



source:http://linuxpoison.blogspot.com/2010/07/135781677516987.html

- CentOS is now the most popular Linux distribution on web servers

CentOS is a well known Linux distribution with a strong focus on server machines rather than on desktop PCs. For the first time, CentOS is now leading the Linux distribution statistics on web servers with almost 30% of all Linux servers.

Source: here


source:http://linuxpoison.blogspot.com/2010/07/135781677517985.html

- How to Enable / Disable Modules into Apache on Linux

Apache is a modular server. This implies that only the most basic functionality is included in the core server. Extended features are available through modules which can be loaded into Apache. By default, a base set of modules is included in the server at compile-time. If the server is compiled to use dynamically loaded modules, then modules can be compiled separately, and added at any time using the LoadModule directive.

The module are available in the /etc/apache2/mods-available directory. You can use the a2enmod command to enable a module. You can use the a2dismod command to disable a module. Once you enable the module, the module will be available in the the /etc/apache2/mods-enabled directory.

Example:
To enable ssl module, use following command:
sudo a2enmod ssl
To enable suexec module, use following command:
sudo a2enmod suexec
When you’re finished enabling the modules that you want, you’ll need to perform a “force-reload” of Apache using following command: sudo service apache2 restart

Note: Above commands (a2enmod  and a2dismod) will work with any Linux distribution and not only limited to Ubuntu.


source:http://linuxpoison.blogspot.com/2010/07/135781677513931.html

- Open Source Web Application Security Assessment Tool - Andiparos

Andiparos is a fork of the famous Paros Proxy. It is an open source web application security assessment tool that gives penetration testers the ability to spider websites, analyze content, intercept and modify requests, etc.

The advantage of Andiparos is mainly the support of Client Certificates on Smartcards. Moreover it has several small interface enhancements, making the life easier for penetration testers...

Features:
  * Smartcard support
  * History Filter (URLs)
  * Tag requests in history
  * other small enhancements...

Installation and Using  Andiparo:
Download Andiparos from here
Untar the package into some directory and start the application using command: javaw -jar andiparos.jar

This will start the andiparos on port 8080 (default), now you need to configure your browser to point to port 8080 and start browsing the application using the browser and all the activity (url) will get capture by andiparos, as you can see the image below.


After this you can scan through the requests using application option (Analyse > Scan all) and can generate the report for this scan using option (Report > last scan report)


source:http://linuxpoison.blogspot.com/2010/07/13578167754968.html

- Large Text File (logs) viewer - Rowscope

Rowscope is a file viewer for large text files. It can read files larger than 1 GB. It is very fast (a few seconds to examine a 1GB file) and it never blocks.

The idea back Rowscope is that a person cannot read the whole file when it is so large; a person can only read some parts of the file, possibly the ones that contain the information he is looking for.
For example when somebody reads the log file produced by an application, he will probably look for a specific error or for the lines produced in a specific period of the day.

With Rowscope the user:
Localizes the part or parts of the file that he wants to read, using search strings or regular expressions.
Then he can expand one of the rows he has found, which means that he makes Rowscope display the rows immediately before or after that row.

The main features of Rowscope are the following:
  * It never blocks the GUI. The user is able to write text and click buttons when Rowscope is loading a file.
  * It does not monopolize the CPU. There are moments in which Rowscope uses some CPU, but it never blocks the other applications.
  * It does not use a large amount of memory. It uses some MBytes of memory, but it never becomes a problem for the operating system or the other applications.
  * It is always able to stop. It is always possible to stop or close Rowscope, also when it is loading/analyzing a file.

Installation:
you need to have java installed in-order to use Rowcopy

wget http://sourceforge.net/projects/rowscope/files/1.0/rowscope_1_0_linux_gtk_32.jar/download
java -jar rowscope_1_0_linux_gtk_32.jar

Above command will install the Rowscope into your home directory




source:http://linuxpoison.blogspot.com/2010/07/135781677515325.html

- Malware Analysis Linux OS - REMnux

REMnux is a lightweight Linux distribution for assisting malware analysts in reverse-engineering malicious software. The distribution is based on Ubuntu

REMnux isn't a fancy distribution that was built from scratch... In simple terms, it's a virtual machine that runs Ubuntu and has various useful malware tools set up on it.

REMnux is also useful for analyzing web-based malware, such as malicious JavaScript, Java programs, and Flash files. It also has tools for analyzing malicious documents, such as Microsoft Office and Adobe PDF files, and utilities for reversing malware through memory forensics. In these cases, malware may be loaded onto REMnux and analyzed directly on the REMnux system without requiring other systems to be present in the lab.

Malware Analysis Tools Set Up On REMnux
  * Analyzing Flash malware: swftools, flasm, flare
  * Analyzing IRC bots: IRC server (Inspire IRCd) and client (Irssi). To launch the IRC server, type "ircd start"; to shut it down "ircd stop". To launch the IRC client, type "irc".
  * Network-monitoring and interactions: Wireshark, Honeyd, INetSim, fakedns and fakesmtp scripts, NetCat
  * JavaScript deobfuscation: Firefox with Firebug, NoScript and JavaScript Deobfuscator extensions, Rhino debugger, two versions of patched SpiderMonkey, Windows Script Decoder, Jsunpack-n
  * Interacting with web malware in the lab: TinyHTTPd, Paros proxy
  * Analyzing shellcode: gdb, objdump, Radare (hex editor+disassembler), shellcode2exe
  * Dealing with protected executables: upx, packerid, bytehist, xorsearch, TRiD
  * Malicious PDF analysis: Didier's PDF tools, Origami framework, Jsunpack-n, pdftk
  * Memory forensics: Volatility Framework and malware-related plugins
  * Miscellaneous: unzip, strings, ssdeep, feh image viewer, SciTE text editor, OpenSSH server

Downloading REMnux
You can download the REMnux distribution as a VMware virtual machine, which is encapsulated in a zip archive file. The file's MD5 hash is dc28330411acafc6b7f595a11e8b7ea4.


source:http://linuxpoison.blogspot.com/2010/07/135781677518436.html

- How to enable MP3, MPEG-4, AVI, DiVX, etc. in OpenSuse 11.3 Linux

Why doesn’t OpenSuSe support MP3 ‘out of the box’?

OpenSuSe cannot include support for MP3 or DVD video playback or recording. MP3 formats are patented, and the patent holders have not provided the necessary licenses. OpenSuSe also excludes other multimedia software due to patent, copyright, or license restrictions, such as Adobe Flash Player and RealNetworks RealPlayer.

That doesn’t mean you can’t play .mp3 files in OpenSuSe , it just takes a bit of work (not much).

Follow these instructions to get mp3 and other multimedia support on your OpenSuSe 11.3.

Use "1-click" installer to install all the required Codecs pack
If you are using KDE - Download and run (execute) this
If you are using Gnome - Download and execute this
To enable DVD playback - Download and execute this
This will enable you to have:
  Flash
  Java
  Latest Amarok (with MP3 Support) for KDE, or Helix-Banshee for GNOME users
  Encrypted DVD (libdvdcss)
  Extra XINE Codecs, for DivX/Xvid etc. (libxine1)
  K3b with MP3 Support (k3b-codecs)
  Win 32 Codecs (w32codec-all)

Multimedia Players:
Mplayer - Download and run this file.
VLC Player - Download and run this file.

And after successful installation you should be able to play any media files.


source:http://linuxpoison.blogspot.com/2010/07/135781677511424.html

- IDS/IPS/WAF Evasion & Flooding Tool - Inundator

Inundator is a multi-threaded, queue-driven, IDS evasion tool. Its purpose is to anonymously flood intrusion detection systems (specifically Snort) with traffic designed to trigger false positives via a SOCKS proxy in order to obfuscate a real attack.

The general idea is one would launch inundator prior to starting an attack, allow it to run during the attack, and continue to run it a while longer after you’ve accomplished the attack. The goal, of course, is to generate an overwhelming number of false positives so that your real attack is essentially buried within the other alerts, minimizing the chance of your attack being detected. It could also be used to ruin an IDS analyst’s day, or keep an organization’s infosec department busy for a while.

Other Example Scenarios:
  * Before, during, and after a real attack to bury any potential alerts among a flood of false positives.
  * Seriously mess with an IDS analyst and keep an InfoSec department busy for days investigating false positives.
  * Test the effectiveness of an intrusion detection or prevention system. Less alerts means a better product; more alerts means a horrible product.

USE THIS TOOL FOR LEGAL PURPOSES ONLY!

Downloading and installing Inundator:
The preferred method of installation for all other .deb-based distributions is via software repository. This is by far the best and simplest way of installing Inundator and its dependencies.

Add repository to /etc/apt/sources.list:
deb http://inundator.sourceforge.net/repo/ all/
Next, download and install our GPG key:
wget http://inundator.sourceforge.net/inundator.asc
apt-key add inundator.asc
Then you can automatically pull in Inundator and all its dependencies:
aptitude update
aptitude install inundator


source:http://linuxpoison.blogspot.com/2010/07/13578167751503.html

- Detection & Exploitation Of SQL Injection Flaws - Safe3 SQL Injector

SQL injection is an attack in which malicious code is inserted into strings that are later passed to an instance of SQL Server for parsing and execution. Any procedure that constructs SQL statements should be reviewed for injection vulnerabilities because SQL Server will execute all syntactically valid queries that it receives. Even parameterized data can be manipulated by a skilled and determined attacker.

The following script shows a simple SQL injection. The script builds an SQL query by concatenating hard-coded strings together with a string entered by the user:
var username;
username = Request.form ("username");
var sql = "select * from OrdersTable where username = '" + username + "'";
The user is prompted to enter the name. If he enters nikesh, the query assembled by the script looks similar to the following:
SELECT * FROM OrdersTable WHERE username = 'nikesh'
However, assume that the user enters the following:
nikesh'; drop table usersTable--
In this case, the following query is assembled by the script:
SELECT * FROM OrdersTable WHERE username = 'nikesh';drop table usersTable--'
The semicolon (;) denotes the end of one query and the start of another. The double hyphen (--) indicates that the rest of the current line is a comment and should be ignored.

If the modified code is syntactically correct, it will be executed by the server. When SQL Server processes this statement, SQL Server will first select all records in OrdersTable where username is nikesh. Then, SQL Server will drop usersTable.

USE THIS TOOL FOR LEGAL PURPOSES ONLY!

Safe3 SQL Injector is one of the most powerful penetration testing tool that automates the process of detecting and exploiting SQL injection flaws (as shown above) and taking over of back-end database servers.

Safe3 SQL Injector Features:
  * Full support for GET/Post/Cookie Injection;
  * Full support for HTTP Basic, Digest, NTLM and Certificate authentications
  * Full support for MySQL, Oracle, PostgreSQL,MSSQL,ACESS,DB2,Sybase,Sqlite
  * Full support for Error/Union/Blind/Force SQL injection
  * Support for file acess,command execute,ip domain reverse,web path guess,md5 crack,etc.
  * Super bypass WAF 

You can download Safe3 SQL Injector here: Safe3SI.6.2.rar



source:http://linuxpoison.blogspot.com/2010/07/13578167751460.html

- Hostnames and Virtual Hosts Discovery tool - Hostmap

It is said that if you know your enemies and know yourself, you will not be imperiled in a hundred battles; if you do not know your enemies but do know yourself, you will win one and lose one; if you do not know your enemies nor yourself, you will be imperiled in every single battle.
- Sun Tzu, The Art of War
As Sun Tzu said, you have to know your enemy. During an hacking engagement, like a penetration test, you need to retrieve as much information as possible from your target in order to be successful.

Hostmap helps you using several techniques to enumerate all the hostnames and configured virtual hosts associated with an IP address.

In the real world an IP address can be registered in a DNS server with multiple host names, because it can have some aliases or hosting a bunch of websites.
Example: 
IP address 1.2.3.4 can have following entries in the DNS configuration file

www.foo.com CNAME foo.com
foo.com A 1.2.3.4
mail.foo.com A 1.2.3.4
goo.com A 1.2.3.4

An user or a penetration tester,that needs to test the security of the IP address 1.2.3.4 machine needs ti know all his host names.

Here the purpose of the hostmap is to discover all the registered DNS hostname or virtual names inorder to get the better knowledge of the target machine.


USE THIS TOOL FOR LEGAL PURPOSES ONLY!

The major features of Hostmap are:
  * DNS names and virtual hosts enumeration
  * Multiple discovery techniques
  * Results correlation, aggregation and normalization
  * Multithreaded and event based engine
  * Platform independent

Installation:
Download hostmap from here
Untar the package and type following command to start host-name discoveries: 
ruby hostmap.rb -t 192.168.1.1 and you should see something similar to ....





source:http://linuxpoison.blogspot.com/2010/07/135781677515284.html

- Check for security configuration issue on software - YASAT

YASAT (Yet Another Stupid Audit Tool) is a simple stupid audit tool.
YASAT goal is to be as simple as possible with minimum binary dependencies (only sed, grep and cut)
Second goal is to document each test with maximum information and links to official documentation.

YASAT does many tests for checking security configuration issue or others good practice.
Don't forget that YASAT is not the only audit tool, You can also use tiger, lynis, sectool, nessus, openvas, Debian's checksecurity, etc... for checking your systems

Installation and Configuration:
Dependencies: sed, cut, grep. YASAT will use also openssl for some tests.
Latest version can be found at http://yasat.sourceforge.net
Simply untar the yasat tarball: tar xvzf yasat1.tar.gz
Change directory to yasat directory: cd yasat
and type ./yasat.sh -s to start system configuration check using YASAT





source:http://linuxpoison.blogspot.com/2010/07/135781677512911.html

- Convert Flv to Mp3 in Linux - FlvToMp3

FlvToMp3 is a Flash FLV MP3 Converter is a free tool to convert FLV to MP3 audio files.

It allows you to extract audio file from flash FLV and convert FLV files to MP3 format. It features a built-in MP3 splitter to extract/convert only part of FLV file to MP3 audio file. 
The user interface is pretty simple and easy to use as well.

Installation:
Download FlvToMp3 - here
Untar the package using command: tar -zxvf FlvToMp3_1.2.1_kubuntu.tar.gz
Go inside this directory using command: cd FlvToMp3
Type following command to start the application: ./FlvToMp3




source:http://linuxpoison.blogspot.com/2010/07/1357816775681.html

- Penetration Testing Tool box - PenTBox

PenTBox is a Security Suite that packs security and stability testing oriented tools for networks and systems.
Programmed in Ruby and oriented to GNU/Linux systems, but compatible with Windows, MacOS and every systems where Ruby works. It is free, licensed under GNU/GPLv3.

USE THIS TOOL FOR LEGAL PURPOSES ONLY!

Below are the list of tools PenTBox contains:
Cryptography tools
  Base64 Encoder & Decoder
  Multi-Digest (MD5, SHA1, SHA256, SHA384, SHA512)
  Hash Password Cracker (MD5, SHA1, SHA256, SHA384, SHA512)
  Secure Password Generator
  Files en/decryptor Rijndael (AES) 256 bits – GOST – ARC4

Network tools
  TCP Flood DoSer
  TCP Flood AutoDoSer
  Spoofed SYN Flood DoSer [nmap - hping3]
  Port scanner
  Honeypot
  PenTBox Secure Instant Messaging

Extra
  L33t Sp3@k Converter
  Fuzzer

You can download PenTBox v1.3.2 here:
Windows version (Ruby included) – pentbox_1.3.2_win.zip
Linux version – pentbox_1.3.2.tar

Using PenTBox on Linux:
Untar the package using command: tar -xvf pentbox_1.3.2.tar
Go inside the extracted directory using command:  cd pentbox_1.3.2
Type following command to start the PenTBox suite: ruby pentbox.rb



source:http://linuxpoison.blogspot.com/2010/07/13578167759719.html

- How To Extract data from .deb file in Linux

A Debian "package", or a Debian archive file, contains the executable files, libraries, and documentation associated with a particular suite of program or set of related programs.

.deb package are just the tar archives but with a proper structural format of  files. You can see and extract any deb package with archive manager tool. From the dpkg-deb man page: “dpkg-deb packs, unpacks and provides information about Debian archives. .deb files can also be manipulated with ar and tar alone if necessary

Use following command to get the list of files within .deb package (Use the ‘x’ option to extract the files)


# ar tv python2.4-setuptools_0.6a1-2_all.deb
rw-r--r-- 0/0      4 Aug 24 22:10 2005 debian-binary
rw-r--r-- 0/0   2024 Aug 24 22:10 2005 control.tar.gz
rw-r--r-- 0/0 168407 Aug 24 22:10 2005 data.tar.gz

The ‘data.tar.gz’ file contains all the files that will be installed with their destination paths:



source:http://linuxpoison.blogspot.com/2010/07/13578167753636.html

- How to Compress / Uncompress files using bzip2 in Linux?

bzip2 compresses files using the Burrows-Wheeler block sorting text compression algorithm, and Huffman coding. Compression is generally considerably better than that achieved by more conventional LZ77/LZ78-based compressors, and approaches the performance of the PPM family of statistical compressors.

bzip2 and bunzip2 are file compression and decompression utilities. The bzip2 and bunzip2 utilities are newer than gzip and gunzip and are not as common yet, but they are rapidly gaining popularity. The bzip2 utility is capable of greater compression ratios than gzip. Therefore, a bzip2 file can be 10-20% smaller than a gzip version of the same file. Usually, files that have been compressed by bzip2 will have a .bz2 extension.

Uncompressing a bzip2 File Using bunzip2
To uncompress a bzip2 file, execute the following command:
bunzip2 filename.txt.bz2     (where filename.txt.bz2 is the name of the file you wish to uncompress)
The result of this operation is a file called filename.txt. By default, bunzip2 will delete the filename.txt.bz2 file.

Compressing a File Using bzip2
To compress a file using bzip2, execute the following command:
bzip2 filename.txt     (where filename.txt is the name of the file you wish to compress)
The result of this operation is a file called filename.txt.bz2. By default, bzip2 will delete the filename.txt file.



source:http://linuxpoison.blogspot.com/2010/07/135781677517035.html

- Get all the required Process Information and Statistics - Psinfo

Psinfo shows process information and statistics using the kernel /proc interface.
This information includes:
 Process state, environment, arguments and flags
 CPU usage
 Scheduling
 I/O usage
 Virtual memory status
 Pagefaults
 Capabilities
 Signals

psinfo is useful for providing a detailed view of the current state of an application when diagnosing issues or performance problems.

INSTALLATION
psinfo requires Linux kernel 2.6.0 or greater.
Download psinfo from here and compile and install it using following command:

# make
# make install

psinfo can be run as an orindary user but certain features (environment, executable, current working directory and root directory) require root rights and are marked n/a in output otherwise.



source:http://linuxpoison.blogspot.com/2010/08/13578167752739.html

- High Speed Network Authentication Cracking Tool - Ncrack

Ncrack is a high-speed network authentication cracking tool. It was built to help companies secure their networks by proactively testing all their hosts and networking devices for poor passwords. Security professionals also rely on Ncrack when auditing their clients. Ncrack was designed using a modular approach, a command-line syntax similar to Nmap and a dynamic engine that can adapt its behaviour based on network feedback. It allows for rapid, yet reliable large-scale auditing of multiple hosts.

Ncrack's features include a very flexible interface granting the user full control of network operations, allowing for very sophisticated bruteforcing attacks, timing templates for ease of use, runtime interaction similar to Nmap's and many more.

Ncrack was started as a "Google Summer of Code" Project in 2009. While it is already useful for some purposes, it is still unfinished, alpha quality software. It is released as a standalone tool and can be downloaded from the section below. Be sure to read the Ncrack man page to fully understand Ncrack usage.
USE THIS TOOL FOR LEGAL PURPOSES ONLY!
Installation:
Download Ncrack - here
Compile and install Ncrack using following command
tar -xzf ncrack-0.2ALPHA.tar.gz
cd ncrack-0.2ALPHA
./configure
make
su root
make install
Using Ncrack:
The only Ncrack arguments used in this example are the two target IP addresses along with the the corresponding ports for each of them. The two example ports 21 and 22 are automatically resolved to the default services listening on them: ftp and ssh.
$ ncrack 10.0.0.130:21 192.168.1.2:22


Discovered credentials for ftp on 10.0.0.130 21/tcp:
10.0.0.130 21/tcp ftp: admin hello1
Discovered credentials for ssh on 192.168.1.2 22/tcp:
192.168.1.2 22/tcp ssh: guest 12345
192.168.1.2 22/tcp ssh: admin money$


Ncrack done: 2 services scanned in 156.03 seconds.
Ncrack finished.
Ncrack can also be extensively fine-tuned for special cases, though the default parameters are generic enough to cover almost every situation. It is built on a modular architecture that allows for easy extension to support additional protocols. check man pages for more options.



source:http://linuxpoison.blogspot.com/2010/07/13578167753613.html

- Gentoo lost and Fedora is losing to OpenSuSe

If Linux distributions were stocks and you an investor you wish you’d have invested in OpenSuSe at least according to Google Insights.



source:http://linuxpoison.blogspot.com/2010/08/135781677516432.html

- Disk Information Utility - di

di is a disk information utility, displaying everything that df does and more. It features the ability to display your disk usage in whatever format you desire/prefer/are used to. It is designed to be highly portable across many platforms.

di Displays usage information on mounted filesystems.  Block values are reported in a human readable format.  If the user or group has a disk quota, the values reported are adjusted according the quotas that apply to the user.
If file is specified, the usage information for the partition on  which file is located is printed.

Installation:
Debian / Ubuntu Linux: http://packages.debian.org/unstable/utils/di
OpenSUSE: http://packman.links2linux.org/package/di/



source:http://linuxpoison.blogspot.com/2010/08/13578167754605.html