Skip to content

Instantly share code, notes, and snippets.

@guillaumewuip
guillaumewuip / script.sh
Created May 30, 2016 05:33
Rename pictures in directory with 001.JPG, 002.JPG ... if they were named 1.JPG 2.JPG, ...
FILES=./*.JPG
for f in $FILES
do
filename=`basename $f`;
filename="${f%.*}"
filename="${filename#./}"
newFilename=`printf "%03s\n" $filename`;
echo $newFilename.jpeg;
@guillaumewuip
guillaumewuip / movToGif.sh
Created April 23, 2016 10:16
.mov to .gif
ffmpeg -i in.mov -s 600x400 -pix_fmt rgb24 -r 10 -f gif - | gifsicle --optimize=3 --delay=3 > out.gif
#from http://apple.stackexchange.com/a/211219/149089
@guillaumewuip
guillaumewuip / update.md
Last active March 14, 2016 20:36
Update rooted Nexus 5 from UNIX

How to update rooted Nexus5 with last factory image without loosing app or files

  • download last factory image from Google Dev platform and unzip
  • download last TWRP recovery for Nexus 5
  • download last SuperSu version for Nexus 5
  • adb devices Device should be listed here
  • adb reboot bootloader Reboot on bootloader
//Want to use 2 terminal window to see the same tmux session
//eg. showing one tmux window on one screen, an other on an other screen
//on the second terminal
//attach an existing tmux session
tmux new-session -t <the_session_you_want_to_connect_to>
//resize only the current window to the smallest client (not all the session)
//this way you can work on two different tmux window without having the whole tmux sessions resised
{
/*
* ENVIRONMENTS
* =================
*/
// Define globals exposed by modern browsers.
"browser": true,
// Define globals exposed by jQuery.
@guillaumewuip
guillaumewuip / camera.js
Last active October 29, 2018 15:24
Mock an UPnP Sony Camera
/**
* Mock the Sony QX1 SSDP discovery proces
*/
var dgram = require('dgram'),
parse = require('./parse'), //helper
client = dgram.createSocket('udp4');
var UPNP_PORT = 1900;
HTTP_PORT = 8080;
@guillaumewuip
guillaumewuip / post-receive
Last active November 1, 2023 16:54
Git post-receive hook : build then run a docker container
#!/usr/bin/env bash
# A git post-receive hook
#
# On master branch only :
# 1. It builds a docker image named with the dir name
# 2. It then stop container of the same name, rm it and start a new one
## --- Config