Skip to content

Instantly share code, notes, and snippets.

View codingtony's full-sized avatar

Tony Bussières codingtony

View GitHub Profile
@codingtony
codingtony / dvgrab.sh
Created February 13, 2015 23:27
dvgrab (Convert mini dv tapes to files)
#!/bin/sh
dvgrab --autosplit --timestamp video-
@codingtony
codingtony / add_fragment.xslt
Last active September 24, 2015 22:17
Add build wrappers to scm that are hosted to a specific host (myhost)
<?xml version="1.0" encoding="utf-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:xs="http://www.w3.org/2001/XMLSchema" xmlns:fn="http://www.w3.org/2005/xpath-functions">
<xsl:output method="xml" indent="yes"/>
<xsl:template match="@* | node()">
<xsl:copy>
<xsl:apply-templates select="@* | node()"/>
</xsl:copy>
</xsl:template>
@codingtony
codingtony / ReverseDateRange.java
Created March 10, 2016 21:56
date range in reversed strings
DateTimeFormatterBuilder dtfb = new DateTimeFormatterBuilder().appendYear(4, 4).appendMonthOfYear(2).appendDayOfMonth(2);
DateTimeFormatter formatter = dtfb.toFormatter();
String s = "20140501";
String e = "20140510";
LocalDate start = LocalDate.parse(s,formatter);
LocalDate end = LocalDate.parse(e,formatter);
StringBuilder sb = new StringBuilder();
while (!start.isAfter(end)) {
formatter.printTo(sb,start);
@codingtony
codingtony / gist:8436dfd6dcea7c0c285bcd1ebaad1ff6
Created June 1, 2016 21:02 — forked from ishida/gist:2719962
change alias in keystore using keytool
$ keytool -changealias -keystore MY_KEYSTORE_2.jks -alias XXX-XXX-XXX-XXX-XXX -destalias MY_ALIAS
@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 - [email protected]
*
*/
@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 / 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 / exif.sh
Created October 21, 2018 13:27
exif rename using jhead
#!/bin/bash
jhead -n%Y%m%d-%H%M%S $1
#!/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 / 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"