linux poison RSS
linux poison Email

How to Convert smbpasswd to tdbsam on Samba

The latest release of Samba offers many new features including new password database backends not previously available. Samba version 3.0.0 fully supports all databases used in previous versions of Samba. However, although supported, many backends may not be suitable for production use.

The tdbsam backend provides an ideal database back-end for local servers, servers that do not need built-in database replication, and servers that do not require the scalability or complexity of LDAP. The tdbsam back-end includes all of the smbpasswd database information as well as the previously-excluded SAM information. The inclusion of the extended SAM data allows Samba to implement the same account and system access controls as seen with Windows NT/2000/2003-based systems.

The tdbsam backend is recommended for 250 users at most. Larger organizations should require Active Directory or LDAP integration due to scalability and possible network infrastructure concerns.

Convert smbpasswd to tdbsam: enter as root on the command line:
      pdbedit -i smbpasswd:/etc/samba/smbpasswd -e tdbsam:/etc/samba/passdb.tdb
      And ensure the global section of smb.conf has such an entry:
      passdb backend = tdbsam
Read more

How to use Redirection and Pipes on Linux System

With > you can forward the output of a command to a file (output redirection), with < you can use a file as input for a command (input redirection).

By means of a pipe symbol | you can also redirect the output: with a pipe, you can combine several commands, using the output of one command as input for the next command. In contrast to the other redirection symbols > and <, the use of the pipe is not constrained to files.

Examples (Redirection):
1) To write the output of a command like ls to a file, enter
ls -l > filelist.txt
This creates a file named filelist.txt that contains the list of contents of your current directory as generated by the ls command.

However, if a file named filelist.txt already exists, this command overwrites the existing file. To prevent this, use >> instead of >. Entering
ls -l >> filelist.txt
simply appends the output of the ls command to an already existing file named filelist.txt. If the file does not exist, it is created.

2) Redirections also works the other way round. Instead of using the standard input from the keyboard for a command, you can use a file as input:
sort < filelist.txt
This will force the sort command to get its input from the contents of filelist.txt. The result is shown on the screen. Of course, you can also write the result into another file, using a combination of redirections:
sort  < filelist.txt > sorted_filelist.txt
Example (Pipe):
If a command generates a lengthy output, like ls -l may do, it may be useful to pipe the output to a viewer like less to be able to scroll through the pages. To do so, enter
ls -l | less
The list of contents of the current directory is shown in less.

The pipe is also often used in combination with the grep command in order to search for a certain string in the output of another command. For example, if you want to view a list of files in a directory which are owned by the user tux, enter
ls -l | grep tux
Read more

Linux Standard Directory Structure

Root directory—the starting point of the directory tree.
Essential binary files, such as commands that are needed by both the system administrator and normal users. Usually also contains the shells, such as Bash.
Static files of the boot loader.
Files needed to access host-specific devices.
Host-specific system configuration files.
Holds the home directories of all users who have accounts on the system. However, root's home directory is not located in /home but in /root.
Essential shared libraries and kernel modules.
Mount points for removable media.
Mount point for temporarily mounting a file system.
Add-on application software packages.
Home directory for the superuser root.
Essential system binaries and commands that are needed by system administrator.
Temporary files.
Secondary hierarchy with read-only data.
Variable data such as log files.
Only available if you have both Microsoft Windows* and Linux installed on your system. Contains the Windows data.
Read more

Advanced Linux Process Monitor - htop

Most people familiar with Linux have used the top command line utility to see what process is taking the most CPU or memory. There’s a similar utility called htop that is much easier to use for normal tasks.

htop is an interactive process viewer for Linux. It aims to be a 'better top': you can scroll the process list vertically and horizontally, and select a process to be killed with the arrow keys instead of by typing its process id. It requires ncurses

Comparison between htop and top
    * In 'htop' you can scroll the list vertically and horizontally to see all processes and complete command lines.
    * In 'top' you are subject to a delay for each unassigned key you press (especially annoying when multi-key escape sequences are triggered by accident).
    * 'htop' starts faster ('top' seems to collect data for a while before displaying anything).
    * In 'htop' you don't need to type the process number to kill a process, in 'top' you do.
    * In 'htop' you don't need to type the process number or the priority value to renice a process, in 'top' you do.
    * 'htop' supports mouse operation, 'top' doesn't
    * 'top' is older, hence, more used and tested.

Ubuntu users can 'upgrade' top to htop by installing htop using the Advanced Package Tool:

    sudo apt-get install htop

OpenSuSe 11.2 users can use "1-click" installer to install htop - here
Once installed, just type htop at a terminal to launch it, and notice the great text-mode graph at the top of the display:

Here is the best part… just use your Up/Down arrow keys to select a process, and then you can kill it with the F9 key if you’d like, or you can change the priority by using the F7 and F8 keys. (note that you’ll have to be root to give anything really high priority).
Read more

Easy Data Encryption with TrueCrypt on Linux (Ubuntu/OpenSuSe) System

TrueCrypt is a software system for establishing and maintaining an on-the-fly-encrypted volume (data storage device). On-the-fly encryption means that data is automatically encrypted or decrypted right before it is loaded or saved, without any user intervention. No data stored on an encrypted volume can be read (decrypted) without using the correct password/keyfile(s) or correct encryption keys. Entire file system is encrypted (e.g., file names, folder names, contents of every file, free space, meta data, etc).

Files can be copied to and from a mounted TrueCrypt volume just like they are copied to/from any normal disk (for example, by simple drag-and-drop operations). Files are automatically being decrypted on the fly while they are being read or copied from an encrypted TrueCrypt volume. Similarly, files that are being written or copied to the TrueCrypt volume are automatically being encrypted on the fly.

It's also possible to access the same encrypted partition/volume on multiple OSes, as long as they have TrueCrypt installed and are able to read the filesystem used on the disk. (So you still can't get at your ext3 filesystem on Windows!) This is particularly useful for encrypting the USB drive.

TrueCrypt Features:
* Creates a virtual encrypted disk within a file and mounts it as a real disk.
* Encrypts an entire partition or storage device such as USB flash drive or hard drive.
* Encrypts a partition or drive where Windows is installed (pre-boot authentication).
* Encryption is automatic, real-time (on-the-fly) and transparent.
* Parallelization and pipelining allow data to be read and written as fast as if the drive was not encrypted.
* Provides plausible deniability, in case an adversary forces you to reveal the password:
Hidden volume (steganography) and hidden operating system.
* Encryption algorithms: AES (256-bit key), Blowfish (448-bit key), CAST5 (128-bit key), Serpent (256-bit key), Triple DES, and Twofish ( 256-bit key) also supports cascading (eg, AES-Serpent-Twofish).

OpenSuSe 11.2 user can use "1-click" installer - here

Go to the truecrypt web site at:
Download the correct version, Once it is downloaded untar and unzip: tar zxvf truecrypt*

This will create an executable file which can begin the installation. One thing to note is that if you have any dependencies you must meet those before you can proceed.  Execute the file:

sh truecrypt*

TrueCrypt 6.3a Setup
Installation options:
1) Install truecrypt_6.3a-0_i386.deb
2) Extract package file truecrypt_6.3a-0_i386.deb and place it to /tmp
To select, enter 1 or 2:

Choose 1) to install, You will need to accept the license.

After installation go to terminal and type command: truecrypt to open up the application.

Read more

How to play Encrypted DVDs on Ubuntu Linux

To play encrypted DVDs, the libdvdcss2 package is essential. libdvdcss2 is a simple library designed for accessing DVDs like a block device without having to bother about the decryption. More information about this package can be found at VideoLAN.

You can install libdvdcss2 as a 64-bit .deb package without installing the Medibuntu repositories:
$ wget -c
$sudo dpkg -i libdvdcss2_1.2.10-0.2medibuntu1_amd64.deb
32-bit .deb package:
$ wget -c
$ sudo dpkg -i libdvdcss2_1.2.10-0.2medibuntu1_i386.deb
You can also use guidelines provided at Medibuntu. This will install the Medibuntu repositories on your system and then install the libdvdcss2 package:
$ sudo wget --output-document=/etc/apt/sources.list.d/medibuntu.list
$ sudo apt-get update
$ sudo apt-get install medibuntu-keyring
$ sudo apt-get update
$ sudo apt-get install libdvdcss2
You can also install 32 bit or 64 bit Windows multimedia codecs (if you haven't already done so using ubuntu-restricted-extras):

$ sudo apt-get install w32codecs
$ sudo apt-get install w64codecs

Instead of downloading directly from Medibuntu, you could also use the script included with the libdvdread4 package to download and install libdvdcss2:
$ sudo apt-get install libdvdread4
$ sudo /usr/share/doc/libdvdread4/
Read more

How to Create a .deb package from Source files

If your build from source is successful, you can make a Debian (Ubuntu) package (.deb) for future use or can distribute to other users:

Install package tools: sudo apt-get install checkinstall

CheckInstall keeps track of all files installed by a "make install" or equivalent, creates a Slackware, RPM, or Debian package with those files, and adds it to the installed packages database, allowing for easy package removal or distribution.

Rebuild package using "checkinstall":
cd /path/to/extracted/package
sudo make
sudo checkinstall
Keep the resulting ".deb" file for future use. It can later be installed using:

sudo dpkg -i packagename.deb

Note: These are basic instructions that may not always work. Some packages require additional dependencies and optional parameters to be specified in order to build them successfully. Also see these Ubuntu wiki instructions.
Read more

How to Watch Log Files in Realtime - Tailf

The most widely used command for monitoring log file is tail. Tail binary allows a user to watch the log file grow in realy time. Watching the log file grows can be done using an additional -f parameter. Alternatively, another approach to watch a log file grows can be done using tailf binary command.

tailf  will  print  out  the  last 10 lines of a file and then wait for the file to grow.  It is similar to tail -f but does not access the file when it is  not  grow-ing. This  has the side effect of not updating the access time for the file, so a filesystem flush does not occur periodically when no log activity is happening.

tailf is extremely useful for monitoring log files on  a  laptop  when  logging  is    infrequent  and  the  user desires that the hard disk spin down to conserve battery life.

Example: # tailf /var/log/squid/access.log

Similarly you can watch the same log file using -f argument

Example: # tail -f /var/log/squid/access.log
Read more

HOW-TO convert DAA (Direct Access Archive) files to ISO in Linux

The .daa file extension stands for 'Direct Access Archive' is a proprietary file format developed by PowerISO Computing for their CD/DVD image file-processing tool "PowerISO".

Unlike the majority of CD/DVD image formats, the PowerISO's .daa format allows advanced features such as file compression, password protection, encryption and the ability to split files in to multiple volumes. Due to these advanced features, PowerISO is the only software package that can read .daa files.

But it is very simple to convert DAA to ISO in linux. You just need an utility called daa2iso.

Install it on a RPM based system using ’sudo yum -y install daa2iso
or on a debian based system using ’sudo apt-get install daa2iso.

And to use the utility, just type the following: daa2iso source-file.daa dest-file.iso
Read more

How to Convert cue and bin files into an iso/cdr/wav file - BChunk

binchunker converts a CD image in a ".bin / .cue" format (sometimes ".raw / .cue") to a set of .iso and .cdr tracks. The bin/cue format is used by some popular non-Unix cd-writing software, but is not supported on most other CD burning programs. A lot of CD/VCD images distributed on the Internet are in BIN/CUE format.

The .iso track contains an ISO file system, which can be mounted through a loop device on Linux systems, or written on a CD-R using cdrecord. The .cdr tracks are in the native CD audio format. They can be either written on a CD-R using cdrecord -audio, or converted to WAV (or any other sound format for that matter) using sox. bchunk can also output audio tracks in WAV format.

Debian / Ubuntu: sudo apt-get install bchunk
OpenSuSe 11.2 user can use "1-click" installer - here

Using bchunk:
Now enter the following command: bchunk
where the image.bin is the file that contains the actual data, image.cue is the catalogue file and basename is the name of the "output" that extracted files will go to. This command will create an iso image caled basename.iso

Enter the following comand: sudo mount -o loop basename.iso /mnt, this command will mount the iso file to /mnt

List the content using sudo ls /mnt
Read more

Mobile Phone Manager for Linux – Wammu

Wammu is a mobile phone manager that uses Gammu as its backend. It works with any phone that Gammu supports, including many models from Nokia, Sony-Ericssonn, Motorola, Samsung, Siemens, Huawei and others.

* Read, edit, delete, copy for contacts, todo, and calendar.
* Read, save, and send SMS.
* SMS composer for multi-part SMS messages, and it can display SMS messages that include pictures.
* Search phone
* Backup

With all features above, i think Wammu can be an alternative for PC Suite-like application. Unfortunately, not all features above will work in any phone. You can find supported phone in Gammu’s Phone database. Find your phone in there before trying Wammu.

Install wammu - Phone manager:
Debian / Ubuntu: $ sudo apt-get install wammu
OpenSuSe 11.2 user can use "1-click" installer - here

After installation, go to terminal and type command wammu to open up the application

Click on "Next" to let wammu detect/configure you mobile phone.

Read more

Control Your Network badwidth with Wondershaper in Linux

If you are a Network Administrator with little knowledge in Network Protocols and IPtables, don't worry you can also controll your network traffic with a simple tool named wondershaper.

OpenSuSe 11.2 user can use "1-click" installer to install Wondershaper - here
Ubuntu: sudo apt-get install wondershaper

$ifconfig this will help you to find the network interface (eth0, eth1 or wifi0 etc..) on which you need to apply bandwidth shaping.

Now here is the simple example of using wondershaper:
$sudo wondershaper eth0 downspeed upspeed

eg: sudo wonderspeed 128 64
To Disable this settings: $sudo wondershaper clear eth0

To make these connection settings permanent by editing /etc/network/interfaces file :
$ sudo gedit /etc/network/interfaces and add the following lines:
up /sbin/wondershaper eth0 downspeed upspeed
down /sbin/wondershaper clear eth0
Read more

How to Start/Stop & Disable Services in Ubuntu (Karmic Koala) Linux

Services are programs (called daemons) that once started run continuously in the background and are ready for input or a changes in your computer and respond to them. For example the Apache server has a daemon called httpd (the d is for daemon) that listens on port 80 on your computer and when it receives a request for a page it sends the appropriate data back to the client machine.

Many services are required to run all the time however many can be safely turned off for both security reasons as running unnecessary services opens more doors into your computer, but also for performance reasons. It may not make much difference but your computer should boot slightly faster the less services it has to start on boot.

This post explains how to start/stop the services and how to control which services start automatically at boot time for Ubuntu System

The scripts located in /etc/init.d are part of the bootup sequence of every Debian-like distro. Very often Ubuntu's documentation and guides have suggested - in order to deactivate init scripts - to change the permissions of the scripts in /etc/init.d, making them non-executable. This will have the following consequences:

    * You'll get an error message at boot time (to avoid it you need to patch all the scripts);
    * You are breaking the logical chain stated in debian-policy concerning runlevel configuration.

If the logic of a debian-like system boot up sequence is not very clear and familiar to you, you should not play with symlinks, permissions, etc. In order to avoid messing up your system, Boot-Up Manager will automate all of your configuration in a nice and clean graphical interface.

Open up "Ubuntu Software Center" : Application >> Ubuntu Software Center and find for package "BootUp-Manager" and install it.

After successful installation go to : System >> Administration >> BootUp-Manager

Bootup-Manager got a very clean and simple interface through which you can start/stop or Disable the services in Ubuntu Linux System.
Read more

Nvidia and ATI Proprietary Graphics Drivers support in OpenSuSe 11.2 Linux

The problem of the proprietary (closed source) drivers is a very important subject in those 2006 days. The openSUSE decided to follow the kernels developers recommendations and not to include proprietary drivers with the kernel.

Please look at the linux-kernel mailing list to better understand the situation.

The reasons why a certain drivers is not included in the main openSUSE are the following:

    * The software is proprietary software, it does not conform to the Open Source definition.
    * The software is providing functionality which is patented and the patent holder is preventing distribution of the software.
    * The software violates laws concerning software distribution in jurisdictions where Novell conducts business.

Users who want to use this functionality despite this can follow this instruction to get the complete driver support in their OpenSuSe 11.2 Linux system.

NVIDIA Graphics Drivers:

The NVIDIA drivers cannot be integrated directly into openSUSE because of their license. Fortunately for new users, NVIDIA and openSUSE provide a very easy way to install NVIDIA drivers: NVIDIA makes RPMs for openSUSE and provides them in a repository.

Three classes of drivers support NVIDIA cards:

   1. The open source “nv” driver which has severe limitations (does not even support some new cards like the Quadro 570FX, does not have proper dual head support and has no 3D support) It is included in Xorg and is used by default.
   2. The closed source, proprietary “nvidia” driver which requires the “nvidia” kernel module which many kernel developers regard as being in violation of the GPL.
    3. There is the reverse engineered nouveau driver which is based on the nv driver. It aims to provide proper dual head support and 3D support.

So, in order to get the driver support, download the following file depending upon your card and execute them to let YAST install and configure the driver for you.

NVIDIA Current (GeForce 6xxx and newer) - Here
NVIDIA Legacy I (FX 5xxx) - Here
NVIDIA Legacy II (GeForce 4 and older) - Here

ATI Graphics Drivers:
Three classes of drivers support ATI cards:

   1. includes F/LOSS drivers for many (older) ATI graphics adapters. These are used by default.
   2. The ATI graphics drivers are proprietary and many kernel developers consider this driver to violate the GPL license of the kernel.
   3. ATI has released some register specifications of their recent chipsets but has not released any documentation about the 3D functionality of their newer cards. The new ativivo and radeonhd drivers support (alpha quality) newer ATI R500/R600 graphics adapters. See the corresponding openSUSE news item

Please, consider that many older ATI cards are supported very well by the standard free driver radeon, which is installed during installation.

Before using the drivers below, try running your 3D application using the default open source drivers: radeon (for older cards) and radeonhd (for newer cards)

Use "1-click" installer to allow YAST to install and configure the required driver on your system

ATI Current - Here
ATI Legacy - Here
Read more

Multimedia (MP3, MPEG-4, AVI, DiVX, etc.) support in OpenSuse 11.2 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.2.

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

Open Office 4 Kids - OOo4Kids for kids or better say OOo4kids is a project that aims to provide a simplified version of for kids between 7-12 years.

Ooo4Kids is based on source code. Everything is made with the idea to contribute back to Project, through Education Project, and students projects, but not only (all sort of contributions are welcome, of course). Resources are managed by the EducOOo non profit association.

The main difference between Open Office and Open Office 4 Kids are the missing features in Open Office 4 Kid. A benefit of this is the performance gain when working with Open Office 4 Kids compared to a default Open Office installation. The interface is different as well. Open Office 4 Kids makes use of less buttons in the interface and divides them into a header tool-bar and sidebar.Additional changes are planed by developers in future releases

OOo4kids is available for Linux ,Mac and Windows.The latest version of OOo4kids can be downloaded from this link : Here

Here is the video showing OOo4Kids Installation:

Read more

IP Filtering Program Similar to PeerGuardian for Linux - iplist

iplist is a Linux application for blocking connections to and from a specified range of hosts using the netfilter netlink-queue library. Iplist is an open source IP filtering program similar to PeerGuardian  for Linux.

Some typical reasons for using iplist are:
    * to protect your privacy
    * to ban a large number of unwanted clients
    * to block whole countries or networks
    * to block spam- and ad-servers
    * for parental control
    * network monitoring

Packets are filtered in the chains specified in IPTABLES_CHAIN_*. For each attempt to establish a new connection iplist looks at the source / destination address of the packet and decides based on the IPs in the lists whether to reject the connection (tcp-reset or icmp-port-unreachable) or to send it back to iptables to be handled by the rest of the iptables configuration. Packets in the INPUT chain are dropped by default. Nice side effects of rejecting packets rather than dropping are that there are no annoying timeouts if you try to access a blocked IP and it's hard to find out if the host which uses IPblock is online or uses a packet filter.

OpenSuSe user can use "1-click" installer to install iplist - here

After the installation if you want to open ipblock go to Applications > System >  Internet > ipblock. Once it opens you should see similar to the following screen

The default choice for lists is similar to peerguardian.

    * level1.gz - Anti-P2P organizations and known government addresses
    * ads-trackers-and-bad-pr0n.gz - Advertising and data tracker servers
    * spyware.gz - Malicious spyware and adware servers
    * edu.gz - Educational institutions and universities
    * bogon.gz - Spoofed IP-addresses

Custom p2p or dat lists can easily be added. Note that lists can optionally be compressed with gzip.These lists are maintained here

There are many more setting that you can do in "setting" tab.
Read more

Installing Software from Ubuntu Software Center (Karmic Koala)

The Ubuntu Software Center is a virtual catalog of thousands of free   applications available for Ubuntu — software to make your computer more useful.  You can find applications by category or by searching, and you can install an application with the click of a button.
The Software Center also lets you examine the applications installed on the    computer already,and remove those you no longer need.

To install a program from the Software Center, you need administrator access and a working Internet connection. start the application from Application ⟶ Ubuntu Software Center

In the Get Free Software section, find the program you want to install. If you already know its name, try typing the name in the search field. Or try searching for the type of program you want (like “spreadsheet”). Otherwise, browse the Software Center departments to find the program.
  * Click the program in the list, and click the arrow button to go to the screen for the program.
  * Click the Install button. You may need to enter your Ubuntu password before the installation can begin.

  * How long a program takes to install depends on how large it is, and the speed of your computer and Internet connection.

While a program is being installed, it appears in the Software Center’s In Progress section. As soon as it disappears, the program is installed.
Read more

Time Synchronization on Ubuntu using NTP

Modern computers do have internal clocks called Real Time Clock chips (RTC) that provide time and date information. These chips are battery backed so that even during power outages, they can maintain time but personal computers are not designed to be perfect clocks. Their design has been optimized for mass production and low-cost rather than maintaining accurate time.

For many applications, this is can be quite adequate, although, quite often machines need time to be synchronised with other PC's on a network and when computers are out of sync with each other problems can arise such as sharing network files or in some environments even fraud!

NTP can maintain time over the public Internet to within 10 milliseconds (1/100th of a second) and can perform even better over LANs with accuracies of 200 microseconds (1/5000th of a second) under ideal conditions.

Keeping Linux systems synchronized is highly important for many reasons such as:

    * Security
    * Conducting time sensitive transactions
    * Tracing and logging errors
    * Preventing data loss
    * Auditing systems

To set up NTP time synchronization graphically, launch Time & Date, also available through (System ⟶ Administration ⟶ Time & Date). Click the keys to unlock settings. Now, you can select your time zone, and configure it to "Keep synchronized with Internet servers", at which point it will prompt you to Install NTP support.

After that, click "Select Servers" and check off the server closest to you.

Read more

How To Upgrade from Ubuntu 9.04 (Jaunty Jackalope) to Ubuntu 9.10 (Karmic Koala)

This tutorial provides instructions on upgrading to Ubuntu 9.10 (code name “Karmic Koala”), the most recent release of Ubuntu, released on the 29th of October 2009.

1. First and foremost, you need to backup all your important files.

2. Next, make sure the repository is updated: sudo apt-get update

3. Open the Update Manager with this command: sudo update-manager -d
If there are any updates to install, use the Install Updates button to install them, and press Check again after that is complete.

A message will appear informing you of the availability of the new release. 

The Update Manager will open and you will now see the upgrade option. If you are brave enough just go on. Follow the on-screen instructions.

4. Now sit back, relax and hope for the best.

If the upgrade process is successful and everything is working well, congratulations and have fun with Ubuntu 9.10 Karmic Koala.
Read more
Related Posts with Thumbnails