Getting all possible BaSH commands

In BaSH pressing tab twice gives all possible commands for BaSH.

Try it , Learn and Enjoy

If you want to get all commands in any editor give the following script..

IFS=’:'; for i in `echo $PATH`; do echo $i|xargs ls; done >/tmp/commands.txt

it will save in the  /tmp directory.

Open it using your favourite editor…like  gedit /tmp/commands.txt


Leave a Comment

Reset your local wordpress password easily

If you forget  your wordpress password then what can you do?

Answer is here…………….Two easy methods

First Method

start mysql and login
SELECT ‘wordpress’ //this should be your database name
UPDATE `wp_users` SET `user_pass` = MD5( ‘password’ ) WHERE `ID` =1 LIMIT 1 ;

where password is your new password. Your password is reset, for the admin acount.

Second Method

Using Phpmyadmin……

By using phpmyadmin find out the wp-user table and admin user .

You will notice the password is strange, and not plain text. This is because for security reasons, WordPress stores the passwords as an MD5 hash.

We can’t just enter a normal text password, and should replace the MD5 hash of the password we don’t know with the MD5 hash of a password we do know.

To create an MD5 hash, I usually just search for “online MD5 hash” on Google, and come up with some great online tools for creating the result I need.

Example: Javacript MD5

n such tools, I enter what I want the password to be, click a button to process it, and it spits out the MD5 hash that I want to enter in the user_pass field.

Click Go to save the change, and then log in to WordPress using your new password.

Enjoy

Leave a Comment

To get system information in linux

open a termianl and type the command

cat /proc/cpuinfo > yourname.txt

Then you will get only system hardware information ,

If you want to get the full system information, copy the below given script to a text file and give a name, for example gethwinfo.sh

#!/bin/bash
#
# Scrip to output specific hardware configuration to the file hardware-info.txt
# in your home directory.
# 11.Sep.2007 – SPACE
# This program is a Free Software Licenced under GNU General Public License Version 3.0
# copyright 2007 Raj Mohan <rmohan@space-kerala.org>
CAT=/bin/cat
FREE=/usr/bin/free
DMIDECODE=/usr/sbin/dmidecode
FDISK=/sbin/fdisk
LSPCI=/bin/lspci
GREP=/bin/grep
EGREP=/bin/egrep
ECHO=/bin/echo
MV=/bin/mv
RM=/bin/rm
CUT=/usr/bin/cut
HEAD=/usr/bin/head
DMESG=/bin/dmesg
OUTFILE=${PWD}/hardware-info.txt
TMPFILE=/tmp/hardware-info.tmp
DMIOUTFILE=/tmp/dmi.out
CDROMOUTFILE=/tmp/cdrom.out

if [ -f ${TMPFILE} ]
then
$RM ${TMPFILE}
fi

if [ -f ${DMIOUTFILE} ]
then
$RM ${DMIOUTFILE}
fi

if [ -f ${CDROMOUTFILE} ]
then
$RM ${CDROMOUTFILE}
fi

$ECHO “CPUINFO” > ${TMPFILE}
$ECHO “——-” >> ${TMPFILE}
$CAT /proc/cpuinfo | $EGREP “vendor-id|model name|MHz” >> ${TMPFILE}
$ECHO >> ${TMPFILE}

$ECHO “MEMORY” >> ${TMPFILE}
$ECHO “——” >> ${TMPFILE}
$FREE -m >> ${TMPFILE}
$ECHO >> ${TMPFILE}

$ECHO “Desktop Management Information” >> ${TMPFILE}
$ECHO “——————————” >> ${TMPFILE}
$DMIDECODE -t 17 |$GREP Size |$GREP -v No >> ${DMIOUTFILE}
cnt=1
while read line
do
$ECHO “Memory module ${cnt} -> ${line}” >> ${TMPFILE}
let cnt=cnt+1
done < ${DMIOUTFILE}
$RM ${DMIOUTFILE}
$ECHO >> ${TMPFILE}

$ECHO “Disk Devices” >> ${TMPFILE}
$ECHO “————” >> ${TMPFILE}
$FDISK -l | $GREP Disk >> ${TMPFILE}
$ECHO >> ${TMPFILE}

$DMESG |$EGREP “ROM|CD-R/RW|DVD” | $GREP -v Uniform > ${CDROMOUTFILE}
if [ $? -eq 0 ]
then
$ECHO “CD ROM” >> ${TMPFILE}
$ECHO “——” >> ${TMPFILE}
pre=”"
while read line
do
curr=`$ECHO $line | $CUT -d\ -f1`
if [ "${curr}" != "${pre}" ]
then
$ECHO $line >> ${TMPFILE}
pre=$curr
fi
done < ${CDROMOUTFILE}
$ECHO >> ${TMPFILE}
fi
$RM ${CDROMOUTFILE}

$ECHO “VGA card” >> ${TMPFILE}
$ECHO “——–” >> ${TMPFILE}
$LSPCI | $GREP VGA >> ${TMPFILE}
$ECHO >> ${TMPFILE}

$ECHO “Audio card” >> ${TMPFILE}
$ECHO “———-” >> ${TMPFILE}
$LSPCI | $GREP Audio >> ${TMPFILE}
if [ $? -eq 1 ]
then
$ECHO “No Audio card detected” >> ${TMPFILE}
fi
$ECHO >> ${TMPFILE}

$ECHO “Modem card” >> ${TMPFILE}
$ECHO “———-” >> ${TMPFILE}
$LSPCI |$GREP Modem >> ${TMPFILE}
if [ $? -eq 1 ]
then
$ECHO “No intenal modem card detected” >> ${TMPFILE}
fi
$ECHO >> ${TMPFILE}

$ECHO “Network Interface Card” >> ${TMPFILE}
$ECHO “———————-” >> ${TMPFILE}
$LSPCI |$GREP Ethernet >> ${TMPFILE}
STATUS1=$?

$ECHO >> ${TMPFILE}
$LSPCI |$GREP Network >> ${TMPFILE}
STATUS2=$?
if [ $STATUS1 -eq 1 ] && [ $STATUS2 -eq 1 ]
then
$ECHO “No Network controller detected” >> ${TMPFILE}
fi

$ECHO >> ${TMPFILE}
$ECHO “Detailed PCI information follows:” >> ${TMPFILE}
$ECHO “———————————” >> ${TMPFILE}
$LSPCI >> ${TMPFILE}

$MV ${TMPFILE} ${OUTFILE}

After that give permision to that file, for that,

type the command chmod 764 gethwinfo.sh in to a terminal.

type the command sudo ./gethwinfo.sh

One file named hardware-info.txt is created in the home directory or on the Desktop.

thanks in advance….

Leave a Comment

How to dump a mysql database as a bzip file?

Use this command:

mysqldump -u <username> -p<password> -q <database> | bzip2 -c > filename.sql.bz2

Leave a Comment

How to set default character set as UTF8 when importing a mysql database?

Normally, when importing a mysql database default character set will be UTF8. If not,
we can set it manually with the below methods….

1. mysql -u <username> -p –default_character_set ‘utf8′ databasename < database.sql(exported database).

2. if you are using a compressed file, then use…
1. If bzip2:
bzip2 -cd <database.bz2> | mysql –host=localhost –user=<username> -p<password> –default_character_set ‘utf8′ <database name>

This can be done easily by using phpmyadmin.When importing a database just select UTF8 from the below select box named ‘character set of the file’.

Leave a Comment

How to delete or drop all tables from a mysql database?

We can drop tables using the query “droptable table name;”. We van do it only one by one.So this is impractical when there is lot of tables. In such situation we can use the below given command:

mysql -u <username> -p<password> <database name> -e “show tables” | grep -v Tables_in | grep -v “+” | \gawk ‘{print “drop table ” $1 “;”}’ | mysql -u <username> -p<password> <database name>

Commonly arising problems:

1. gawk(Gnu awk): you must install this module.gawk is a pattern cheking language.
2. If you give password with this command(in the place of <password> you may avoid the space between -p and password.

Leave a Comment

Input format activation in Drupal 6

In Drupal 6, the Php filter is not enabled by default. You need to go to the admin/build/modules page and enable the Php Filter module. It will then automatically create the Php input filter.

After activating this module you will get the option Php format

Leave a Comment

Malayalam reading in Firefox

Firefox will read all the unicode fonts without any problem..

But some times it will not render some proprietary fonts such as manorama, karthika, tikkana, hemalatha etc. They are dynamic fonts.

In such situation , here we have an extension in firefox called Padma. We will get it as an add-on of firefox.

Method of installation:

1. Click tools menu of firefox and select add-ons.

2. Then get extensions –>browse all add-ons.

3. search for padma and add it to firefox.

4. restart your firefox.

5. Now you solved your problem….

Leave a Comment

Malayalam in Open office in windows

Some times in windows openoffice cannot render malayalam correctly. In such situations do the following …

1. open the particular opeonoffice application such as openofice org or calc etc.

2. Click the menu tools and select options.

3. Then language settings , click language.

4. Then in the right side bottom you can see a check box enabled for complex text layouts(CTL)

5. Now enabled the CTL select box and select malayalam from this select box.

Now you completed the settings and can use malayalam comfortly

Leave a Comment

Configuring Malayalam in Debian and IT@School

Debian and IT@School

For Debian and IT@School there is available a patch for enabling malayalam naming ml-debian developed by SPACE-KERALA, an organization standing for free software promotion. You can easily download this patch from malayalam.kerala.gov.in , Kerala govt’s official website developed for malyalam computing project.

Steps(by default you will get the inscript layaout)

1. Download this patch, this is an .iso file.

2. write this .iso file in to a cd

3. insert cd in to cd drive and take synaptic package manager from the system menu.

4. From the edit menu select add cdrom option , then they will ask to insert the cd … then insert the cd and click yes button. Then it will ask to insert another cd in tio the drive if you want. Now you dont need this ..so click no.

5. Then click reload button on the left side of the top panel.Now you can see the reloading steps.

6. After that from the software list you can search the patch ml-debian , then right click on the left square button and click mark for installation , then click mark.

7. Then click the apply button on the top panel. Again apply on the next window.

8. Now you complete your installation steps.

For Phonetic(manglish)

1. From the software list in the synaptic package manager select the patch ml-phonetic-debian and install with the method explained above.

2. Then install SCIM package with the same above method.

3. After that you will need to restart the system.

4. Then you can find a keyboard symbol on the top panel of the desktop.

5. Right click on this symbol , then click SCIM setup then click Global Setup under the IME Engine.

6. Then tick the languages you want to use.

Now you complete the settings for your malayalam usage.

For making tthese more simple we have to do some more things.

Selecting keyboard layout

1. Right click on the desktop top panel and click add to panel.

2. select keyboard indicater. Now you can see USA on the panel.

3. Right click on the USA button and select keyboard prefferences.

4. Then click layouts then add then India , under India select malayalam.

5. Close the screens and on the desktop click the USA button now it will change to India. This is the method for toggling the keyboard layouts.

Shortcut keys

1. For togling keyboard layouts—->press both alt keys simultaneously( this is default , you can change it from the settings).

2. For starting SCIM , press control+space bar

Leave a Comment

Older Posts »