Skip to content

Instantly share code, notes, and snippets.

View rodesousa's full-sized avatar

rodesousa rodesousa

  • Kapelal
  • Paris
View GitHub Profile
@rodesousa
rodesousa / git.md
Last active September 30, 2016 08:19
commande git

mettre ds le même commit un add tardif

git commit --amend

###TAG

add et push

  • git tag v1.4 ou git tag -a v1.4 -m 'my version 1.4'
  • git push origin v1.5 ou git push origin --tags

remove

@rodesousa
rodesousa / elasticsearch.md
Last active May 27, 2016 08:27
Command ES !
@rodesousa
rodesousa / cmd_bash.md
Last active August 24, 2016 09:15
dl files from url with wget

wget |curl

#dl tout les tar.gz d'une page
wget -A tar.gz -r -l 1 -nd 
#dl un fichier
curl -O PATH

extraire tout les .tar.gz (mais y'a mieux)

cat *.gz | tar -xf - -i > /dev/null

sort by date

@rodesousa
rodesousa / puppet.md
Last active March 1, 2016 15:26
Commandes puppet

validate syntax

puppet parser validate

demande de certif par le node

puppet agent --waitforcert 15 --test

envoi du certif par le master

puppet cert list puppet cert sign hostname

@rodesousa
rodesousa / replication.sh
Created June 17, 2015 11:10
Replication MySQL
#!/bin/bash
# PARAM
mysql_master=<%= @DBMY_MASTER_HOST %>
user_mysql=root
password_user_mysql=<%= @USER_ROOT_DBMY_SLAVE_PASSWORD %>
replication_user=<%= @REP_USER %>
replication_password=<%= @REP_PASSWORD %>
read -p "Etes vous sur de vouloir installer la replication ? [Y/N]" -n 1 -r
#/bin/bash
exclude="log\|other"
for directory in `find * -maxdepth 0 -type d`
do
if [[ "`echo $directory | grep \"$exclude\"`" == "" ]]
then
echo "### repo $directory =>"
cd $directory
git "$@"