Skip to content

Instantly share code, notes, and snippets.

View fabienduhamel's full-sized avatar

Fabien Duhamel fabienduhamel

View GitHub Profile
@fabienduhamel
fabienduhamel / ovh-dyndns-script.sh
Created October 20, 2023 18:45
OVH Dyndns script
#!/bin/bash
output=$(curl -s --fail -w "%{http_code}" -u '<user>:<password>' -XGET "https://www.ovh.com/nic/update?system=dyndns&hostname=<hostname>&myip=$(curl -s https://ipinfo.io/ip)") ; [[ $? -eq 0 ]] && (echo $output | grep -Fq 'nochg') || echo $output
@fabienduhamel
fabienduhamel / .env
Last active September 6, 2022 12:45
Rancher Desktop env issue
APP_ENV=test
#!/bin/bash
#set connection data accordingly
source_host=xxx
source_port=6379
target_host=localhost
target_port=6379
#copy all keys without preserving ttl!
redis-cli -h $source_host -p $source_port keys \* | while read key; do
ssh -q -o ConnectTimeout=4 -oBatchMode=yes $host exit && echo Connexion successful $host
@fabienduhamel
fabienduhamel / negate.txt
Last active August 17, 2017 09:33
Regex - Negate a line containing specific words
^(?!.*STRING1|.*STRING2|.*STRING3).*$
@fabienduhamel
fabienduhamel / .zshrc
Last active June 2, 2020 13:37
zsh-git-prompt with agnoster theme
# Better zsh git prompt with zsh-git-prompt
# Add it to your .zshrc after the plugins(... zsh-git-prompt ...) line
# First, it rewrites git prompt style
# Then overrides git_super_status()
# And overrides build_prompt() from agnoster (depends of what you want)
ZSH_THEME_GIT_PROMPT_PREFIX=""
ZSH_THEME_GIT_PROMPT_SUFFIX=""
ZSH_THEME_GIT_PROMPT_SEPARATOR="  "
ZSH_THEME_GIT_PROMPT_BRANCH="%{$fg[black]%}"
@fabienduhamel
fabienduhamel / _etc_security_pam_mount.conf.xml
Created January 8, 2017 19:11
encfs automatic mount configuration on linux
<!-- Volume definitions -->
<volume user="fab" fstype="fuse" path="encfs#/home/fab/.Secure.encfs" mountpoint="/home/fab/.Secure" />
<!-- pam_mount parameters: General tunables -->
@fabienduhamel
fabienduhamel / gist
Last active January 7, 2017 23:55
Set newly files as writable by group users recursively
setfacl -R -d -m g::rwx .
# will set newly created files and folders ...rwx...+ :)
@fabienduhamel
fabienduhamel / livestreamer-launcher
Last active August 11, 2016 00:10
Twitch livestreamer desktop launcher
#!/bin/bash
VIDEO="vlc"
echo "Which stream?"
read stream
starting_video_proc_count=`ps aux | grep -v grep | grep $VIDEO | wc -l`
nohup livestreamer twitch.tv/$stream best &>/dev/null & export LIVESTREAMER_ID=$!
@fabienduhamel
fabienduhamel / docker-compose.yml
Last active August 27, 2016 15:57
Docker compose for symfony app
code:
image: debian:jessie
volumes:
- .:/var/www/html
mysql:
image: mysql
environment:
MYSQL_DATABASE: root
MYSQL_ROOT_PASSWORD: root