Skip to content

Instantly share code, notes, and snippets.

# ajouter les droits en écriture pour le groupe sur les fichiers qui ne l'ont pas
find . ! -perm -g=w -exec chmod g+w {} \;
@dcpc007
dcpc007 / git-mv-with-history
Created February 16, 2018 13:19 — forked from emiller/git-mv-with-history
git utility to move/rename file or folder and retain history with it.
#!/bin/bash
#
# git-mv-with-history -- move/rename file or folder, with history.
#
# Moving a file in git doesn't track history, so the purpose of this
# utility is best explained from the kernel wiki:
#
# Git has a rename command git mv, but that is just for convenience.
# The effect is indistinguishable from removing the file and adding another
# with different name and the same content.
@dcpc007
dcpc007 / .gitconfig
Last active July 18, 2022 21:29
git configs
[user]
name = Prénom NOM
email = <mail>
#signingkey=<key> # FOR GPG SIGNING COMMIT
[alias]
ci = commit
co = checkout
st = status
br = branch
fe = fetch -v -p
@dcpc007
dcpc007 / get_ligneLaPlusFrequente.sh
Last active February 1, 2018 12:17
Identifier quelle ligne apparait le plus dans un log
#!/bin/bash
# input = input.txt
# optimisation en utilisant l'outils GNU parallel
cd /data/tmp/bigsort
# découpage gros fichier (renomme en input-XX)
split -l 1000000 split-
# suppression de l'horodatage en début de chaque ligne de log (un seul champ)
@dcpc007
dcpc007 / git_track_all_branches.sh
Last active October 24, 2017 12:42
Ajouter un track toutes les branches remote d'un dépôt central
#!/bin/bash
for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do
git br --track ${branch#remotes/origin/} $branch
done
#or in one line :
#for branch in `git branch -a | grep remotes | grep -v HEAD | grep -v master `; do git br --track ${branch#remotes/origin/} $branch ; done
#Do a git push --all
#Config tmux pour ouvrir une fenêtre avec 3 panes pour les 3 serveurs de licences
#Lancement d'un tmux puis Ctrl-A + : et source-file ~/git/configDC/tmux/slplic
#bind sur une touche non utilisée ? (genre shift-S dans le .tmux.conf)
new -n slplic "ssh lic1"
splitw -h -p 33 "ssh lic3"
splitw -h -p 50 -t 0 "ssh lic2"
#split-window -v 'ipython'
#split-window -h
#new-window 'mutt'
#Config DCPC 2017/01
#main Bind key as screen
set -g prefix C-a
unbind c-b
bind C-a send-prefix
#Specific Bind keys
bind e setw synchronize-panes
@dcpc007
dcpc007 / Gnome config
Created November 10, 2016 12:25
Gnome config
gsettings set org.gnome.Terminal.Legacy.Settings menu-accelerator-enabled false # disable F10 in GNOME terminal
<?xml version="1.0"?>
<gconf>
<entry name="default_size_rows" mtime="1427986906" type="int" value="43"/>
<entry name="default_size_columns" mtime="1427986906" type="int" value="132"/>
<entry name="use_custom_default_size" mtime="1427986906" type="bool" value="true"/>
<entry name="use_system_font" mtime="1420031716" type="bool" value="true"/>
<entry name="scroll_background" mtime="1427986906" type="bool" value="false"/>
<entry name="visible_name" mtime="1427986906" type="string">
<stringvalue>Par défaut</stringvalue>
</entry>