Sunday, July 5, 2009

Slackware 12.2

This Slackware edition combines Slackware's legendary simplicity (and
close tracking of original sources), stability, and security with some
of the latest advances in Linux technology. Expect no less than the best
Slackware yet.

Among the many program updates and distribution enhancements, you'll find
two of the most advanced desktop environments available today: Xfce 4.4.3,
a fast and lightweight but visually appealing and easy to use desktop
environment, and KDE 3.5.10, the final 3.x version of the award-winning K
Desktop Environment. Properly set up, Slackware's desktop is suitable for
any level of Linux experience.

Slackware uses the 2.6.27.7 kernel bringing you advanced performance
features such as journaling filesystems, SCSI and ATA RAID volume support,
SATA support, Software RAID, LVM (the Logical Volume Manager), and
encrypted filesystems. Kernel support for X DRI (the Direct Rendering
Interface) brings high-speed hardware accelerated 3D graphics to Linux.

There are two kinds of kernels in Slackware -- the huge kernels, which
contain support for just about every driver in the Linux kernel. These are
primarily intended to be used for installation, but there's no real reason
that you couldn't continue to run them after you have installed. The
other type of kernel is the generic kernel, in which nearly every driver
is built as a module. To use a generic kernel you'll need to build an
initrd to load your filesystem module and possibly your drive controller
or other drivers needed at boot time, configure LILO to load the initrd at
boot, and reinstall LILO. See the docs in /boot after installing for more
information. Slackware's Linux kernels come in both SMP and non-SMP types
now. The SMP kernel supports multiple processors, multi-core CPUs,
HyperThreading, and about every other optimization available. In our own
testing this kernel has proven to be fast, stable, and reliable. We
recommend using the SMP kernel even on single processor machines if it
will run on them.

From the beginning, Slackware has offered a stable and secure Linux
distribution for UNIX veterans as well as an easy-to-use system for
beginners. Slackware includes everything you'll need to run a powerful
server or workstation. Each Slackware package follows the setup and
installation instructions from its author(s) as closely as possible,
offering you the most stable and easily expandable setup.

Here are some of the advanced features of Slackware 12.2:

- Runs the 2.6.27.7 version of the Linux kernel from ftp.kernel.org.
Also included is a kernel patched with Speakup to support speech
synthesizers providing access to Linux for the visually impaired
community. The 2.6.x kernel series has matured into a stable
kernel, and provides reliable performance for your desktop or
your production server.

- System binaries are linked with the GNU C Library, version 2.7.
This version of glibc also has excellent compatibility with
existing binaries.

- X11 based on the X.Org Foundation's modular X Window System.
There's been much activity in the X development world, and the
improvements in terms of performance and hardware support are
too numerous to mention them all here.

- Installs gcc-4.2.4 as the default C, C++, Objective-C,
Fortran-77/95, and Ada 95 compiler.

- Support for fully encrypted network connections with OpenSSL,
OpenSSH, OpenVPN, and GnuPG.

- Apache (httpd) 2.2.10 web server with Dynamic Shared Object
support, SSL, and PHP 5.2.8.

- PCMCIA, CardBus, USB, IEE1394 (FireWire) and ACPI support. This
makes Slackware a great operating system for your laptop.

- The udev dynamic device management system for Linux 2.6.x.
This locates and configures most hardware automatically as it
is added (or removed) from the system, and creates the access
nodes in /dev. It also loads the kernel modules required by
sound cards and other hardware at boot time.

- New development tools, including Perl 5.10.0, Python 2.5.2,
Ruby 1.8.7-p72, Subversion 1.5.4, git-1.6.0.3, mercurial-1.0.2,
graphical tools like Qt designer and KDevelop, and much more.

- Updated versions of the Slackware package management tools make it
easy to add, remove, upgrade, and make your own Slackware packages.
Package tracking makes it easy to upgrade from Slackware 12.1 to
Slackware 12.2 (see CHANGES_AND_HINTS.TXT). The slackpkg tool can
also help update from an older version of Slackware to a newer one,
and keep your Slackware system up to date. In addition, the
slacktrack utility (in extra/) will help you build and maintain
your own packages.

- Web browsers galore! Includes KDE's Konqueror 3.5.10,
SeaMonkey 1.1.13 (this is the replacement for the Mozilla
Suite), and the immensely popular Firefox 3.0.4, as well as
the Thunderbird 2.0.0.18 email and news client with advanced
junk mail filtering.

- The complete K Desktop Environment (KDE) version 3.5.10, including
the KOffice productivity suite, networking tools, GUI development
with KDevelop, multimedia tools (including the amazing Amarok
music player and K3B disc burning software), the Konqueror web
browser and file manager, dozens of games and utilities,
international language support, and more.

- A collection of GTK+ based applications including pidgin-2.5.2,
gimp-2.4.7, gkrellm-2.3.2, gxine-0.5.903, xchat-2.8.6, xsane-0.996,
and pan-0.133.

- Large repository of extra software packages compiled and ready to
run. This includes various window managers, the Java(TM) 2 Software
Development Kit Standard Edition, libsafe (buffer overflow protection
for additional security), and much more (see the /extra directory).

- Many more improved and upgraded packages than we can list here. For
a complete list of core packages in Slackware 12.2, see this file:

ftp://ftp.slackware.com/pub/slackware/slackware-12.2/PACKAGES.TXT


Downloading Slackware 12.2:
---------------------------

The full version of Slackware Linux 12.2 is available for download from
the central Slackware FTP sites hosted by our friends at www.cwo.com
and osuosl.org:

ftp://slackware.osuosl.org/pub/slackware/slackware-12.2/
ftp://ftp.slackware.com/pub/slackware/slackware-12.2/

If the sites are busy, see the list of official mirror sites here:

http://slackware.com/getslack/

We will be setting up BitTorrent downloads for the official ISO images.
Stay tuned to http://slackware.com for the latest updates.

Instructions for burning the Slackware tree onto install discs may be
found in the isolinux directory.



Tuesday, June 30, 2009

Running UNIX Commands Immune to Hangups (nohup)

by Jeff Hunter, Sr. Database Administrator

Overview

This month, I introduce the UNIX nohup utility. Most of the information included in this article are taken directly from the nohup man page.

As a DBA, you have more than likely been faced with the need to run a command in UNIX that you know will take a long time to complete. Most often, you will want to run the command and "exit" from the terminal. When the shell exits though, it sends its children a SIGHUP signal, which by default causes them to be killed. All stopped, running and background jobs will ignore SIGHUP and continue running if their invocation is preceded by the nohup or if the process programmatically has chosen to ignore SIGHUP.



The nohup utility invokes the named command with the arguments supplied. When the command is invoked, nohup arranges for the SIGHUP signal to be ignored by the process.

Syntax

/usr/bin/nohup command [ argument ...]

Processes run by /usr/bin/nohup are immune to SIGHUP (hangup) and SIGQUIT (quit) signals.

/usr/xpg4/bin/nohup command [ argument ...]

Processes run by /usr/xpg4/bin/nohup are immune to SIGHUP.

Other Notes

The nohup utility does not arrange to make processes immune to a SIGTERM (terminate) signal, so unless they arrange to be immune to SIGTERM or the shell makes them immune to SIGTERM, they will receive it.

If nohup.out is not writable in the current directory, output is redirected to $HOME/nohup.out. If a file is created, the file will have read and write permission "600". If the standard error is a terminal, it is redirected to the standard output, otherwise it is not redirected. The priority of the process run by nohup is not altered.

If you are running the Korn shell as your login shell, and have nohup'ed jobs running when you attempt to logout, you will be warned with the message

You have jobs running.

You will then need to logout a second time to actually logout; however, your background jobs will continue to run.

The C-shell has a built-in command nohup that provides immunity from SIGHUP, but does not redirect output to nohup.out. Commands executed with `&' are automatically immune to HUP signals while in the background.

nohup does not recognize command sequences. In the case of the following command

example$ nohup command1; command2

The nohup utility applies only to command1. The command

example$ nohup (command1; command2)

is syntactically incorrect.

Operands

The following operands are supported:

command

The name of a command that is to be invoked. If the command operand names any of the special shell_builtins(1) utilities, the results are undefined.

argument

Any string to be supplied as an argument when invoking the command operand.

Examples

It is frequently desirable to apply nohup to pipelines or lists of commands. This can be done only by placing pipe- lines and command lists in a single file, called a shell script. One can then issue:

example$ nohup sh file

and the nohup applies to everything in file. If the shell script file is to be executed often, then the need to type sh can be eliminated by giving file execute permission.

Add an ampersand and the contents of file are run in the background with interrupts also ignored (see sh(1)):

example$ nohup file &

Thursday, June 25, 2009

Difference RMAN and EXPDP

Question: I've been using data pump (the export utility) to backup my database, but I wonder if I should be using RMAN instead. They both do backups, so what's the advantages of each?

Answer: Yes, RMAN and export both backup tables, and they both support flashback database, but there are some important differences:

* Data Pump Export (expdp) - The export utility is a "logical" backup, usually done by specifying specific tables. If you fail to do a "consistent" export, or if you fail to include related tables and use RESTRICTED and CONSISTENT mode (with referential integrity constraints), you may not be able to recover properly. Also, export can only read "cooked" files, and database with raw files (e.g. RAC) cannot be copied with export. Hence, export is often used as a supplement to RMAN, usually for the restore of specific tables.



* Recovery manager (rman) - RMAN is designed for backup and recovery, a extension of the Enterprise Backup Utility (EBU). RMAN reads raw files, takes time-consistent backups. manages referential integrity.

Advantages & disadvantages of Export:

* Free, and easy to use
* Very slow, compared to RMAN (examines every data block)
* Easy restore of a specific table
* Does not require ARCHIVELOG mode
* Export will discover the SCN that is closest to the specified time. This SCN is used to enable flashback with export.

Advantages & disadvantages of RMAN:

* Supports raw devices
* RMAN has block-level media recovery
* Has a catalog for backup tracking and a report utility
* Fast - If you dedicate a backup device for each production disk, you can backup terabytes in the time it takes to backup any single disk.
* Does hot or cold backups
* Backups and restores can be done in parallel
* Allows incremental backups (block change tracking)
* Interfaces with media management systems (TMS)
* RMAN can be used to backup changed data even after a nologging operation, and you can move away from archivelog mode.


by Burleson Consulting - www.dba-oracle.com

Sunday, January 25, 2009

Install .rpm Files in Debian and Ubuntu

Some time you might find some applications are having only .rpm files but you want a .deb package for your debian,Ubuntu and other debian derived ditributions.If you can’t find .deb debian package in any of the debian,ubuntu repositories or elsewhere, you can use the alien package converter to install the .rpm file.

Alien is a program that converts between the rpm, dpkg, stampede slp, and slackware tgz file formats. If you want to use a package from another 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.


Despite the large version number, alien is still (and will probably always be) rather experimental software. It has been used by many people for many years, but there are still many bugs and limitations.

Alien should not be used to replace important system packages, like sysvinit, shared libraries, or other things that are essential for the functioning of your system. Many of these packages are set up differently by Debian and Red Hat, and packages from the different distributions cannot be used interchangably. In general, if you can’t uninstall the package without breaking your system, don’t try to replace it with an alien version.

Install alien in debian

#apt-get install alien

This will install all the required packages.Now you can start converting your .rpm files to .deb packages.

Available Options for alien

Convert the package.rpm into a package.deb

#alien -d package-name.rpm

Convert the package.rpm into a package.deb, and install the generated package.

#alien -i package-name.rpm

If you want to keeps alien from changing the version number use the following command

#alien -k rpm-package-file.rpm

Example

Suppose we have a avg antivirus avg71lms-r30-a0782.i386.rpm file

To convert .rpm to debian

#alien -k avg71lms-r30-a0782.i386.rpm

Now you should be having avg71lms-r30-a0782.i386.deb file

To install .deb file

#dpkg -i avg71lms-r30-a0782.i386.deb

If you don’t use -k option you should see avg71lms_r30-1_i386.deb file the difference is it will add 1

Install alien in Ubuntu

$sudo apt-get install alien

You can check the above section for available options

Example

Suppose we have a avg antivirus avg71lms-r30-a0782.i386.rpm file

To convert .rpm to debian

$sudo alien -k avg71lms-r30-a0782.i386.rpm

Now you should be having avg71lms-r30-a0782.i386.deb file

To install .deb file

$sudo dpkg -i avg71lms-r30-a0782.i386.deb

If you don’t use -k option you should see avg71lms_r30-1_i386.deb file the difference is it will add 1

Recover Data from a Damaged hard disk using dd_rhelp

dd_rhelp is a bash script that handles a very usefull program written in C which is called dd_rescue, it roughly act as the dd linux command with the caracteristic to NOT stop when it falls on read/write errors.

This makes dd_rescue the best tool for recovering hard drive having bad sectors.In short, it’ll use dd_rescue on your entire disc, but will try to gather the maximum valid data before trying for ages on badsectors. So if you leave dd_rhelp work for infinite time, it’ll have the same effect as a simple dd_rescue. But because you might not have this infinite time , dd_rhelp will jump over bad sectors and rescue valid data. In the long run, it’ll parse all your device with dd_rescue.


You can Ctrl-C it whenever you want, and rerun-it at will, it’ll resume it’s job as it depends on the log files dd_rescue creates.In addition, progress will be shown in a ASCII picture of your device beeing rescued.

Why use dd_rhelp and not dd_rescue ?

dd_rhelp uses dd_rescue to compute a recovery path through the device that will focus on valid data recovering. This recovery path will go through all the device, exactly as dd_rescue could do it on its own without any path. This means that dd_rhelp will save you time ONLY IF YOU INTEND TO CANCEL ITS JOB BEFORE THE END of a full recovery.

Because a considerable amount of time is taken to try to rescue badsectors. This amount of time can be mesured in days,
month, years, depending on your device capacity and its defectiveness. You might not want to spend this time knowing that 99 percent of this time will be taken to look at badsector and won’t lead to any more data recovering.

dd_rhelp shifts this useless waiting time to the end. Using dd_rescue strait throughout your device make your waiting time dependent on the badsector distribution.

Install dd_rhelp

First you need to download latest version from here

Preparing your system

#apt-get install make gcc g++ ddrescue

If you are using ubuntu linux use the following command

sudo apt-get install make gcc g++ ddrescue

Download dd_rhelp using the follwoing command

wget http://www.kalysto.org/pkg/dd_rhelp-0.0.6.tar.gz

Now you have dd_rhelp-0.0.6.tar.gz file

Extract this file using the following command

tar xzvf dd_rhelp-0.0.6.tar.gz

cd dd_rhelp-0.0.6

Run the following commands

# ./configure

# make

# make install

If you are using ubuntu linux use the following command

sudo ./configure

sudo make

sudo make install

This will complete the installation and this will install program under /usr/local/bin/dd_rhelp

dd_rhelp Syntax

dd_rhelp {filename|device} {output-file} [{info}]
or dd_rhelp --help
or dd_rhelp --version

Now we will see how to use ddrescue under damaged disk

If you have a damaged hard disk /dev/sda1 and you have an empty space hard disk /dev/sda2 Now if you want to copy data from /dev/sda1 to /dev/sda2 use the following command

#dd_rhelp /dev/sda1 /dev/sda2/backup.img

If you are using ubuntu linux use the following command

sudo dd_rhelp /dev/sda1 /dev/sda2/backup.img

Output looks like below

/usr/bin/tail: Warning: “+number” syntax is deprecated, please use “-n +number”
=== launched via ‘dd_rhelp’ at 0k, 0 >>> ===
dd_rescue: (info): ipos: 104384.0k, opos: 104384.0k, xferd: 104384.0k
errs: 0, errxfer: 0.0k, succxfer: 104384.0k
+curr.rate: 10178kB/s, avg.rate: 8532kB/s, avg.load: 31.3%
dd_rescue: (info): /dev/sda2 (104391.0k): EOF
Summary for /dev/sda2 -> backup.img:
dd_rescue: (info): ipos: 104391.0k, opos: 104391.0k, xferd: 104391.0k
errs: 0, errxfer: 0.0k, succxfer: 104391.0k
+curr.rate: 355kB/s, avg.rate: 8519kB/s, avg.load: 31.3%
/usr/bin/tail: Warning: “+number” syntax is deprecated, please use “-n +number”

This copies an image of /dev/sda1 to sda2

Now you need to check the backup image consistency this will check for is there any problems with this image.

#fsck -y /dev/sda2/backup.img

If you are using ubuntu linux use the following command

sudo fsck -y /dev/sda2/backup.img

After finishing this checking you need to mount your disk image in to your other hard disk

#mount /dev/sda2/backup.img /mnt/recoverydata

If you are using ubuntu linux use the following command

sudo mount /dev/sda2/backup.img /mnt/recoverydata

This will mount all the data from the backup.img under /mnt/recoverydata now you can try to access the data it should
work without any problem.

Restore image

If you want to restore this image use the following command

#dd_rhelp /dev/sda2/backup.img /dev/sda1

If you are using ubuntu linux use the following command

sudo dd_rhelp /dev/sda2/backup.img /dev/sda1

Copy Disk Image to remote machine using SSH

If you want to copy your disk image to remote machine over ssh you need to use the following command

#dd_rhelp /dev/sda1 - | ssh username@machineip ‘cat /datarecovery/backup.img’

If you are using ubuntu linux use the following command

sudo dd_rhelp /dev/sda1 - | ssh username@machineip ‘cat /datarecovery/backup.img’

This will be prompetd for password of the username you have menctioned in the above command after entering the password

dd_rhelp strats copying obviously it will take some time to copy over the network

Kill Session in Oracle DB

Now I try to write about kill session in oracle database. First time please login to oracle server. Type sqlplus then enter


$ sqlplus

SQL*Plus: Release 10.2.0.3.0 - Production on Sat Jan 24 07:26:59 2009

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.

Enter user-name:
$ sqlplus / as sysdba

SQL*Plus: Release 10.2.0.3.0 - Production on Sat Jan 24 07:27:17 2009

Copyright (c) 1982, 2006, Oracle. All Rights Reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.2.0.3.0 - 64bit Production
With the Partitioning, Real Application Clusters, OLAP and Data Mining options

To get serial of the session that will kill type @sql_sid then enter

SQL> @sql_sid
enter value for sid: session_id

Now kill session

SQL> alter system kill session 'session,serial';

System altered.

SQL>

If the message showed System Altered the killing session is done

Howto: Connect automatically on login to a Wireless Router on Ubuntu 7.10

I only tried this for a Belkin G+MIMO but it should be ok for most router types.

Before you carry on:

Do you know the full essid of your router?

Do you know if your adapter is plugged in?

Do you know if you have a static or dynamic IP or a DHCP?



If it’s an RTxx driver, do you have ndiswrapper or Serialmonkey’s drivers installed?

First off you need to know the full essid of your router (This is the name of the network), in my case it is Belkin_G_Plus_MIMO

So open up network admin in manual configuration, make sure wlan0 is plugged in, this is your adapter, click properties and disable Roaming Mode by clicking that checked box there.

In the first box, Network Name, type in your network’s essid, this could be anything from My_Interwebs or NETGEAR121324345 or anything, it’s best to use the dropdown box next to it and choose from the list of currently detected routers, pick yours.

Type in a WPA key if you have one, obviously make sure it’s correct.

Now for the next column, it’s best to check your Router’s manual for this, but for most users it’s Automatic Configuration (DHCP), if you know you have a Static or Dynamic IP or any other option, make sure you use them, but as I said, it’s usually DHCP.

Now click OK.

These next few steps may not be necessary but it made sure I was connected. In Terminal run:

* sudo iwconfig wlan0 essid Network_Name

Obviously, Network_Name is the essid you used in Manual Configuration..

* sudo iwconfig wlan0 key off

OR

* sudo iwconfig wlan0 key yourwpakey

Here goes your WPA key, if you don’t have one, simply type off.

Now do

* sudo dhclient wlan0

This will make sure you’re connected ok. If you only _send_ DHCPOFFERS and receive nothing, you are not connected and it’s best you try another method.

Change your Network card MAC ( Media Access Control) address

Media Access Control address, a hardware address that uniquely identifies each node of a network. In IEEE 802 networks, the Data Link Control (DLC) layer of the OSI Reference Model is divided into two sublayers: the Logical Link Control (LLC) layer and the Media Access Control (MAC) layer. The MAC layer interfaces directly with the network medium.Consequently, each different type of network medium requires a different MAC layer. On networks that do not conform to the IEEE 802 standards but do conform to the OSI Reference Model, the node address is called the Data Link Control (DLC) address.



If you want to change your network card mac address you need to use simple utility called mac changer.MAC changer is a utility for manipulating the MAC address of network interfaces

Possible usages

You’re in a DHCP network with some kind of IP-based restriction

You’ve a cluster that boot with BOOTP and you want to have a clean set of MACs

Debug MAC based routes

MAC Changer Features

Set specific MAC address of a network interface

Set the MAC randomly

Set a MAC of another vendor

Set another MAC of the same vendor

Set a MAC of the same kind (eg: wireless card)

Display a vendor MAC list (today, 6800 items) to choose from

Install MAC Changer in Debian

#apt-get install macchanger

Install MAC Changer in Ubuntu

sudo apt-get install macchanger

This will complete the installation.

If you Find your MAC address using the following command

ifconfig

eth0 Link encap:Ethernet HWaddr 00:0C:29:A8:D0:FA
inet addr:172.20.22.35 Bcast:172.20.22.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fea8:d0fa/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:7690 errors:0 dropped:0 overruns:0 frame:0
TX packets:6399 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:4284579 (4.0 MiB) TX bytes:876317 (855.7 KiB)
Interrupt:177 Base address:0×1080

In the above example MAC Address is 00:0C:29:A8:D0:FA

If you want to configure MAC Changer you need to stop the networking services using the following command

For Debian Users

#/etc/init.d/networking stop

For Ubuntu Users

sudo /etc/init.d/networking stop

Now you need to configure your MAC address using the following examples

MAC Changer Syntax

macchanger [options] device

Examples

# macchanger eth1

Current MAC: 00:09:a5:eb:23:f7 (Hansung Eletronic Industries Development Co., Ltd)
Faked MAC: 00:09:a5:eb:23:f8 (Hansung Eletronic Industries Development Co., Ltd)

# macchanger --endding eth1

Current MAC: 00:09:a5:eb:23:f8 (Hansung Eletronic Industries Development Co., Ltd)
Faked MAC: 00:09:a5:6f:31:23 (Hansung Eletronic Industries Development Co., Ltd)

# macchanger --another eth1

Current MAC: 00:09:a5:6f:31:23 (Hansung Eletronic Industries Development Co., Ltd)
Faked MAC: 00:11:18:5b:3a:1f (Blx Ic Design Corp., Ltd.)

# macchanger -A eth1

Current MAC: 00:06:5b:f6:f3:48 (Dell Computer
Corp.)
Faked MAC: 00:0d:11:93:0c:4f (Dentsply - Gendex)

# macchanger -r eth1

Current MAC: 00:0d:11:93:0c:4f (Dentsply - Gendex)
Faked MAC: 3c:f1:89:f9:1f:ce (unknown)

# macchanger --mac=01:23:45:67:89:AB eth1

Current MAC: 00:40:96:43:87:65 [wireless] (Cisco/Aironet 4800/340)
Faked MAC: 01:23:45:67:89:ab (unknown)

# ./macchanger --list=Cray

Misc MACs:
Num MAC Vendor
— — ——
065 - 00:00:7d - Cray Research Superservers,Inc
068 - 00:00:80 - Cray Communications
(formerly Dowty Network Services)
317 - 00:40:a6 - Cray Research Inc.

Here is the list of available options for MAC Changer

-h, -help

Show summary of options.

-V, -version

Show version of program.

-e, -endding

Don’t change the vendor bytes.

-a, -another

Set random vendor MAC of the same kind.

-A Set random vendor MAC of any kind.

-r, -random

Set fully random MAC.

-l, -list[=keyword]

Print known vendors (with keyword in the vendor’s description string)

-m, --mac XX:XX:XX:XX:XX:XX

Set the MAC XX:XX:XX:XX:XX:XX

If you completed the your MAC address changes you need to start the networking service using the following command

For Debian Users

#/etc/init.d/networking start

For Ubuntu Users

sudo /etc/init.d/networking start