unix

All posts tagged unix

Special characters to show useful information in $PS1 prompt: \h short hostname (without domain). \H long hostname. \n new line. \s shell name (like bash, sh) \t 24h format clock. \u current username. \v shell version. \w current folder. Inside PS1 we can add the output of a specific command, preferably with short output, like  PS1=$(date) We can color the prompt messages just adding  \[\033[COLORm\]. and \[\033[0m\] to stop colors to avoid colored commands. Where COLOR Read more...
When in logs show messages like: postfix/qmgr[2381]: warning: connect to transport relay: No such file or directory postfix/qmgr[2381]: warning: connect to transport relay: No such file or directory trinity last message repeated 2 times you have emails unsent and should be deleted to clean postfix and avoid those annoying messages. To do that, You can check inside /var/spool/postfix/defer and find the ID's of deferred messages (inside defer folder a simple find will work). This folder contains Read more...
  When the virtual machine requires a high-speed timer, the requirement is usually met by /dev/rtc on the host. In some circumstances, /dev/rtc is unavailable, leading to slowness in the guest. The main symptom is that the virtual machine's clock fails to keep time properly. In addition, applications that are timed by the virtual machine's clock, such as Windows menu animations, may also run slowly. Applications that don't use the timer to delay their execution run at normal speed. Note: Read more...

#to copy or backup the MBR

MBR information is stored on the first 446 bytes of a disk, to backup this information you can save it with dd to another disk, or to a file.

dd if=/dev/sda of=/dev/sdg bs=446 count=1

dd if=/dev/sda of=/path/to/a/file.mbr bs=446 count=1

 

To restore the data to its original place using our backup file:

dd if=/path/to/a/file.mbr of=/dev/sda  count=1