Skip to content

Instantly share code, notes, and snippets.

Christophe Brocas cbrocas

View GitHub Profile
@cbrocas
cbrocas / gist:22110f7bf8bff7ca57eee052639a5a84
Created Feb 26, 2018
create bootable usb key from ISO *with* sync of the copy (no more data in cache).
View gist:22110f7bf8bff7ca57eee052639a5a84
dd if=image.iso of=/dev/sdx bs=4M status=progress && sync
@cbrocas
cbrocas / gist:088df03a5aeafad0cd94fe9cfed8e5de
Created Jun 17, 2016
Convert a PDF file into a PDF with CMYK color type (thank doegox)
View gist:088df03a5aeafad0cd94fe9cfed8e5de
file="$1"
gs -dSAFER -dBATCH \
-dNOPAUSE -dNOCACHE -sDEVICE=pdfwrite \
-sColorConversionStrategy=CMYK \
-dProcessColorModel=/DeviceCMYK \
-sOutputFile="${file%.pdf}_cmyk.pdf" \
"$file"
@cbrocas
cbrocas / gist:8cce37602be2c738e517
Last active Aug 5, 2017
Renaming pictures according EXIF data + rotating pictures
View gist:8cce37602be2c738e517
- 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 starting from local directory :
View gist:8a954562aa104942a376
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 Sep 28, 2014
How to backup an external server on a synology Diskstation NAS
View gist:263f4b548891bf53d14d
#!/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/"
You can’t perform that action at this time.