Skip to content

Instantly share code, notes, and snippets.

Chloé “Matcha” ChloeTigre

Block or report user

Report or block ChloeTigre

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View spectro-analysis.sh
#!/bin/bash
SONG=$1
START_TIME=$2
DURATION=${3:-0:02}
BN=$(basename "$SONG" .flac)
if [ "" = "$START_TIME" ];then
sox "${SONG}" -n remix 1 spectrogram -x 3000 -y 513 -z 120 -w Kaiser -o "$HOME/spectro-analysis/${BN}.spectre.png"
else
sox "${SONG}" -n remix 1 spectrogram -x 3000 -y 513 -z 120 -w Kaiser -S ${START_TIME} -d ${DURATION} -o "$HOME/spectro-analysis/${BN}.spectre.zoom.${START_TIME}__${DURATION}.png"
@ChloeTigre
ChloeTigre / push_text.js
Created Aug 18, 2018
After Effects / expression for Text Source to animate a text as if it were pushed item by item
View push_text.js
var t = thisComp.layer(1).timeToFrames(time);
var sourceText = "sample text";
var timePerFrame = 4;
numChar = t / timePerFrame;
sourceText.substring(0, numChar);
@ChloeTigre
ChloeTigre / genpw.sh
Last active Feb 9, 2018
Unambiguous password generator
View genpw.sh
# these passwords are compatible with azerty and qwerty keyboards (considering you input numbers on the numpad).
# also, characters that can be misinterpreted like big-O and zer0, small l and 1 are ruled out.
GenPw() {
REGEX_PASSWORD="^[ertyuiopsdfghjkxcvbnERTYUIPSDFGHJKLXCVBN23456789]+$"
NUM=${1:-8}
LEN=${2:-9}
if [ $(( $LEN % 3 )) -ne 0 ]; then
echo "param 2 must be a multiple of 3"
return
fi
@ChloeTigre
ChloeTigre / put_in_your_shrc.sh
Created Nov 20, 2017
Offending SSH key script
View put_in_your_shrc.sh
# inspired by ze
Offending() {
keytype=$1
_=$2
_=$3
FILEPATH=$4
shift 4
FILENAME=$(echo $FILEPATH | cut -d: -f1)
FILELINE=$(echo $FILEPATH | cut -d: -f2)
gsed -i -e "${FILELINE}d" $FILENAME || sed -ibak -e "${FILELINE}d" $FILENAME
View Notes for AD migration from Samba to Synology.md

We cover how to migrate from Samba to Synology, while changing AD domain name and keeping permissions.

Install SetACL.exe

From Helge Klein's site.

Prepare Synology and migrate file data

Create shared volumes on your Synology. Enable extended attributes (Windows attributes) in the Control Panel.

@ChloeTigre
ChloeTigre / README.md
Created Apr 24, 2017
Wrapper for Alfresco OCR using alfresco-simple-ocr
View README.md

Alfresco OCR

I need a very basic Alfresco OCR for my documents. My life is a mess and I believe I can sort stuff out using code. If this can help the commumity it's even better.

I have written a simple img2pdf converter that I will put soon online on Github.

This way when I receive a letter, I just take a pic of it and feed it to a folder on my Alfresco. Then it is converted to PDF, the original is archived, and the PDF is OCRed.

@ChloeTigre
ChloeTigre / updown.sh
Created Apr 11, 2017
up/down script for openvpn/systemd-networkd
View updown.sh
#!/bin/bash
[ -x /sbin/resolvconf ] || exit 0
[ "$script_type" ] || exit 0
[ "$dev" ] || exit 0
case "$script_type" in
up)
echo -n "Upping $dev... "
echo "up"
cat > /etc/systemd/network/zzz-openvpn-tmp.conf <<EOF
View _etc_avahi_services_samba.service
<?xml version="1.0" standalone='no'?>
<!DOCTYPE service-group SYSTEM "avahi-service.dtd">
<service-group>
<name replace-wildcards="yes">%h</name>
<service>
<type>_adisk._tcp</type>
<txt-record>sys=waMa=0,adVF=0x100</txt-record>
<txt-record>dk0=adVN=Time Capsule,adVF=0x82</txt-record>
</service>
<service>
View smb.conf
vfs objects = fruit
durable handles = yes
kernel oplocks = no
kernel share modes = no
posix locking = no
fruit:advertise_fullsync = true
@ChloeTigre
ChloeTigre / oneliner.py
Created Sep 13, 2016
python code to generate python one-liners to execute over SSH
View oneliner.py
import threading
import base64
import shlex
import subprocess
MAX_RUN_TIME = 10
"""max execution time of the SSH command, in seconds"""
def run_python_one_liner_remote(script_path, ssh_host):
"""Run a python one liner on a remote host returning (returncode, stdout, stderr)"""
You can’t perform that action at this time.