Auteur : admin

Python api to priceminister webservice

If you need to manage sells on Priceminister, you can now use Shiba, the brand new python API designed by my team.

Publié dans dev, python

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 : , , , ,

Finding unused index on postgresql 9

Just use this query on you database and find unwanted indexes :   SELECT t.tablename, indexname, c.reltuples AS num_rows, pg_size_pretty(pg_relation_size(quote_ident(t.tablename)::text)) AS table_size, pg_size_pretty(pg_relation_size(quote_ident(indexrelname)::text)) AS index_size, CASE WHEN x.is_unique = 1 THEN 'Y' ELSE 'N' END AS UNIQUE, idx_scan AS number_of_scans,

Publié dans postgresql, sql Tagués avec : , ,

Postgresql : How to add an index on a computed column

Postgresql offers a great way to add computed column, but do you know there is a way to index those columns ?   CREATE INDEX your_table_ix ON your_table USING btree (computed_column_name(your_table.*)   Notice that the computed column has to be

Publié dans postgresql, sql Tagués avec : ,

reset pgagent jobs

Here is the brutal method to reset jobs from a restart fails of postgresql pgAgent delete from pgAgent.pga_jobagent; delete from pgAgent.pga_joblog; delete from pgAgent.pga_jobsteplog;

Publié dans sql 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 : , , ,

Shuffle a Java Vector

A good way to shuffle a Java vector : Collections.shuffle(allPartenaires);

Publié dans dev, java Tagués avec :

Missing « publish » button in wordpress

I recently had a small issue with every wordpress blog I host on my dedicated EC2 cluster (Mysql + nginx + php) : The « Publish » button was missing. There only was a « Submit to review » button , but nothing else

Publié dans bug, tips 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 : ,