Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use DigitalOcean;
my $IP = '107.170.222.172';
#!/usr/bin/env perl
use 5.010;
use strict;
use warnings;
use MIDI::Simple;
our $notes_per_phrase = 8;
BITSIZE=4096
FILE=eatabrick.org
all: $(FILE).pem $(FILE).key dhparam.pem
chown http:http $(FILE).*
chmod 600 $(FILE).key
$(FILE).pem: $(FILE).csr intermediate.pem
@echo "Copy and paste the following into your CA:"
@cat $(FILE).csr
@bentglasstube
bentglasstube / pwm.sh
Created March 30, 2014 15:04
Password manager written in bash.
#!/bin/sh
FILE="$HOME/Dropbox/passwords.gpg"
quiet=""
output=""
while getopts hqo opt
do
case $opt in
q) quiet="y" ;;
@bentglasstube
bentglasstube / Makefile
Last active August 29, 2015 13:57
Makefile for making certificates with openssl
BITSIZE=4096
FILE=server
$(FILE).crt: $(FILE).csr
@echo "Copy and paste the following into your CA:"
@cat $(FILE).csr
@echo "Paste the certificate from your CA here (^D to finish):"
@cat >$(FILE).crt
rm $(FILE).csr
use Irssi;
use strict;
use FileHandle;
use vars qw($VERSION %IRSSI);
$VERSION = "1.0";
%IRSSI = (
authors => 'Alan Berndt <alan@eatabrick.org>',
name => 'auto_away',
@bentglasstube
bentglasstube / pinlock.tsk.xml
Last active December 18, 2015 19:39
Tasker profile to pin lock phone when not on home wifi.
<TaskerData sr="" dvi="1" tv="4.1u3m">
<Profile sr="prof6" ve="2">
<cdate>1371538376764</cdate>
<clp>true</clp>
<edate>1371851913695</edate>
<id>6</id>
<mid0>5</mid0>
<mid1>8</mid1>
<nme>Home</nme>
<State sr="con0">
John Holleran: How do I do "Q1 performance (70), refueling 20, pax 20" to "(70),20,20”
It really depends on what the whole data looks like not just one line, but I'll give it a shot. I have no idea how (un)familiar you are with regular expressions so I will assume you know nothing to err on the side of overexplanation.
As a warning, these are perl regular expressions. Whatever you are using has a different (and shittier) regex engine than perl does so some things might be a little bit different for you. If you tell me what language you are using, I might know more about its particular engine. If you tell me it is something that costs money like Oracle DB regex you are on your own, sorry.
Assuming that the text is mostly the same you could do something like
^Q[1-4] performance (\(\d+\)), refueling (\d+), pax (\d+)$
@bentglasstube
bentglasstube / gist:5020807
Created February 23, 2013 18:34
sunsong ranch macro
#showtooltip 3 3
/cleartarget
/tar tilled soil
/use [exists] 3 3; master plow