Skip to content

Instantly share code, notes, and snippets.

View rodesousa's full-sized avatar

rodesousa rodesousa

  • Kapelal
  • Paris
View GitHub Profile
#/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 "$@"
@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
@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 / 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 / elasticsearch.md
Last active May 27, 2016 08:27
Command ES !
@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

ARGUMENT VIM

  • vim $(*) -- ajoute * dans le args

L'AUTO-COMPLETION

  • :NeoCompleteEnable -- activer neocomplete

PERSONAL SHORTCUT

# config
git config --global user.name "rodesousa" && git config --global user.email [email protected]
git config --global core.editor "vim"
# Pour convertir les retours à la ligne Windows -> Linux
git config --global core.autocrlf true
# alias
git config --global alias.cmm "commit -s -m"
git config --global alias.cma "commit --amend"
# Customize BASH PS1 prompt to show current GIT repository and branch.
# by Mike Stewart - http://MediaDoneRight.com
# SETUP CONSTANTS
# Bunch-o-predefined colors. Makes reading code easier than escape sequences.
# I don't remember where I found this. o_O
# Reset
Color_Off="\[\033[0m\]" # Text Reset