Fixing postfix / postdrop / sendmail “warning: File too large”.

Hi there!

I have found this in my server logs after trying to send VERY large file using the LAN mail:

Jun 11 09:35:39 icsserver.loc postfix/postdrop[2839]: warning: uid=0: File too large
Jun 11 09:35:40 icsserver.loc postfix/sendmail[2837]: fatal: root(0): message file too big

Fix is easy. Set unlimited attachment size. How?

Gain root and run those commands:

postconf -e mailbox_size_limit=0
postconf -e message_size_limit=0

and then restart postfix with this command:

systemctl restart postfix

Cheers.

Andrzej

My method of backing up MySQL database under my Arch Linux server (coz I didn’t like the SloniuPL’s one).

Hi there!

I didn’t like SloniuPL’s method of backing up MySQL database so I wrote my own. Simpler. Nicer. Easier.

I wrote a script: /root/.bin/MySQL_BackUP.sh.

Which contains:

date &&
echo "Compressing /var/lib/mysql/ into a /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar file" &&
tar cfP /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar /var/lib/mysql/ &&
echo "What's the size of the /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar file?" &&
du -h /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar &&
date &&
echo "Compressing echo /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar into /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar.xz file." &&
xz -f --compress -9 /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar &&
date &&
echo "What's the size of the /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar.xz file?" &&
du -h /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar.xz &&
echo "Mailing the /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar.xz file to andrzejl@icsserver.loc." &&
date &&
echo "MySQL Database Backup `date +%m-%d-%Y`!" | /bin/mail -s "MySQL Database Backup `date +%m-%d-%Y`!" -a /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar.xz andrzejl@icsserver.loc &&
echo "Removing the /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar.xz file." &&
rm /home/andrzejl/MySQL_Database_Backup_`date +%m-%d-%Y`.tar.xz &&
echo "MySQL Database Backup finished!" &&
date

and it does exactly what it says on the box…

Wed Jun 11 07:14:45 IST 2014
Compressing /var/lib/mysql/ into a /home/andrzejl/MySQL_Database_Backup_06-11-2014.tar file
What’s the size of the /home/andrzejl/MySQL_Database_Backup_06-11-2014.tar file?
155M /home/andrzejl/MySQL_Database_Backup_06-11-2014.tar
Wed Jun 11 07:14:52 IST 2014
Compressing echo /home/andrzejl/MySQL_Database_Backup_06-11-2014.tar into /home/andrzejl/MySQL_Database_Backup_06-11-2014.tar.xz file.
Wed Jun 11 07:17:01 IST 2014
What’s the size of the /home/andrzejl/MySQL_Database_Backup_06-11-2014.tar.xz file?
7.1M /home/andrzejl/MySQL_Database_Backup_06-11-2014.tar.xz
Mailing the /home/andrzejl/MySQL_Database_Backup_06-11-2014.tar.xz file to andrzejl@icsserver.loc.
Wed Jun 11 07:17:02 IST 2014
Removing the /home/andrzejl/MySQL_Database_Backup_06-11-2014.tar.xz file.
MySQL Database Backup finished!
Wed Jun 11 07:17:02 IST 2014

AndrzejL_ArchLinux_MySQL_Database_BackUp_Method_001.png

AndrzejL_ArchLinux_MySQL_Database_BackUp_Method_002.png

AndrzejL_ArchLinux_MySQL_Database_BackUp_Method_003.png

And then I have edited my crontab so it looks like this:

0 */6 * * * /root/.bin/MySQL_BackUP.sh

This way I have a fresh and funky database snapshot every 6 hours…

After tiny modifications this script can be used to create a snapshot of any folder and send it to as many recipients and as often as You wish…

That’s what I call backup… and yes I am aware of the fact that it WOULD be best to stop the MySQL server before You will create a backup in case there is some writing going on*… and yes I am aware that mysqldump will create the .tar.gz file for me too… but this is a low profile home server and not some huge corporate database… You like it? Great. You want to use it? Copy script. Modify it. Use it. You have my blessing. I don’t give any warranties. It works for me. I don’t provide support so don’t even ask ;).

Cheers.

Andrzej

PS. * IF * the database is being written to while the backup starts it will not finish backing up:

tar: /var/lib/mysql/ib_logfile0: file changed as we read it

so broken / partially written database in the backup file _shouldn’t_ happen.

Block annoyances on Twit.tv using Adblock Plus.

Block annoyances on Twit.tv using Adblock Plus.

Depending on Your preferences use the filters below to block certain parts of the site.

1) Block background image:

twit.tv/sites/all/themes/plink/twit2011/img/page-back.jpg

2) Block header:

twit.tv##div#header.region-header.container-12.clearfix

3) Block entire Slideshow player + Schedule + Live Streams + Most recent episodes part:

twit.tv##div#preface-first.region-preface_first.container-12.clearfix

4) Block JUST the slideshow player plus its shadow and its controls:

twit.tv##div#views_slideshow_cycle_teaser_section_home_slideshow-block.views_slideshow_cycle_teaser_section

twit.tv##div.views-slideshow-controls-bottom.clear-block

twit.tv/sites/all/themes/plink/twit2011/img/player-shadow.png

5) Block Latest Posts:

twit.tv##div#homebox-block-panels_mini_latest_homebox.homebox-portlet.homebox-unclosable.clearfix.block.block-panels_mini.homebox-override-processed.homebox-processed

6) Block Twit Amazon:

twit.tv##div#homebox-block-panels_mini_twitpicks.homebox-portlet.homebox-draggable.homebox-unclosable.clearfix.block.block-panels_mini.homebox-override-processed.homebox-processed

7) Block footer:

twit.tv##div#footer.clearfix

Example:

I am using filters from the steps 4, 6 and 7:

Blocking_Parts_Of_Twit_TV.png

Cheers.

Andrzej

Fixing broken Firefox preferences (side menu plus a question mark in a yellow square).

Hi there.

I am using Firefox Nightly 32.0a1 and all of the sudden I have noticed this problem:

Fixing_broken_Firefox_preference_window_001.png

when trying to open the preferences…

Possibly You have the same problem. Fix it.

1) Close Firefox completely (as in all windows).
1) Open ~/.mozilla/firefox/XXXXXXXXXX.default/ where the “XXXXXXXXXX” is a random string.
2) Find and open file prefs.js in your favorite text editor.
3) Find and remove this line:

user_pref("browser.cache.memory.enable", false);

4) Save the file.
5) Reopen browser and test the preferences window.

There – that fixed it for me.

Fixing_broken_Firefox_preference_window_002.png

Cheers.

Andrzej

Block annoyances on HealthierSmoker.ie using Adblock Plus.

Block annoyances on HealthierSmoker.ie using Adblock Plus.

Add those to the filters:

www.healthiersmoker.ie##div.gray_box
www.healthiersmoker.ie##div.testimonial_wrap
www.healthiersmoker.ie/modules/homeslider/gray_pager.png
www.healthiersmoker.ie/modules/homeslider/images/*.jpg
www.healthiersmoker.ie/themes/healthiersmoker/img/slider_bg.png
healthiersmoker.ie/video/index.html

Cheers.

Andrzej

Block annoyances on Twitter using Adblock Plus

Block annoyances on Twitter using Adblock Plus

Add those to the filters:

twitter.com##*#WhoToFollow*#
twitter.com##*#cookieTooltip*#
twitter.com##*#js-recommended-followers*#
twitter.com##*#recommended-similar-users
twitter.com##*#recommended_users
twitter.com##*.Footer module
twitter.com##*.ProfileWTFAndTrends
twitter.com##*.trends
twitter.com##*.wtf-module
twitter.com##div.Footer.module.roaming-module
twitter.com##div.dashboard.dashboard-right

Cheers.

Andrzej

Google Chrome / Chromium and the self signed SSL certificates.

Hi there!

Here is a simple step by step instruction how to add self-signed SSL cert to Chrome / Chromium so it does not warn all the time.

Remember that You should use this method for PRIVATE small self hosted projects (like my site) that You trust. Don’t EVER use it to “fix” SSL Certificate issues for Your bank, ebay, paypal account etc. Those should be signed by a trusted certificate authority and they should never cause a browser to go mental like this. If a browser warns about Your banks cert being untrusted it could mean a lot of trouble.

So lets say You are seeing this each time You are visiting my site. Follow the next 20 steps to make this warning go away.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_001.png

01. Step 01.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_002.png

02. Step 02.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_003.png

03. Step 03.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_004.png

04. Step 04.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_005.png

05. Step 05.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_006.png

06. Step 06.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_007.png

07. Step 07.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_008.png

08. Step 08.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_009.png

09. Step 09.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_010.png

10. Step 10.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_011.png

11. Step 11.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_012.png

12. Step 12.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_013.png

13. Step 13.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_014.png

14. Step 14.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_015.png

15. Step 15.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_016.png

16. Step 16.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_017.png

17. Step 17.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_018.png

18. Step 18.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_019.png

19. Step 19.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_020.png

20. Step 20.

Chrome_Chromium_And_A_Self_Signed_SSL_Certificate_021.png

See? That wasnt’s so hard.

Remember that You should use this method for PRIVATE small self hosted projects (like my site) that You trust. Don’t EVER use it to “fix” SSL Certificate issues for Your bank, ebay, paypal account etc. Those should be signed by a trusted certificate authority and they should never cause a browser to go mental like this. If a browser warns about Your banks cert being untrusted it could mean a lot of trouble.

Cheers.

Andrzej

Convert .pdf file from color to grayscale with 1 command.

Hi there.

Convert .pdf file from color to grayscale with 1 command:

gs
-sOutputFile=./output.pdf
-sDEVICE=pdfwrite
-sColorConversionStrategy=Gray
-dProcessColorModel=/DeviceGray
-dCompatibilityLevel=1.4
-dNOPAUSE
-dBATCH
./input.pdf

And You’re all done. Change the input.pdf and output.pdf to your needs.

Cheers.

Andrzej

PS.

[root@wishmasus andrzejl]# which gs
/sbin/gs
[root@wishmasus andrzejl]# pacman -Q --owns /sbin/gs
/sbin/gs is owned by ghostscript 9.14-1
[root@wishmasus andrzejl]#