git fetch origin branch
git diff --name-only HEAD..origin/branch
git diff HEAD..origin/branch directory_foo/file_bar.ext
git config merge.tool vimdiff
git config merge.conflictstyle diff3
source <(kubectl completion bash) # active l'auto-complétion pour bash dans le shell courant, le paquet bash-completion devant être installé au préalable | |
echo "source <(kubectl completion bash)" >> ~/.bashrc # ajoute l'auto-complétion de manière permanente à votre shell bash | |
alias k=kubectl | |
complete -F __start_kubectl k |
function listFolders(folder) { | |
var sheet = SpreadsheetApp.getActiveSheet(); | |
sheet.appendRow(["Folder Name" ,"Name","Sharing Access", "Get Editors", "Get Viewers", "Date", "URL"]); | |
folderID = "ID" | |
listFolder(sheet, folderID) | |
} | |
function listFolder(sheet, folderID) { | |
var folder = DriveApp.getFolderById(folderID); | |
addRootFilesToSheet(sheet, folder) |
#!/bin/bash | |
# Golang upgrade script | |
# (C) 2019, Fedir RYKHTIK | |
# Usage: define the version constants and use it under the account | |
# Define target constants | |
VERSION="1.13.5" | |
OS="linux" |
#!/bin/bash | |
sed -i -e 's/[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}\.[0-9]\{1,3\}/G.D.P.R/g' some.log |
for emails in `mailq | awk '/^[0-9A-F][0-9A-F]/{print $1}'`; do postcat -q $emails;done |
# Compressing to EBook quality (between "screen" and "preprocess") | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/ebook -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf | |
# Black and white output, with custom resolution | |
gs -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/default -dCompressFonts=true -r150 -dNOPAUSE -dQUIET -dBATCH -sColorConversionStrategy=Gray -dProcessColorModel=/DeviceGray -sOutputFile=output.pdf input.pdf |
#!/bin/bash | |
# Small files (64KB) | |
dd if=/dev/zero of=./dsync64KB.img bs=64 count=1000 oflag=dsync 2>&1|tee dsync-test-1-64KB.log | |
# Medium files (8MB) | |
dd if=/dev/zero of=./dsync8MB.img bs=8k count=1000 oflag=dsync 2>&1|tee dsync-test-2-8MB.log | |
# Big files (128MB) | |
dd if=/dev/zero of=./dsync128MB.img bs=128k count=1000 oflag=dsync 2>&1|tee dsync-test-3-128MB.log |
// ref. https://pauladamsmith.com/blog/2016/07/go-modify-slice-iteration.html | |
y := x[:0] | |
for _, n := range x { | |
if n.property !=42 { | |
y = append(y, n) | |
} | |
} | |
// If some further sorting should be done, requires Go 1.8+ | |
// https://stackoverflow.com/a/42872183/634275 |