Skip to content

Instantly share code, notes, and snippets.

View WaterSibilantFalling's full-sized avatar
👁️
Bananarama

Stephen McGregor WaterSibilantFalling

👁️
Bananarama
  • Actually Pretty Good
  • Istanbul and New Zealand
View GitHub Profile
[MESSAGES CONTROL]
disable=const-name-hint, const-rgx, line-too-long
@WaterSibilantFalling
WaterSibilantFalling / compress_text.tex
Created September 18, 2017 03:32
how to compress text in latex
% use the microtype package
\usepackage[kerning=true, tracking=true]{microtype}
\microtypecontext{spacing=nonfrench}
% make a new command: say, compress{ }
\newcommand{\compress}[1]{\textsc{\textls[-40]{#1}}}
% use the command to compress the kerning in a script
\cvsite{\compress{github.com/AbsurdMagpieScrutinies}} % Personal website
@WaterSibilantFalling
WaterSibilantFalling / sdmMusicLogger.pl
Created September 21, 2017 11:11
a short perl script for logging all the musich I listen to in audiacious
#!/usr/bin/perl
use strict;
use warnings;
use POSIX;
use English qw( -no_match_vars ) ;
my $logFile = "/home/music/logging/musicListenedLog.log";
use IO::All;
#this script :
@WaterSibilantFalling
WaterSibilantFalling / pidwait
Created September 21, 2017 12:36
tiny script to wait on a PID or process name and then exit: to halt a subsequent process until some other has finished
WAITFOR=$1
sleep 10;
while ps axg | grep -vw grep | grep -w "$WAITFOR" > /dev/null;
do
sleep 10;
#echo "waiting"
@WaterSibilantFalling
WaterSibilantFalling / keepup
Created September 21, 2017 12:37
a little script that keeps a particular interface's internet connection up. Every minute it tests the interface and re-raises the intenet connection if the interface is down
#!/bin/bash
# test the interface every X seconds, re-up it if it is down.
# Completely bugged: only tests that *a* or **any** interface is up
PING_TRY_ADDRESS="192.168.0.1"
INTER_TEST_SECS=60
INTERFACE=$1
@WaterSibilantFalling
WaterSibilantFalling / qbittorrent_starter
Created September 21, 2017 13:57
a script that prepares and then runs qBittorrent
#!/usr/bin/perl
# this is to perform any checks required before running qbittorrent
#
#
# do NOT recursively call this current script by mistake
use common::sense;
my $debug = 1;
@WaterSibilantFalling
WaterSibilantFalling / backupCleaner
Last active September 23, 2017 11:51
a short script to clean out old, local, backups
#!/usr/bin/perl
use strict;
use warnings;
# this script:
#
# cleans out various directories
# one block for each thing to clean out
#
@WaterSibilantFalling
WaterSibilantFalling / emptyCamera
Created September 21, 2017 14:02
little script to clean and basically file images from a camera
#!/bin/bash
if [[ ! -s /mnt/camera/DCIM ]]
then
echo "The camera must turned on & be attached to the computer"
echo "for this program to work"
echo
echo "Bye."
exit
fi
@WaterSibilantFalling
WaterSibilantFalling / rs
Created September 21, 2017 14:03
removes spaces and difficult characters from all the files in the local directory, or from one single file
#!/usr/bin/perl
# This program removes spaces and crap from *nix filenames
#
use common::sense;
my $shitReplaceChar = '_'; # use this car in place of the removed junk characters
use autodie;
@WaterSibilantFalling
WaterSibilantFalling / sdmBleechBit.sh
Created September 21, 2017 14:04
script to easily and regularlly run a bleech-bit run.
#!/bin/bash
# ideally the 'firefox-bin' in line 3 of this would be replaced by $var,
# but substitution is not working: I can't $var substitiute in here
# (the $var could be an 'egrep aaa\|bbb\|ccc ... ' list var, too.)
# is firefox running
FIREFOX_RUNNING=`ps -a \
| awk '{ print $4 }' \
| grep firefox-bin \