Skip to content

Instantly share code, notes, and snippets.

View MickaelBergem's full-sized avatar
🚀

Mickaël MickaelBergem

🚀
View GitHub Profile

Keybase proof

I hereby claim:

  • I am MickaelBergem on github.
  • I am mickaelbergem (https://keybase.io/mickaelbergem) on keybase.
  • I have a public key whose fingerprint is 7B5F 5866 97C0 96C7 0D5B 787B 7538 871D A7A3 2A62

To claim this, I am signing this object:

@MickaelBergem
MickaelBergem / gist:d710c5b3cd917035d183
Created December 4, 2014 14:50
Moving PostgreSQL tables from a database to another

Copies only the data, assuming the tables are empty (TRUNCATE).

Source database :

pg_dump -a -U bnpipflux bnpipfluxdb | gzip > dump-prod-DD-MM-YYYY.sql

Destination database :

@MickaelBergem
MickaelBergem / git-clean-merged-branches
Last active August 29, 2015 14:11
Remove all local branches that have been merged
# Will remove all merged branches, except the current one.
git remote prune origin && git branch --merged | grep -v "\*" | xargs -n 1 git branch -d
@MickaelBergem
MickaelBergem / favicon.md
Last active August 29, 2015 14:11
Favicon code
<link rel="icon" type="image/png" href="logo.png" />

or

<link rel="icon" href="favicon.ico" />
@MickaelBergem
MickaelBergem / local-cache-pip-install.conf
Last active August 29, 2015 14:12
Cache the pypi packages (pip install...) in a local folder
# In ~/.pip/pip.conf
[global]
download_cache = ~/.cache/pip
@MickaelBergem
MickaelBergem / mysql-export-csv.sql
Created February 10, 2015 18:58
Export MySQL results to a CSV file
SELECT order_id,product_name,qty
FROM orders
INTO OUTFILE '/tmp/orders.csv'
FIELDS TERMINATED BY ','
ENCLOSED BY '"'
LINES TERMINATED BY '\n';
#!/usr/bin/python3
import requests
import string
import random
# The URL on which we should be after submitting the form
URL_POST = 'http://priveservicetemporaire.fr/formmail.php'
URL_END = 'http://priveservicetemporaire.fr/merci.html'
EXPECTED_MESSAGE = b'Merci pour votre attention, Votre adresse a \xe9t\xe9 mis \xe0 jour.'
@MickaelBergem
MickaelBergem / .gitconfig
Last active October 30, 2015 13:10
GitConfig Dotfiles
[user]
name = ..
email = ..
[core]
editor = nano
excludesfile = ~/.gitexcludes
[push]
default = current
[pull]
default = current
@MickaelBergem
MickaelBergem / owncloud-docker-compose.yml
Created August 26, 2015 23:36
`docker-compose.yml` file for setting up an ownCloud server using a PostgreSQL database
# Composition of the containers
owncloud:
image: owncloud
ports:
- 80:80
volumes_from:
- owncloud-data
links:
- postgres:owncloud-db
@MickaelBergem
MickaelBergem / owncloud-docker-compose.yml
Last active August 22, 2021 23:41
Docker Compose file for setting up an ownCloud server using a PostgreSQL database
# Composition of the containers
owncloud:
image: owncloud
ports:
- 80:80
volumes_from:
- owncloud-data
links:
- postgres:owncloud-db