Skip to content

Instantly share code, notes, and snippets.

View codingtony's full-sized avatar

Tony Bussières codingtony

View GitHub Profile
@codingtony
codingtony / encode_vhs.sh
Created December 26, 2020 16:15
mencoder script to convert VHS (using video acquisition card) to digital
#!/bin/bash
mencoder tv:// -tv driver=v4l2:norm=NTSC:width=720:height=480:fps=30:alsa:amode=1:forcechan=2:audiorate=48000:adevice=hw.3,0:forceaudio:immediatemode=0 -oac mp3lame -ovc xvid -xvidencopts bitrate=1600:threads=4 -endpos 6:00:00 -vf yadif=0 -o
@codingtony
codingtony / fraserJsonToCSV.sh
Last active May 1, 2023 13:56
Get school list from fraser institute as CSV
#!/bin/bash
wget https://www.compareschoolrankings.org/api/v1/schools.json -O school.json
jq '.data[] | { sid:.sid, title:.title, province:.province, type:.schoolType, rank:.schoolInfoData."Rank This Yr", city:.schoolInfoData.SchoolCity, pubOrPriv:.schoolInfoData.IND_or_PUB,lang:.schoolInfoData.SchoolLanguage,admin:.schoolInfoData.AdminBodyName } ' school.json | jq -rn -L. 'include "json2csv"; [inputs]|json2csv' > school.csv
@codingtony
codingtony / backup_checklist.sh
Last active July 15, 2019 19:30
Trello checklist backup with jq
#!/bin/sh
jq 'INDEX(.cards[]; .id) as $card | .checklists[] | { "card":$card[.idCard]|.name,"description":$card[.idCard]|.desc,"checklist":.name, "items": [.checkItems[] | (if .state=="incomplete" then .name +" [ ]" else .name + " [X]" end)]}' < $1
@codingtony
codingtony / mbp2011-disable-amd-gpu.md
Created January 3, 2019 00:55 — forked from blackgate/mbp2011-disable-amd-gpu.md
Macbook Pro 2011 - Disable AMD GPU
@codingtony
codingtony / dropbox_linux_encrypted_home.sh
Last active December 18, 2018 14:19
Script inspired by the blog post : https://metabubble.net/linux/how-to-keep-using-dropbox-even-if-you-dont-use-unencrypted-ext4-workaround/ to continue to use dropbox on an encrypted home.
#!/bin/bash
# https://metabubble.net/linux/how-to-keep-using-dropbox-even-if-you-dont-use-unencrypted-ext4-workaround/
if [[ -f ~/.dropbox/storage ]]; then
echo "File exist please revert installation manually if you want to install"
echo "Know what you are doing..."
echo "======"
echo "pkill -9 dropbox"
echo "umount ~/Dropbox"
echo "sudo chattr -i ~/Dropbox"
#!/bin/bash
# https://metabubble.net/linux/how-to-keep-using-dropbox-even-if-you-dont-use-unencrypted-ext4-workaround/
if [[ -f ~/.dropbox/storage ]]; then
echo "File exist please revert installation manually if you want to install"
echo "Know what you are doing..."
echo "======"
echo "pkill -9 dropbox"
echo "umount ~/Dropbox"
echo "sudo chattr -i ~/Dropbox"
@codingtony
codingtony / exif.sh
Created October 21, 2018 13:27
exif rename using jhead
#!/bin/bash
jhead -n%Y%m%d-%H%M%S $1
@codingtony
codingtony / metar.sh
Created October 14, 2018 17:51
Fetch Metar
#!/bin/bash
AIRPORT=$1
DATE=$2
TIME=$3
UTC=$(printf "TZ=UTC date +\"%%Y%%m%%d %%H%%M\" --date='TZ=\"America/Montreal\" %s %s'" $2 $3)
UTC=$(eval ${UTC})
#echo $UTC
@codingtony
codingtony / scm.xslt
Last active December 28, 2017 22:17
XSLT Add SCM tag to pom.xm
<?xml version="1.0"?>
<xsl:stylesheet xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:pom="http://maven.apache.org/POM/4.0.0" xmlns="http://maven.apache.org/POM/4.0.0" version="1.0">
<xsl:output omit-xml-declaration="yes" indent="yes"/>
<xsl:strip-space elements="*"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
<xsl:template match="pom:scm">
@codingtony
codingtony / ProxyProtocolAcceptor.java
Last active April 10, 2017 13:36
ServerProxyAcceptor implementation for Mina SSHD. Tested with sshd-core 1.3.0 & 1.4.0 - https://issues.apache.org/jira/browse/SSHD-656
/**
*
* A working prototype to support PROXY protocol as described
* @see <a href="http://www.haproxy.org/download/1.8/doc/proxy-protocol.txt">HAProxy Documentation</a>
*
* Feel free to improve and integrate to the core library, just include my name as contributor :
* Tony Bussieres - tony@codingtony.com
*
*/