Skip to content

Instantly share code, notes, and snippets.

View M1ke's full-sized avatar

Mike Lehan M1ke

View GitHub Profile
@M1ke
M1ke / index.html
Last active August 29, 2015 14:03
Text reader
<html>
<head>
<title>Text Reader</title>
<style type="text/css">
h1 {text-align: center;}
p.text {display: none;}
</style>
</head>
<body>
<h1 class="read">The text will be read here</h1>
@M1ke
M1ke / README.md
Created July 3, 2014 12:00
NatWest Bankline CSV Template

These columns come from the spreadsheet template that can be downloaded from the Natwest website. On that page you can submit fake details to be able to download the zip file. Opening the xlt file in LibreOffice might make some weird macro stuff happen - so better to look at the column titles below!

The table columns are as follows:

  • Your Reference
  • *Debit Account Sort Code
  • *Debit Account Number
  • *Payment Amount
  • *Credit Date
  • *Beneficiary Account Sort Code
@M1ke
M1ke / random.sh
Last active December 29, 2015 14:09
Generate a random number within a range
#!/bin/bash
# Generate a random number within a range
from=$1
to=$2
$(( ( RANDOM % $to ) + $from ))
@M1ke
M1ke / README.md
Last active December 7, 2022 22:05
Quickly convert a markdown file into a nice looking PDF formatted in the same way GitHub formats Readme.md files

Markdown to PDF

Quickly convert a markdown file into a nice looking PDF formatted in the same way GitHub formats Readme.md files

  • Install grip $ pip install grip
  • Install wkhtmltopdf $ sudo apt-get install wkhtmltopdf
@M1ke
M1ke / .bash_aliases
Created October 11, 2013 07:42
Taken from https://github.com/NotBobTheBuilder/dotfiles/blob/9dfb79548eab93c5b048b7ac535c53cee8db47f0/.bash_aliases. I have altered the conditions for git to be considered "unclean" to having changes, rather than requiring "nothing to commit" to be present. I have also added an extra line to allow the title of the Xterm to change; this could be …
## Add this to the bottom of your aliases or join in another file
if [ -f ~/.bash_aliases_colors ]; then
. ~/.bash_aliases_colors
fi
if [ -f ~/.bash_git_branch ]; then
. ~/.bash_git_branch
fi
@M1ke
M1ke / create-tunnel.sh
Last active December 24, 2015 13:49
A set of scripts to enable remote SSH tunnelling on a device. Originally written for a Raspberry Pi, so that when installed in a remote location inside a network it can easily be accessed for maintenance.
#!/bin/bash
# This sits on the device you want to be able to tunnel back into
# Replace USER and SERVER lines with your tunnel user (if different from local) and domain or IP
createTunnel() {
/usr/bin/ssh -N -R 2222:localhost:22 USER@SERVER
if [[ $? -eq 0 ]]; then
echo Tunnel created successfully
else
@M1ke
M1ke / img-backup.md
Created October 3, 2013 11:15
Bash scripts for copying images to and from drives. Made with the intention of replicating SD cards for Raspberry Pi
@M1ke
M1ke / dd-progress.md
Last active December 24, 2015 13:49
Bash script to track progress of `dd` command.
@M1ke
M1ke / vebra-field-names.md
Last active December 21, 2015 08:58
Bash script to write column headings for CSVs downloaded via FTP from the Vebra 5.2 property management platform.

For developers working to import properties from the GMG Property Services software platform Vebra 5.2. The files provided are missing field headers which can require extra work from existing CSV parsing libraries which will require a column name input by number, which at the very least is awkward to type out.

This shell script abstracts this task away from your application - simply run this after the FTP download completes and your application can process the files with native CSV libraries without any additional input for interpreting column numbers or input of column titles. The headings are taken from official documentation.

@M1ke
M1ke / turn-off-retweets
Last active March 7, 2018 23:22
Want to turn off Retweets from all users you're following without clicking each time? This script sorts that, using a timer to avoid your requests being blocked and returning a 403. Scroll to the bottom of your Following list, paste it into Chrome's console (Firefox should work too) and hit enter. It turns off 3 per minute (you could reduce the …
var interval=setInterval(function(){
$('.user-actions.including .retweet-off-text').last().click();
if ($('.user-actions.including .retweet-off-text').length<1) {
clearInterval(interval);
}
},20000);