Skip to content

Instantly share code, notes, and snippets.

@show0k
show0k / batch_clean_web_image
Last active August 29, 2015 14:01
Convertir en pgm, redimenssioner et rennomer un lot d'images venant du web (téléchargés sur google image avec l'extension de firefox DownloadThemAll) pour l'exploiter dans un algo de traitement d'image
#!/bin/bash
#
# Usage : bash script.sh directory_of_my_pictures
#
dir=$1
# Need to make a function to allow "cd"
@show0k
show0k / morse.ino
Created May 21, 2014 23:16 — forked from madc/LICENSE
//Define the LED Pin
#define PIN_OUT 9
//Define unit length in ms
#define UNIT_LENGTH 250
//Build a struct with the morse code mapping
static const struct {const char letter, *code;} MorseMap[] =
{
{ 'A', ".-" },
{ 'B', "-..." },
/*
* Arduino library for the MMA8452Q three-axis accelerometer.
*
* The MMA8452Q is a tiny and low-power three-axis accelerometer. This
* library implements a simple interface to access most of the chip
* functionality from an Arduino.
*
* FEATURES:
* + Normal and fast raw axes values reading
* + Scale configuration (allowed 2g, 4g and 8g scales)
@show0k
show0k / lbca.py
Last active January 7, 2024 23:19 — forked from fclairamb/lbca.py
Parseur de leboncoin : permet de s'envoyer des emails lors de nouvelles annonces sur une recherche précise
#!/usr/bin/python
import urllib
import requests
import re
import sqlite3
import os
import argparse
import gettext
import logging
import logging.handlers
@show0k
show0k / find_words.py
Created April 23, 2015 09:54
Bruteforce word with a specified separator
def find_words(instring, words, prefix=''):
""" Quick and dirty snippet to split string without space
to a list of known words.
Used to pass over a bug of Snap!"""
if not instring:
return []
if (not prefix) and (instring in words):
return [instring]
prefix, suffix = prefix + instring[0], instring[1:]
@show0k
show0k / monitor.bash
Created June 2, 2015 14:59
live usb dubugging
tail -f /var/log/kern.log
@show0k
show0k / reveal.html
Created July 2, 2015 14:50
include a video in reveal.js
<center>
<video autoplay="true" loop="true" muted="true" width="640">
<source src="https://s3.amazonaws.com/orm-atlas-media/atlas-jupyter/edit-with-atlas.mp4" type="video/mp4"> Your browser does not support the video tag.
</video>
</center>
@show0k
show0k / rsync_backup.sh
Last active August 29, 2015 14:24
backup to a remote shell with Rsync (keep rights and dates to files, can be rexecuted if trasnfer failed)
rsync -arzvvPh dir/to/backup user@host.local:/remote/dir
# you can use also -files-from=to_be_backuped.txt with a list of directories
@show0k
show0k / clean_files_for_windows.bash
Last active August 29, 2015 14:24
Clean files for windows (remove illegal characters)
find . -name "*[<>:\\|?*]*" -exec bash -c 'x="{}"; y=$(sed "s/[<>:\\|?*]\+/-/g" <<< "$x") && mv "$x" "$y" && echo "change $x to $y"' \;
@show0k
show0k / ffmpeg.bash
Created November 25, 2015 12:43
Ffmpeg scripts
# encode a MTS (from a Canon photo camera video file) to an Avi
ffmpeg -i file.mts -acodec copy -vcodec libx264 -crf 21 -r 30000/1001 -deinterlace -y -threads 0 file.avi