Skip to content

Instantly share code, notes, and snippets.

View colinux's full-sized avatar

Colin Darie colinux

  • Démarches Simplifiées
  • Provence, France
View GitHub Profile
@colinux
colinux / file.txt
Last active December 14, 2018 13:51
Test download snack.axios
Downloaded !
@colinux
colinux / player.html.erb
Created March 8, 2017 11:21
Player audio with pjax
<div>
<audio id="audio_player" controls="control">
<source id="audio_source_mp3" src="/data/ndt-1.mp3" type="audio/mp3" />
<source id="audio_source_mp2" src="/data/ndt-2.mp2" type="audio/mp2" />
<source id="audio_source_ogg" src="/data/ndt-3.ogg" type="audio/ogg" />
Pas d'audio !
</audio>
</div>
<button id="button_play">Play</button>
@colinux
colinux / gist:2470153
Created April 23, 2012 10:39
git search alias: search for a pattern/keyword in commits history
# ~/.gitconfig:
[alias]
search = "!f () { git grep -E -n "$1" $(git log --pretty=format:%h -E --pickaxe-regex -G"$1" "$2") -- "./$2"; }; f"
# Usage:
git search "keyword|regex" <tree>
@colinux
colinux / gist:1793893
Created February 10, 2012 23:13
Regex to match a string which does not contain another string or pattern
  1. Matches strings not containing foo. (fast)

    /(?:[^f]+|f(?!oo))*/

  2. Matches strings not containing PATTERN (slow). s modifier is required if the . can match a new line.

    /(?:(?!PATTERN).)*/s

source

@colinux
colinux / gist:1270468
Created October 7, 2011 15:04
awk sous linux
$ cat gemspec
WARNING: no homepage specified
Successfully built RubyGem
Name: project
Version: 2.7.5
File: project-2.7.5.gem
# On veut récupérer "2.7.5" et "project-2.7.5.gem":
# -F": " : fixe ": " comme séparateur de champ
@colinux
colinux / cheesecake-choco-blanc-orange.md
Created July 21, 2011 12:31
Recette cheesecake chocolat blanc / citron ou orange

À faire dans un plat pas trop grand, sinon augmenter les quantités (mais c'est bien bourratif ^^)

  • 225 g de biscuits LU (3 sachets il me semble dans les paquest où y en a 4)
  • 225 g de fromage frais nature
  • 100 g de beurre
  • 150 g de yaourt nature brassé
  • le jus d'une orange ou d'un gros citron (ou 2 petits) (pas testé citron)
  • 25 g de sucre, ptet un peu + avec le citron
  • un blanc d'oeuf
  • 275 g de chocolat blanc (pas forcément nature, j'avais testé aux amandes)

Big warning: tout n'a pas été testé pour squeeze et ni revérifié !

Vérifier que le partitionnement convient

Avant de se lancer, rien de tel que revoir le partitionnement, car après, c'est un peu plus dur.

Changer le mot de passe root

$ passwd
@colinux
colinux / personnal debian system recover access.sh
Created April 11, 2011 20:25
successive commands to recover from live system my debian installation with lvm crypted and grub on separate partition
# Assume here boot/grub is on a separate partition, /dev/sda4
# The full LVM partition is on /dev/sda3 and named VM-system (pvs gives hints)
# On a live cd with network ...
aptitude install lvm2 (+ cryptsetup if not installed)
modprobe dm-crypt
cryptsetup luksOpen /dev/sda3 VM-system
pvs
pvdisplay /dev/mapper/VM-system
mount /dev/mapper/VM_group-LV_system /mnt
@colinux
colinux / subtitles-renamer.sh
Created January 27, 2011 23:21
Rename subtitles files according to tv shows names found in a directory
#!/bin/bash
# Renames subtitles files according to tv shows names found in a directory
# Acceped syntaxes for season/episode are: 304, s3e04, s03e04, 3x04 (case insensitive)
#
# Usage:
# Put this gist somewhere in your $PATH, like /usr/local/bin/subtitles-renamer
# Chmod +x it
# cd ~/YourHolidaysTvShowsWithSubtitles
# subtitles-renamer