Catégorie : 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

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

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}}'  

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

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

Tagués avec : , ,

How to find your own ip easily / server side

Tiny tips : wget -qO- This could be easily adapted to be well printed, but I’m lazy 😉

Tagués avec : , ,

Get CentOs version

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

Tagués avec : ,