linux poison RSS
linux poison Email
0

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.
Read more
1

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
Read more
0

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

Read more
4

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.
Read more
2

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 ...


Read more
0

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 ...

Read more
0

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 ....
Read more
3

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.
Read more
0

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.
Read more
13

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

Read more
1

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.
Read more
0

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.
Read more
1

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.
Read more
Related Posts with Thumbnails