Skip to content

Jonas Silveira

o blog de um cientista da computação

Archive

Category: Linux

How to run PDFTK on AWS AMI Linux.

The problem is the AWS AMI Linux (amzn-ami-hvm-2016.09.1.20170119-x86_64-gp2  – ami-80086dec) doesn’t provides the libgcj, so you can’t compile PDFTK.

So you can compile it in some old OS and just manually copy the binary files to run the program.

Follow the files I compiled on a old RedHat release:

You just need to copy the compiled files to the following locations:

lrwxrwxrwx 1 root root   27 Feb 14 14:39 /usr/lib64/libgcj.so.10 -> /usr/lib64/libgcj.so.10.0.0
-rwxr-xr-x 1 root root  47M Feb 14 14:38 /usr/lib64/libgcj.so.10.0.0
-rw-r--r-- 1 root root 7.5K Feb 14 14:40 /usr/share/man/man1/pdftk.1.gz
-rwxr-xr-x 1 root root 3.9M Feb 14 14:37 /usr/bin/pdftk

Click here to download the files.

Facebooktwitterredditpinterestlinkedinmail

In this tutorial, we will see how to trigger a PHP script each time your web server is receiving some e-mails.

Link: https://www.thecodingmachine.com/triggering-a-php-script-when-your-postfix-server-receives-a-mail/

Facebooktwitterredditpinterestlinkedinmail

Found here: https://anton.logvinenko.name/en/blog/how-to-install-redis-and-redis-php-client.html

Facebooktwitterredditpinterestlinkedinmail

http://linoxide.com/linux-command/password-expire-chage-command/

Facebooktwitterredditpinterestlinkedinmail

Easy!

First, create a “Swap File”:

dd if=/dev/zero of=/var/myswap bs=1M count=2048
sudo chmod 0600 /var/myswap
mkswap /var/myswap 
swapon /var/myswap

Second, add swap to fstab:

/var/myswap   swap   swap   defaults  0 0

Found in TecAdmin.

Facebooktwitterredditpinterestlinkedinmail

I had a problem after a reboot of an AWS EC2 instance, because the server changed the hostname after reboot. Because we send millions of e-mails each hour, a lot of e-mail with sender like ‘person@ip-10-20-30-40.localdomain’ was “bounced”.

The first thing I had to do was change the hostname to correct the problem cause (solution found here). I’m using Red Hat 7 on AWS EC2 (RHEL7):

  1. Edit the file /etc/cloud/cloud.cfg.d/defaults.cfg deleting/commenting the above lines:
    hostname: myhostname
    fqdn: myhostname.mydomainname
  2. Then edit the /etc/hostname adding your hostname
  3. Run the command hostname <hostname>
    EX: hostname myhost.domain.com
  4. Restart postfix

Then I need to correct the hostname of bounced messages. Unfourtunally, change the messadges using SED doesn’t work. If you try to do this, the messasges will be moved to the “corrupt” folder. So, the sollution is do a “remap” of all senders (solution found here):

  1. Create “stmp_generic_maps parameter”:
    1. Add or uncomment the following line on /etc/postfix/main.cf:
      smtp_generic_maps = hash:/etc/postfix/generic
    2. Edit the file /etc/postfix/generic adding the “mappers”, one each line (from –> to):
      person@ip-10-20-30-40.localdomain        person@hostname myhost.domain.com
    3. Create the hash file of the mapping:
      postmap /etc/postfix/generic
    4. Reload Postfix:
      service postfix reload
  2. Wait the message “requeue” or force the message flushing (sse above).

Some instructions to deal with “bounced” messages on Postfix (found here and here):

  • Dump entire mail queue:
    mailq
  • Try to deliver a single message:
    postqueue -i E7B5114648B
  • Read a message from mail queue:
    postcat -qv BC6798D96E2
  • Flush the mail queue (try to deliver all queued messages):
    postqueue -f
  • Delete a message from queue:
    postsuper -d BC6798D96E2

Remember to read the log, on /var/log/maillog. So, a great tip is “tail -f /var/log/maillog” when you need to understand the errors and try the actions above.

 

Facebooktwitterredditpinterestlinkedinmail

Follow the Link: http://www.tecmint.com/things-to-do-after-installing-fedora-21-workstation/

Facebooktwitterredditpinterestlinkedinmail

Nice tool to customize Grub2 setting, such as sequence, add or remove options, etc: Grub Customizer.

Grub Customizer

Grub Customizer

Facebooktwitterredditpinterestlinkedinmail

Use the first command to test and the second to delete:

sudo find /tmp/ -type f -name 'ftpfile_*' -mtime +2 -exec ls -ltr {} \;
sudo find /tmp/ -type f -name 'ftpfile*' -mtime +2 -exec rm -rf {} \;
Facebooktwitterredditpinterestlinkedinmail

To configure keyboard

As superuser, edit file /etc/X11/xorg.conf.d/00-keyboard.conf, and change the item XkbModel to thinkpad60:

Option “XkbModel” “thinkpad60”

To configure Wireless

First install RPMFUSION free and nonfree.

Second: yum install kmod-ndiswrapper kmod-wl

Third: reboot

Facebooktwitterredditpinterestlinkedinmail