Skip to content

Instantly share code, notes, and snippets.

Avatar

Colin Darie colinux

  • Imparato
  • Marseille, France
View GitHub Profile
@colinux
colinux / file.txt
Last active Dec 14, 2018
Test download snack.axios
View file.txt
Downloaded !
@colinux
colinux / player.html.erb
Created Mar 8, 2017
Player audio with pjax
View player.html.erb
<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 Apr 23, 2012
git search alias: search for a pattern/keyword in commits history
View gist:2470153
# ~/.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 Feb 10, 2012
Regex to match a string which does not contain another string or pattern
View gist:1793893
  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

View gist:1270468
$ 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 Jul 21, 2011
Recette cheesecake chocolat blanc / citron ou orange
View cheesecake-choco-blanc-orange.md

À 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)
View Bootstrap_Debian_6.markdown

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 Apr 11, 2011
successive commands to recover from live system my debian installation with lvm crypted and grub on separate partition
View personnal debian system recover access.sh
# 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 Jan 27, 2011
Rename subtitles files according to tv shows names found in a directory
View subtitles-renamer.sh
#!/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