Category: General information

General information

How to delete MySQL command line history

How to delete MySQL command line history

Introduction – On Unix or Linux system, the MySQL client writes a record of executed statements to a history file. By default, the history file is named .mysql_history and is created in your home directory. To specify a different file, set the value of the MYSQL_HISTFILE environment variable.

root@arunbagul:~# ls -l /root/.mysql_history
-rw——- 1 root root 71 2008-03-18 17:25 /root/.mysql_history
root@arunbagul:~#

root@arunbagul:~# cat /root/.mysql_history
show databases;
select * from databases;
show status;
show variables;
root@arunbagul:~#

If you do not want to maintain a history file, first remove .mysql_history if it exists, and then use either of the following techniques:

  • Set the MYSQL_HISTFILE variable to /dev/null. To cause this setting to take effect each time you log in, put the setting in one of your shell’s startup files.
  • Create .mysql_history as a symbolic link to /dev/null
  • ln -s /dev/null $HOME/.mysql_history

How to set Environment variable –

root@arunbagul:~# export MYSQL_HISTFILE=/dev/null

root@arunbagul:~#

** Please add about command in .bashrc file in your home directory so that this variable will be set to /dev/null value every time you lonin ..

root@arunbagul:~# cat /root/.bashrc
root@arunbagul:~#
Check the environment variable –

root@arunbagul:~# echo $MYSQL_HISTFILE
/dev/null
root@arunbagul:~#

NOTE- It’s not secure to save all executed mysql command to $HOME/.mysql_history file!!

Regards,

Arun Bagul

IPv6 -Internet Protocol version 6

IPv6 -Internet Protocol version 6

Introduction – IPv6 is the Network or Internet Layer protocol in ISO/OSI or TCP/IP model. It is designated as the successor of IPv4, the current version of the Internet Protocol. IPv6 address space is extremely large. For example, IPv6 supports 2128 (about 3.4×1038) addresses, or approximately 5×1028 addresses for each of the roughly 6.5 billion people alive today. IPv4 uses 32-bit addresses (4 billion addresses) while IPv6 uses 128-bit addresses (3.4×1038 addresses). Although adoption of IPv6 has been slow due to many reasons… Most transport- and application-layer protocols need little or no change to work over IPv6; exceptions are applications protocols that embed network-layer addresses such as FTP or NTP.

  • The main feature of IPv6 that is driving adoption today is the larger address space.
  • IPv6 hosts can be configured automatically when connected to a routed IPv6 network using ICMPv6 router discovery message.
  • Multicast is part of the base specifications in IPv6
  • IPsec – the protocol for IP network-layer encryption and authentication, is an integral part of the base protocol suite in IPv6.

How to write IPv6 –

IPv6 addresses are normally written as eight groups of four hexadecimal digits, where each group is separated by a colon same as IPv4. like 2001:0db8:0000:0000:0000:0000:1428:57ab

::1/128 — the loopback address is a localhost address.

IPv6 addresses can be split into network and host parts using subnet masks- 128 bit number of bits are separated into a network part (upper 64 bits) and a host part (lower 64 bits), to facilitate auto-configuration.

root@arunbagul:~# ping6 ip6-localhost
PING ip6-localhost(ip6-localhost) 56 data bytes
64 bytes from ip6-localhost: icmp_seq=1 ttl=64 time=0.040 ms
………………………………..
— ip6-localhost ping statistics —
4 packets transmitted, 4 received, 0% packet loss, time 2997ms
rtt min/avg/max/mdev = 0.035/0.037/0.040/0.004 ms
root@arunbagul:~#

Thank you,

Arun

How to installed Internet Explore(IE) on Linux/Unix !!

How to installed Internet Explore(IE) on Linux/Unix !!

Introduction – Why we have to install Internet Explore (IE) on Linux/Unix? Those who are working in web development, they need IE for checking web site compatibility with IE. For checking the site on IE they don’t have separate machine, Infact they don’t need separate PC. Even they want to use Linux only as they can’t migrate to other OS!

Let’s try to install IE –

Step(1) Add repository to download packages and dependency to install IE

root@arunbagul:~# vi /etc/apt/sources.list
root@arunbagul:~#

Add or uncomment (if they exist) following lines in /etc/apt/sources.list file –

 deb http://us.archive.ubuntu.com/ubuntu edgy universe
 deb http://wine.budgetdedicated.com/apt edgy main

root@arunbagul:~# tail /etc/apt/sources.list

………..

## for IE
deb http://us.archive.ubuntu.com/ubuntu edgy universe
deb http://wine.budgetdedicated.com/apt edgy main

root@arunbagul:~#

Note – If you using Ubuntu Dapper, replace edgy with dapper and Ubuntu Feisty users, replace edgy with feisty , while adding repository in /etc/apt/sources.list file.

Step(2) Now update your Debian/Ubuntu system and install Wine package –


root@arunbagul:~# apt-get  update
......
...........
root@arunbagul:~#

root@arunbagul:~# apt-get install wine cabextract
Reading package lists... Done
Building dependency tree
Reading state information... Done
After unpacking 106MB of additional disk space will be used.
Do you want to continue [Y/n]? Y
.........
root@arunbagul:~#

NOTE- Cabextract is a program which unpacks Microsoft windows cabinet (.cab) files. This cabinet files are used by Microsoft windows for archiving software packages.

What is Wine ? – Wine is the open source software, which provides “Windows compatibility layer for Linux“. Wine does not require MS Windows, but it can use native system dll files in place of its own if they are available. This package includes a program loader, which allows unmodified Windows binaries to run under compatible hardware. This package also includes the library that implements the Wine project’s free version of the Windows API, allowing successful running of programs ported directly from Windows.

Step(3) Download IE4 for Linux and install –

root@arunbagul:~# wget http://www.tatanka.com.br/ies4linux/downloads/ies4linux-latest.tar.gz
......
root@arunbagul:~#
root@arunbagul:~#tar zxvf ies4linux-latest.tar.gz
.....
root@arunbagul:~#
root@arunbagul:~# cd ies4linux-2.99.0.1/
root@arunbagul:~#
root@arunbagul:~#sh ies4linux
.......
root@arunbagul:~#

Cheers!! enjoy IE4 on Linux…

Thank you,

Arun Bagul

File Descriptor error while mounting proc file system

File Descriptor error while mounting proc file system

Introduction-

One day I was just playing with device files in /dev directory. While next reboot I met a new error “Mounting proc filesystem Bad file descriptor No such partition found …” I have no idea why this is happening! I stuck with this problem for two days and with lot of search on internet I found that this is due to /dev/null is modifed as “regular file“!! To fix this, I login in to rescue mode and then remounted the root(/) file system as read-write and restore the /dev/null file!

bash-arun~# mount -n -o remount,rw /
bash-arun~#
bash-arun~# rm -f /dev/null

bash-arun~# mknod -m 0666 /dev/null c 1 3
bash-arun~#

That’s it!!

root@arunbagul:~# ls -l /dev/null
crw-rw-rw- 1 root root 1, 3 2008-02-29 09:22 /dev/null
root@arunbagul:~#

* As shown above the /dev/null is character device file…

command(1) mknod – this command is used to create “Block device” or “Character device” special files….

mknod [options]… NAME TYPE [MAJOR MINOR]

Options –

-m, –mode=MODE
set permission mode (permission need to be numeric format)
–help display this help and exit

–version
output version information and exit

Both MAJOR and MINOR must be specified when TYPE is b, c, or u, and they must be omitted when TYPE is p. If MAJOR or MINOR begins with 0x or 0X, it is interpreted as hexadecimal; otherwise, if it begins with 0, as octal; otherwise, as decimal.

TYPE may be –

b –> create a block (buffered) special file

c, u –> create a character (unbuffered) special file

p –> create a FIFO

Example –

root@arunbagul:~# mknod /tmp/arun p
root@arunbagul:~#
root@arunbagul:~# ls -l /tmp/arun
prw-r–r– 1 root root 0 2008-04-18 23:31 /tmp/arun
root@arunbagul:~#

root@arunbagul:~# mknod -m 666 /tmp/block_device b 12 16
root@arunbagul:~#
root@arunbagul:~# ls -l /tmp/block_device
brw-rw-rw- 1 root root 12, 16 2008-04-18 23:32 /tmp/block_device
root@arunbagul:~#

Cheers,
Arun Bagul

OpenMoko – open source mobile platform

OpenMoko – open source mobile platform

Introduction –

OpenMoko is the Free and Open Source Mobile Platform. The entire OpenMoko system and application software are built using Free and Open Source Software (FOSS). On the system side,openmoko OpenMoko uses software with a tireless history of success and stability, such as the Linux kernel, the GNU C library, the X window system, and the GTK+ toolkit etc… Open source is not a new concept but for the mobile world this is an entirely new concept. OpenMoko is just taking things mobile. For mobile developers OpenMoko is the best place to start. Since OpenMoko runs libraries and components commonly found on the computer….

Neo 1973
is the first free and open source mobile by OpenMoko. The Neo Base kit contains everything the mobile application developer needs to enjoy the benefits of the first free phone.

openmoko-neo

Neo 1973 – Hardware specifications –

  • 2.8″ VGA TFT color display
  • Touchscreen, usable with stylus or fingers
  • 266MHz Samsung System on a Chip (SOC)
  • USB 1.1, switchable between Client and Host (unpowered)
  • Integrated AGPS
  • 2.5G GSM – tri band (900/1800/1900), voice, CSD, GPRS
  • Bluetooth 2.0
  • Micro SD slot
  • High Quality audio codec

Cheers,
Arun Bagul

Pluggable Authentication Modules (PAM)

Pluggable Authentication Modules (PAM)

Programs which give privileges to users must properly authenticate each user. For instance, when you log into a system, you provide your username and password, and the log in process uses this username and password to verify your identity.

Pluggable Authentication Modules (PAM) allows the system administrator to set authentication policies for PAM-aware applications without having to recompile authentication programs. PAM does this by utilizing a pluggable, modular architecture. Which modules PAM calls for a particular application is determined by looking at that application’s PAM configuration file in the /etc/pam.d/ directory.

In most situations, you will never need to alter the default PAM configuration files for a PAM-aware application. Whenever you use rpm or deb or tgz to install programs that require authentication, they automatically make the changes necessary to do normal password authentication using PAM. However, if you need to customize the PAM configuration file, you must understand the structure of this file.

Advantages of PAM

When used correctly, PAM provides the following advantages for a system administrator:

· It provides a common authentication scheme that can be used with a wide variety of applications.

· It allows great flexibility and control over authentication for both the system administrator and application developer.

· It allows application developers to develop their program without implementing a particular authentication scheme. Instead, they can focus purely on the details of their program.

Thanks

Ravi Bhure

History of UNIX

History of UNIX

In mid-1960, When American Telephone and Telegraph ( AT&T), Honeywell, General Electrical (GE) and Massachusetts Institute of Technology (MIT) embarked on massive project to delevelop an information utility. The project call MULTICS ( MULtiplexed Information and Computer Services) which was funded by DARPA ( DoD Advanced Research Project Agency).

In 1969 the MIT and AT&T decided to pull out of MULTICS project. After that Ken Thompson and Dennis Ritchie ( founder of C/C++) who were also part of MULTICS started work on new computer system (OS) based on MULTICS. They decided to call it as “UNIX“. During this time MULTICS project was continuing in Cambridge and which was coninued more than one & half decade.

In 1973, Ken Thompson rewrote most of UNIX in Ritchie’s newly invented C language. During 1978 the University of California had paid $400 to purchase UNIX with source code. Two graduate students Bill Joy and Chuck Haley of Berkeley started making significant modifcation and over the years it developed as independent computer system based on UNIX. They distributed modified UNIX as Berkeley Software Distribution (BSD). Due to licensing limitation Berkeley released modified UNIX as BSD 4.2. UNIX was trademark of AT&T and OS right at that time. They were worried about BSD UNIX popularity.

In this way the Industry was beset by two competing versions of UNIX.

  • AT&T UNIX system-V
  • Berkeley BSD 4.2

Thank you ,

Arun & Yogesh