image_pdfimage_print

Aws-Amazon : Install ses tools pada instance ( ubuntu, amazon, centos, other distro )

Setelah menyelesaikan verifikasi sender maka sekarang saya ingin mencoba smpt relay ses mengunakan postfix. Langkah-langkahnya sebagai berikut :

Pertama kita membutuhkan dukungan perl script untuk linux dan kita juga butuh data key dan script  credentials-key dan ses perl script.

jika anda sudah membuat credentials key maka anda bisa membuat aws-credentials file :

AWSAccessKeyId=0ASDASKJJ334QSWDA09
AWSSecretKey=jKasdgteasdt4+aksh39044tAhf82

kemudian kita bisa test script dengan perintah :

$ ./ses-get-stats.pl -k aws-credentials -s

jika tidak berhasil bisa mencoba dengan /full/path/to/aws-credentials. Untuk mengecek email yang sudah di verified:

$ ./ses-verify-email-address.pl -k aws-credentials --verbose -v verified@example.com

Continue reading “Aws-Amazon : Install ses tools pada instance ( ubuntu, amazon, centos, other distro )” »

IF expresion pada Bash / Shell script

Primary expressions

Primary Meaning
[ -a FILE ] True if FILE exists.
[ -b FILE ] True if FILE exists and is a block-special file.
[ -c FILE ] True if FILE exists and is a character-special file.
[ -d FILE ] True if FILE exists and is a directory.
[ -e FILE ] True if FILE exists.
[ -f FILE ] True if FILE exists and is a regular file.
[ -g FILE ] True if FILE exists and its SGID bit is set.
[ -h FILE ] True if FILE exists and is a symbolic link.
[ -k FILE ] True if FILE exists and its sticky bit is set.
[ -p FILE ] True if FILE exists and is a named pipe (FIFO).
[ -r FILE ] True if FILE exists and is readable.
[ -s FILE ] True if FILE exists and has a size greater than zero.
[ -t FD ] True if file descriptor FD is open and refers to a terminal.
[ -u FILE ] True if FILE exists and its SUID (set user ID) bit is set.
[ -w FILE ] True if FILE exists and is writable.
[ -x FILE ] True if FILE exists and is executable.
[ -O FILE ] True if FILE exists and is owned by the effective user ID.
[ -G FILE ] True if FILE exists and is owned by the effective group ID.
[ -L FILE ] True if FILE exists and is a symbolic link.
[ -N FILE ] True if FILE exists and has been modified since it was last read.
[ -S FILE ] True if FILE exists and is a socket.
[ FILE1 -nt FILE2 ] True if FILE1 has been changed more recently than FILE2, or if FILE1 exists and FILE2 does not.
[ FILE1 -ot FILE2 ] True if FILE1 is older than FILE2, or is FILE2 exists and FILE1 does not.
[ FILE1 -ef FILE2 ] True if FILE1 and FILE2 refer to the same device and inode numbers.
[ -o OPTIONNAME ] True if shell option “OPTIONNAME” is enabled.
[ -z STRING ] True of the length if “STRING” is zero.
[ -n STRING ] or [ STRING ] True if the length of “STRING” is non-zero.
[ STRING1 == STRING2 ] True if the strings are equal. “=” may be used instead of “==” for strict POSIX compliance.
[ STRING1 != STRING2 ] True if the strings are not equal.
[ STRING1 < STRING2 ] True if “STRING1” sorts before “STRING2” lexicographically in the current locale.
[ STRING1 > STRING2 ] True if “STRING1” sorts after “STRING2” lexicographically in the current locale.
[ ARG1 OP ARG2 ] “OP” is one of -eq, -ne, -lt, -le, -gt or -ge. These arithmetic binary operators return true if “ARG1” is equal to, not equal to, less than, less than or equal to, greater than, or greater than or equal to “ARG2”, respectively. “ARG1” and “ARG2” are integers.

Continue reading “IF expresion pada Bash / Shell script” »

Melihat aktif query pada postgresql

Saya lagi iseng-iseng mau lihat query sekarang ini apa ya di postgresql trus saya coba beberapa sql query yang menselect pg_stat_activity. Tapi setelah query itu berjalan kog current query ga muncul ya? ternyata saya belum aktifkan di postgres.conf nya.

pertama set/uncomment postgres.conf

stats_command_string = true

kemudian reload database, setelah itu coba select kembali pg_stat_activity.

SELECT datname,procpid,current_query FROM pg_stat_activity

dan untuk postgresql 8.2

SELECT datname,usename,procpid,client_addr,waiting,query_start,current_query FROM pg_stat_activity ;

selamat mencoba…