Skip to content

Instantly share code, notes, and snippets.

View cbrocas's full-sized avatar

Christophe Brocas cbrocas

View GitHub Profile
@cbrocas
cbrocas / gist:8cce37602be2c738e517
Last active January 22, 2024 15:29
Renaming pictures according EXIF data + rotating pictures
- Renaming all *.JPG files according the EXIF date taken of the picture (it gives : 2014-11-24_13-13-42.jpg) :
#jhead -n%Y-%m-%d_%H-%M-%S *.JPG
- Rotate all jpeg pictures of a directory :
#jhead -autorot *.jpg
- Rename & rotate recursively *.JPG files (and here, *.jpg also due to non sensitive search with the -iname option) starting from local directory :
@cbrocas
cbrocas / .bash_aliases
Created March 30, 2021 09:31
.bash_aliases : my own Bash alias and functions
# my aliases
#
alias gh="history | grep"
alias myip="curl http://ipecho.net/plain; echo"
@cbrocas
cbrocas / keybase.md
Created March 29, 2020 11:04
keybase.md

Keybase proof

I hereby claim:

  • I am cbrocas on github.
  • I am cbrocas (https://keybase.io/cbrocas) on keybase.
  • I have a public key ASAHL5IZag6H82CD433mBmJP1TGxLimK-UZz06IyWH3dxQo

To claim this, I am signing this object:

@cbrocas
cbrocas / gist:22110f7bf8bff7ca57eee052639a5a84
Created February 26, 2018 12:00
create bootable usb key from ISO *with* sync of the copy (no more data in cache).
dd if=image.iso of=/dev/sdx bs=4M status=progress && sync
@cbrocas
cbrocas / gist:088df03a5aeafad0cd94fe9cfed8e5de
Created June 17, 2016 11:52
Convert a PDF file into a PDF with CMYK color type (thank doegox)
file="$1"
gs -dSAFER -dBATCH \
-dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite \
-sColorConversionStrategy=CMYK \
-dProcessColorModel=/DeviceCMYK \
-sOutputFile="${file%.pdf}_cmyk.pdf" \
"$file"
@cbrocas
cbrocas / gist:8a954562aa104942a376
Created November 6, 2014 18:59
My PS1 values
server : PS1="\[\e[00;37m\][\[\e[0m\]\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]@\[\e[0m\]\[\e[ 00;31m\]\H\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[00;36m\]\w\[\e[0m\]\[\e[00;37m\]] \[\e[0m\]"
local : PS1="\[\e[00;37m\][\[\e[0m\]\[\e[00;32m\]\u\[\e[0m\]\[\e[00;37m\]@\[\e[0m\]\[\e[ 00;33m\]\H\[\e[0m\]\[\e[00;37m\] \[\e[0m\]\[\e[00;36m\]\w\[\e[0m\]\[\e[00;37m\]] \[\e[0m\]"
@cbrocas
cbrocas / gist:263f4b548891bf53d14d
Created September 28, 2014 14:43
How to backup an external server on a synology Diskstation NAS
#!/bin/sh
USER="uid"
SERVER="hostname"
PORT="22"
SSHID="/volume1/homes/admin/.ssh/id_rsa"
SOURCE1="/var/lib/automysqlbackup/"
TARGET1="/volume1/homes/admin/backups/hostname/automysqlbackup/"
SOURCE2="/var/cache/rsnapshot/"
TARGET2="/volume1/homes/admin/backups/hostname/rsnapshot/"