Skip to content

Instantly share code, notes, and snippets.

View mgleeson's full-sized avatar

Matt Gleeson mgleeson

  • eLearning Kaizen
  • Brisbane, Australia
View GitHub Profile
@mgleeson
mgleeson / trexprompt
Created October 13, 2025 10:41
trexprompt by Teranex
#!/bin/bash
## trexprompt by Teranex (c) 2011
## https://github.com/teranex/dotfiles/blob/master/bash/trexprompt
## https://budts.be/weblog/2011/04/my-bash-prompt/
GIT_PS1_SHOWDIRTYSTATE=true
GIT_BRANCH_COLOR="\[\033[38;5;155m\]\[\033[48;5;235m\]"
PS1_EXIT_RED="\[\033[38;5;208m\]\[\033[48;5;52m\]"
@mgleeson
mgleeson / install_exa.sh
Last active March 9, 2025 04:24
shellscript to help install exa easily
#!/bin/bash
cd /opt
mkdir -p /opt/exa
cd /opt/exa
wget https://github.com/ogham/exa/releases/download/v0.10.1/exa-linux-x86_64-v0.10.1.zip
unzip exa-linux-x86_64-v0.10.1.zip
apt install -y bash-completion
cp /opt/exa/bin/exa /usr/local/bin/
cp /opt/exa/man/exa* /usr/share/man/man1/
@mgleeson
mgleeson / security_updates_only.sh
Created September 27, 2022 06:54
Apply security updates only on Ubuntu/Debian systems
apt-get -qq update ; apt-get -s dist-upgrade | grep "^Inst" | grep -i security | awk -F " " {'print $2'} | xargs apt-get -y install ; apt -y autoremove
/**
* jsFiddleConsole logger by kkobashi
* Make calls to the log method like this:
* jsFiddleConsole.log('hello');
* jsFiddleConsole.log('world');
*
* script originally from here:
* https://web.archive.org/web/20160614162940/
* http://www.kobashicomputing.com:80/send-your-console-output-to-the-result-pane-in-jsfiddle
* (concat the above 2 lines for the archive.org copy)
@mgleeson
mgleeson / mysqldump_version-control_friendly.sh
Created March 23, 2022 12:16
Version control friendly MySQL dump one-liner
db="" ; dbuser="" ; ARGS="--opt --skip-dump-date --order-by-primary" ; ts=$(date +%Y-%m-%d--%H%M%S) ; $(which mysqldump) -u${dbuser} -p${dbpw} ${ARGS} --database ${db} | sed 's$VALUES ($VALUES\n($g' | sed 's$),($),\n($g' > ${db}_${ts}.sql && bzip2 ${db}_${ts}.sql
@mgleeson
mgleeson / index.html
Created August 8, 2019 03:40
Shopping List Item Animations
<html>
<body>
<div class="card">
<div class="card-bg">
<div class="info">
<div class="counter"> <span class="number"> 1 </div>
<div class="item"></div>
SELECT SUM(filesize)/(1024*1024*1024) FROM `mdl_files` WHERE `filename` LIKE '%mbz%' AND filearea = 'automated'
@mgleeson
mgleeson / cdata_fix.bat
Created June 23, 2015 05:25
search+replace of xml exported from Cp glossary access db to surround all definitions in cdata tags
::::::::::::::::::::::::::::::::::::::::::::::::::::
:: file: cdata_fix.bat
:: description: search+replace of Cp glossary xml to surround all definitions in cdata
:: tags in case of definitions including chars that Cp doesn't like
:: author: Matt Gleeson 2015
::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
if exist ../Glossary_Terms_for_Cp.xml (
SearchReplace.exe "<def>" "<def><![CDATA[" ../Glossary_Terms_for_Cp.xml > Glossary_Terms_for_Cp.xml.tmp
if %errorlevel% neq 0 goto :error
@mgleeson
mgleeson / wmode_fix.bat
Created June 23, 2015 05:21
search+replace of SWF embed code published from Captivate to fix bug where HTML interactives disappear when clicked off in published SWFs
::::::::::::::::::::::::::::::::::::::::::::::::::::
:: file: wmode_fix.bat
:: description: search+replace of SWF embed code published from Captivate to fix bug where HTML interactives disappear when clicked off in published SWFs
:: author: Matt Gleeson 2015
:: requires: fnr.exe (https://findandreplace.codeplex.com/)
::::::::::::::::::::::::::::::::::::::::::::::::::::
@echo off
set pwd="%cd%"
if exist fnr.exe (
echo fnr --cl --find "so.addParam(\"wmode\", \"window" --replace "so.addParam(\"wmode\", \"transparent" --dir %pwd% --includeSubDirectories --fileMask "*.htm,*.html"
@mgleeson
mgleeson / install_latest_bitnami_lampstack.sh
Created February 26, 2015 19:56
Fetches and installs most recent version of 64bit Linux Bitnami Lampstack
#!/bin/bash
#############
# install_latest_bitnami_lampstack.sh
# Fetches and installs most recent version of 64bit Linux Bitnami Lampstack
# @author Matt Gleeson <matt@mattgleeson.net>
# @version 0.00.001a not yet fully functional, haven't finished yet, just writing down the code somewhere while I'm thinking of it so I don't forget
# @license: GPL2
#############
exit #remove this once it's more complete, just prevents running until it's more done-ish so it doesn't potentially do terrible things to your cat and abuse your mother and stuff