This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
# Author: Paul Laffitte | |
# Description: A filesystem based chat written exclusively in bash | |
# Dependency (the only one): https://github.com/clibs/entr | |
if [ "$1" == '--server' ]; then | |
touch chat.log chat.message | |
ls chat.message | entr bash -c 'cat chat.message && cat chat.message >> chat.log' | |
else |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
dest=$1 | |
fps=$2 | |
if [[ -z "$dest" ]]; then | |
dest='.' | |
fi | |
if [[ -z "$fps" ]]; then | |
fps=60 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env bash | |
INPUT="$1" | |
if [[ -z "$INPUT" ]]; then | |
echo 'Usage: proxify [filename.mlt]' | |
echo '(The current folder sould include a "raw" folder containing your raw footages in mp4 format)' | |
echo 'xpath is required for this tool to work' | |
exit | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<body> | |
<div class="player"> | |
<canvas></canvas> | |
<video src="https://threejs.org/examples/textures/MaryOculus.webm" loop autoplay crossOrigin="" controls="false" style="display: none;"></video> | |
</div> | |
<canvas id="texture-canvas" width="500" height="100" style="display: none;"></canvas> |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
if [ $# -ne 1 ]; then | |
echo "please choose a name for the certificate" | |
exit 1 | |
fi | |
openssl genrsa -out "$1.key" 4096 | |
openssl req -new -key "$1.key" -out "$1.req" | |
openssl x509 -req -in "$1.req" -CA rootCA.pem -CAkey rootCA.key -set_serial 101 -extensions client -days 500 -outform PEM -out "$1.cer" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* Example from page 22 | |
const makrovChain = { | |
q: { | |
property: 0.7, | |
transitions: { | |
q: 0.7, | |
r: 0.1, | |
s: 0.2, | |
}, | |
emissions: { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const inputs = [ | |
'Bonjour monsieur Dupont ! Comment allez-vous ?..', | |
'Bonjour monsieur Dupont ! Comment allez-vous ?', | |
'Bonjour monsieur Dupond ! Comment allez-vous ?', | |
'test', | |
'testt', | |
'tests', | |
'a', | |
'A', | |
'B', |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /usr/bin/env bash | |
git log --pretty=oneline --abbrev-commit | grep -oP '\(([^\)]*)\):' | sort | uniq | cut -c2- | sed 's/..$//' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
kube_prompt() { | |
echo -n '\[\e[91m\]'$(kubectl config current-context)'\[\e[39m\]' | |
K8S_NS=$(kubectl config view --minify --output 'jsonpath={..namespace}') | |
if [[ ! -z $K8S_NS ]]; then | |
echo "|\[\e[0;32m\]$K8S_NS\[\e[39m\]" | |
fi | |
} | |
date_prompt() { | |
echo -e "$(date +%H:%M:%S).$(date +%N | cut -b1-2)" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#! /bin/bash | |
if [[ $# != 2 ]]; then | |
echo "usage: cmprec <source1> <source2>" | |
exit 1 | |
fi | |
SOURCE1=$1 | |
SOURCE2=$2 |