Recover or Reinstall the GRUB Bootloader
If GRUB is overwritten or removed after installing another operating system, you can usually restore it from a Linux live USB or CD. Boot into the live Linux environment and open a terminal. In this example, the installed Linux root partition is /dev/sda2 and GRUB will be installed to /dev/sda. Change these device names to … Read more
Download Files from a Directory with wget
To download all files in the directory using WGET in Linux, the following command can be used wget -H -r –level=1 -k -p http://www.tldp.org/HOWTO/Serial-Programming-HOWTO/ -r, –recursive Specify recursive download. -l, –level=NUMBER Maximum recursion depth (inf or 0 for infinite). -k, –convert-links Make links in downloaded HTML point to local files. -p, –page-requisites Get all images, … Read more
How to Check Directory Size in Linux Using du
Get the space taken by directory for Linux OS/Unix The following command can be used to get the space taken by directory du -sh <path of the directory> [gaurav@home]$ du -sh /var/www/ 1.5G /var/www/
Shutdown Linux after pre-determined time
This is an alternative for Cron Issue the following command in terminal: /sbin/shutdown -h +300 Command Details: sudo : This is to execute the command as root, you will need the password here. /sbin/shutdown : Command to shutdown the computer. -h : This tell the shutdown command to power off i.e. halt. +300 : The … Read more
Safely Find and Delete Files in Linux with find
This is a useful tip to find and remove some files by searching recursively in a directory and sub directories This will list down all the *.tmp/*.log files find . -type f -name "*.tmp" -exec echo {} ; find . -type f -name "*.log" -exec echo {} ; This will delete down all the *.tmp/*.log files find . … Read more
How to Comment Lines in vi
How to comment all lines in VI editor ? This can be done with a using a command like ‘search and replace’ 1.Open the file in ‘vi’ editor.2.Press Escape and type :1,$s/^/##/g3.Press Enter 1,$s/^/##/g can be broken down as1: To start from 1st line $s :To end at the last line/^ : Search for the … Read more
Space taken by a schema in Oracle database
To get the space taken up by all the objects in the schema, the following query can be used select ((sum(bytes)/1024)/1024)/1024 Space_in_GB from dba_segments where owner=’SCHEMA_NAME’
Fix Half-Duplex and Full-Duplex Network Issues in Linux
From Half duplex to Full duplex in GNU/Linux This can be one of the reasons for slow network performance with Linux.one of the issues that I have faced was that the half duplex mode was selected with the network card and the network switch when the option of ‘auto negotiation’ was set to ON We … Read more
ORA-01555 Snapshot Too Old: Developer and DBA Notes
How to avoid ORA-01555 “snapshot too
old" error?
From the developer’s
perspective:
Restructure your PL/SQL code to
avoid fetching across commits that cause the ORA-01555 error.
One possible reason can be if we
leave the cursor open for fetching while
we are processing and committing data changes for a long time.