Étiquette : linux

Doing some ec2 stuff (webservices) in crontab

Just add those lines in front of your crontab file :   PATH=/usr/local/bin:/bin:/usr/bin:/usr/local/sbin:/usr/sbin:/sbin:/opt/aws/bin:/home/ec2-user/bin EC2_HOME=/opt/aws/apitools/ec2 JAVA_HOME=/usr/lib/jvm/java

Publié dans amazon, centos, ec2, linux, tips Tagués avec : , , , ,

How to install postgresql multicorn extension on debian 7.1

First we need pgxnclient sudo aptitude install pgxnclient Then, for building multicorn, we need several tools sudo aptitude install postgresql-server-dev-all make python-dev python-setuptools Then we can build the pgsql extension sudo pgxn install multicorn –testing –verbose Finally, you can install extension on your

Publié dans debian, linux, sql Tagués avec : , , ,

How to count number of new line in a log file per seconds

Here is a good way to count number of new line in a log file per seconds in linux command line   tail -f /var/log/logfile | grep something | perl -e 'while (<>) {$l++;if (time > $e) {$e=time;print "$l\n";$l=0}}'  

Publié dans linux, tips Tagués avec : , ,

How to redirect root base tld to www.tld with nginx

You have to add those lines in your /etc/nginx/sites-enables/tld server { server_name tld; rewrite ^(.*) http://www.tld $1 permanent; } Then reloads nginx sudo /etc/init.d/nginx reload

Publié dans linux, nginx Tagués avec : ,

Restart buggy Hamachi

If you have something like : [root@plebidev ~]# hamachi start 11 16:33:53.707 [ 0] [ 2185] tap: connect() failed 2 (No such file or directory)   when you try to launch hamachi daemon, juste type as root : tuncfg

Publié dans linux, tips Tagués avec : , ,

How to find your own ip easily / server side

Tiny tips : wget -qO- http://checkip.dyndns.com/ This could be easily adapted to be well printed, but I’m lazy 😉

Publié dans linux, tips Tagués avec : , ,

Get CentOs version

That’s so simple cat /etc/redhat-release   My pleasure 🙂

Publié dans centos, linux Tagués avec : ,

Delete every mail from postqueue/mailq based on a « to: » domain name

Here is the little funy command line postqueue -p | tail -n +2 | awk 'BEGIN { RS = "" } / .*@hotmail\.com$/ { print $1 }' | tr -d '*!' |postsuper -d – Where hotmail is the tld you

Publié dans mail, posstfix Tagués avec : , , ,