Skip to content

Instantly share code, notes, and snippets.

View patdavid's full-sized avatar

Pat David patdavid

View GitHub Profile
@patdavid
patdavid / gmic-video-avg
Created January 10, 2018 18:45
G'MIC Video Avg Command
avg_video :
-e[] "" -v - n=0 go=1
-do
-l[] -i "$1",$n,$n -if $! n+=1 -else go=0 -endif -onfail go=0 -endl
-+
-v + -e[] "\r - Image "$n" " -v -
-while $go -/ $n -v +
avg_files :
-e[] "" -v - files=${"-files \"$1\""} -arg2var _file,$files n=0 go=1
@patdavid
patdavid / transmission-remote-move-folder
Last active January 16, 2018 19:58
transmission-remote move file location
# Get a list of all of the torrent files matching `grep`, and output to a (temp) text file:
transmission-remote -l | grep "Good" > list.txt
Loop through all lines in the text file, capture first column into $value1, move it!
while IFS=" " read -r value1 remainder;do transmission-remote -t $value1 --move /home/pat/Downloads/seeding/;done < list.txt
@patdavid
patdavid / Bash_command_line_shortcuts.md
Created January 24, 2018 16:03 — forked from P7h/Bash_command_line_shortcuts.md
Bash command line Shortcuts

Bash command line Shortcuts

Picked these from here

Command Editing Shortcuts

Command Note
Ctrl + a go to the start of the command line
Ctrl + e go to the end of the command line
Ctrl + k delete from cursor to the end of the command line
@patdavid
patdavid / XSLT Identity Transform
Created May 4, 2018 18:50
Identity Transform and targeting an XPath node
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:output method="xml" version="1.0" encoding="UTF-8" indent="yes"/>
<xsl:template match="node()|@*">
<xsl:copy>
<xsl:apply-templates select="node()|@*"/>
</xsl:copy>
</xsl:template>
@patdavid
patdavid / recursive-directories-mp3-gain
Created October 4, 2016 15:45
recursively find directories and apply mp3gain to all the .mp3 files inside
find ./ -type d -exec bash -c 'cd "$1"; mp3gain -a -k -m 3 *.mp3' -- {} \;