Skip to content

Instantly share code, notes, and snippets.

View francois-blanchard's full-sized avatar
😁

François Blanchard francois-blanchard

😁
View GitHub Profile
@francois-blanchard
francois-blanchard / README.md
Created August 17, 2018 15:27
Concat csv files in current directory (mac osx version)

Intro

This script concat all csv file (by default order) in one csv file result.csv only with first and second columns. Additional behaviour : skip 8 first lines (header) and 5 last lines (footer)

Requirements

brew install coreutils

Tips

@francois-blanchard
francois-blanchard / ip_instance.md
Last active August 24, 2020 10:20
Google cloud - Manage ip instance with gcloud
@francois-blanchard
francois-blanchard / manage_tags.md
Created December 22, 2016 10:00
Manage tags with SQL wordpress

Manage tags with SQL wordpress

List tags

SELECT name, slug, description, COUNT FROM wpbandc_terms
NATURAL JOIN wpbandc_term_taxonomy
WHERE taxonomy="post_tag"
ORDER BY name;
@francois-blanchard
francois-blanchard / keke.md
Last active December 14, 2016 00:27
Script de kéké

Script de kéké

Comment ne pas deployer en production quand on ne veux pas déployer en production

Resultat

build

1. Allez dans le menu préférence de iTerm

@francois-blanchard
francois-blanchard / round_whole_number.md
Last active October 31, 2016 11:27
[ruby] How to round float number when it's a whole number

[ruby] How to round float number when it's a whole number

# with non-integer result
>> half_days = 3
=> 3
>> days = half_days / 2.0
=> 1.5
>> format('%g', days)
@francois-blanchard
francois-blanchard / logrotate.md
Last active October 25, 2016 15:58
How to used log rotation system ?

How to used log rotation system ?

Logrotate is crontab script who execute every day.

You can look into thos directory for view any exemples : /etc/logrotate.d/

$ sudo ls -la /etc/logrotate.d/

drwxr-xr-x   2 root root 4096 Oct 25 15:50 .
@francois-blanchard
francois-blanchard / process_memory.md
Last active October 25, 2016 16:02
Display top 10 of process using memory (linux)

Display top 10 of process using memory (linux)

$ ps -ewo user,pid,\%cpu,\%mem,cmd:50,comm --sort=-pmem | head -10

Watch it

$ watch -n 1 'ps -ewo user,pid,\%cpu,\%mem,cmd:50,comm --sort=-pmem | head -10'
@francois-blanchard
francois-blanchard / debug_travis_build.md
Last active September 15, 2020 08:55
How to debug a failed travis.ci build

How to debug a failed travis.ci build

1/ Go to travais build

https://travis-ci.com/gitUser/gitRepo/builds/XXXXXX

build

2/ Connect to travis build with ssh

@francois-blanchard
francois-blanchard / stackdriver-extractor.md
Last active October 17, 2016 16:35
stackdriver-extractor
/etc/init.d/stackdriver-extractor status
/etc/init.d/stackdriver-extractor start
/etc/init.d/stackdriver-extractor stop
@francois-blanchard
francois-blanchard / adding_or_removing_apache_site.md
Created October 7, 2016 08:11
Adding and Removing Available Apache Sites in Ubuntu

Enable site

sudo a2ensite SITECONFIG.FILE

Disable site

sudo a2dissite SITECONFIG.FILE

Reload apache

sudo service apache2 reload