If you want to set timeouts for user sessions on your Linux machine, you can use the variable TMOUT. You can set a value for TMOUT in bash_profile or bashrc file.
# auto-logout if the shell session is idle for 1 hour
TMOUT=3600
~mohammed
If you want to set timeouts for user sessions on your Linux machine, you can use the variable TMOUT. You can set a value for TMOUT in bash_profile or bashrc file.
# auto-logout if the shell session is idle for 1 hour
TMOUT=3600
~mohammed
Disable directory listing using httpd.conf:
* Open your httpd.conf and look for “Options Indexes”
* Change “Indexes” to “-Indexes” if it exists.
* Or else add “Options -Indexes” as a new line
* Restart your apache webserver
Disable directory listing using .htaccess:-
* Open your .htacces file and look for “Options Indexes”
* Change “Indexes” to “-Indexes” if it exists.
* Or else add “Options -Indexes” as a new line
Regards,
Mohammed.
Best way to understand shell scripting is from examples. Find the example below to understand different options available in bash array manipulation.
You can down this script from here.
*********************************
#!/bin/bash
array=(one two three four [5]=five)
echo “Array size: ${#array[*]}”
echo “Array items:”
for item in ${array[*]}
do
printf ” %s\n” $item
done
echo “Array indexes:”
for index in ${!array[*]}
do
printf ” %d\n” $index
done
echo “Array items and indexes:”
for index in ${!array[*]}
do
printf “%4d: %s\n” $index ${array[index]}
#printf “%4d: %s\n” $index ${array[$index]}
done
*********************************
Regards,
Mohammed.
Here is a bash script to backup all MySQL databases from a remote Linux/Unix machine through rsnapshot tool. This is written to work with rsnapshot, but you should be able to modify this to run individually.
You can download the script from here.
Regards,
Mohammed.
Here is a bash script to backup all mysql databases, including mysqlcheck.
The script has the following advantages:
* It will list all databases and will dump them separately
* all backups will be stored under /root/mysql_backups/
* backups will run on a daily rotational basis over 7days
* old backups will be removed only after completing new backup processes.
* you can enable or disable mysqlcheck
* separate log files for mysqlcheck and dump processes.
* option to enable or disable email alerts on success and failure
You can download the script from here.
Regards,
Mohammed
You can find this useful information from the manpage for gpart.
The gpart may be of some help when the primary partition table was lost or destroyed but it can under no circumstances replace proper disk/partition table backups. To save the master boot record (MBR) including the primary partition table to a file type
dd if=/dev/hda of=mbr bs=512 count=1
Exchanging /dev/hda with the block device name of the disk in question. This should be done for all disks in the system. To restore the primary partition table without overwriting the MBR type
dd if=mbr of=/dev/hda bs=1 count=64 skip=446 seek=446
Warning: make sure that all parameters are typed as shown and that the disk device is correct. Failing to do so may result in severe filesystem corruption. The saved file should be stored in a safe place like a floppy disk.
~mohammed
Do you want to protect your posts/articles with passwords? It’s much simpler than Joomla method. In wordpress, you can do it in any of the following methods.
When you Edit a post, under the Publish module (next to Visibility), click on
the Edit link. Select the Password Protected box and enter the password.
When you use Quick Edit on a post, there’s a field for the password.
~mohammed