Posted by yolau
In this article I will be explaining how to backup the MBR record of a hard-drive.
The MBR record contains the partition table and bootloader.
Having a backup of the MBR is useful in case you want to copy data from an older drive to a new one or in case you want to restore data from [...]
Posted by yolau
What is the screen command?
First of all I will start by telling you what you can do using the “screen” command.
Many times as a linux sysadmin you will need to run multiple commands at once. You are probably doing this by opening multiple ssh sessions but there is a better way to do it !
Also [...]
Posted by copilas12
Hello. To dump a query to csv use this:
mysql –database=database –execute=”select a from b where a>1;” | sed ’s/\t/”,”/g;s/^/”/;s/$/”/;s/\n//g’ > filename.csv
If you enjoyed this post, make sure you subscribe to my RSS feed!
- October 3rd
- Filed under: Tips
Posted by copilas12
Hello. I want to share some helpful exim commands for large mailservers:
1. froze messages to recipient root@host.localhost.com
/usr/sbin/exiqgrep -i -r root@host.localhost.com | /usr/bin/xargs exim -Mf
2. delete frozen messages
/usr/sbin/exiqgrep -z -i | /usr/bin/xargs exim -Mrm
3. delete messages older than X hours (X in seconds)
/usr/sbin/exiqgrep -o X -i | /usr/bin/xargs exim -Mrm
4. total messages in queue
/usr/sbin/exiqgrep | /usr/sbin/exiqsumm [...]
- October 3rd
- Filed under: Tips
Posted by copilas12
Hello. I had a trouble some time ago: i wanted to dump a large table (38 million rows, 5G size) without locking the table because the website can’t go down. So, here is the mysqldump command:
mysqldump –skip-add-locks –skip-lock-tables database > database.sql
or for just a table:
mysqldump –skip-add-locks –skip-lock-tables database table > database.table.sql
Hope this help.
If you enjoyed [...]
- October 3rd
- Filed under: Tips
Posted by copilas12
Hello. I found this browsing. I think it will be helpful to post it in here.
Here it is:
adddns - Adds a DNS zone.
addfpmail - Add frontpage mail extensions to all domains without them.
addfpmail2 -Add frontpage mail extensions to all domains without them.
addnetmaskips - Add the netmask 255.255.255.0 to all IPs that have no netmask.
addnobodygrp - [...]
- October 3rd
- Filed under: Tips