Skip to content

Instantly share code, notes, and snippets.

View pjf's full-sized avatar

Paul Fenwick pjf

View GitHub Profile
@pjf
pjf / gist:c12c76f4db45a09d2050
Created November 14, 2014 04:13
Possible `ckan available` display?
./ckan.exe available
Mods available for KSP 0.25.0
* Advanced Fly-By-Wire 1.2.3_0 (AdvancedFlyByWire)
* Action Groups Extended 1.21a (AGExt)
* Advanced Jet Engine (AJE) 1.6.4 (AJE)
* AMEG 1.1 (AMEG)
* Community Resource Pack 0.2.3 (CommunityResourcePack)
* CrewFiles 2.0.0.3 (CrewFiles)
* Cross Feed Enabler 3.1 (CrossFeedEnabler)
@pjf
pjf / netk
Created November 16, 2014 12:15
Inflate and validate netkan files directory into CKAN-meta
#!/usr/bin/perl
use 5.010;
use strict;
use warnings;
use autodie qw(:all);
my ($file) = @ARGV;
my ($base) = ($file =~ m{(?:.*/)?(.*)\.netkan$});
#!/usr/bin/perl -w
use strict;
use warnings;
use autodie;
use utf8;
use FindBin qw($Bin);
use lib "$Bin/lib";
use IO::Prompt qw(prompt);
use Term::Cap;
use Term::ANSIScreen qw(locate);
#!/usr/bin/perl -w
use 5.010;
use strict;
use warnings;
use autodie;
# In Perl, regular expressions can REFER TO THEMSELVES.
# Yes, this is both awesome and dangerous.
#
# However this isn't *fast*, it's mainly done to show that
#!/usr/bin/perl -w
use 5.010;
use strict;
use warnings;
use autodie;
while (<>) {
# This requires at least two characters to fire, because we're searching
# for a character, followed by repeats ('+') of that character.
@pjf
pjf / timer
Last active August 21, 2016 14:29 — forked from anonymous/timer
// Pin-outs
int panel_1 = 10;
int panel_2 = 12;
int panel_3 = 8;
int panel_4 = 9;
int panel_5 = 6;
int panel_6 = 7;
int bottomLight = 11;
int topLight = 5;
@pjf
pjf / Mainline.md
Created September 24, 2016 14:24
Build your own working Ubuntu 4.7.x kernel

Booting with a mainline kernel on Ubuntu with 4.7.5 or above.

Some machines die with "cannot find root" unless CONFIG_UEVENT_HELPER is set. This is the case with Ubuntu kernels 4.6.x and earlier, but not in 4.7.5. I have no idea why.

Here's how I built my own.

  • git clone --branch v4.7.5 --depth 1 git://git.launchpad.net/~ubuntu-kernel-test/ubuntu/+source/linux/+git/mainline-crack
  • Apply all the patches from mainline with -p1 ( http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.7.5/ )
  • Copy your config from your already installed mainline kernel /boot/whatever to .config
@pjf
pjf / regexps-are-fabulous.pl
Created April 26, 2017 12:05
Here are great things you can do with regexp matching groups
#!/usr/bin/env perl
# These lines enable newer Perl features (like 'say'), and encourage
# good coding practices.
use v5.10;
use strict;
use warnings;
use autodie;
# Our script will search for strings in the following form:
@pjf
pjf / .bash_colours
Created April 27, 2017 06:56
pjf's shell prompt with taskwarrior and git
# Reset
Color_Off='\[\e[0m\]' # Text Reset
# Regular Colors
Black='\[\e[0;30m\]' # Black
Red='\[\e[0;31m\]' # Red
Green='\[\e[0;32m\]' # Green
Yellow='\[\e[0;33m\]' # Yellow
Blue='\[\e[0;34m\]' # Blue
Purple='\[\e[0;35m\]' # Purple
@pjf
pjf / .taskrc
Created December 5, 2017 00:05
pjf's .taskrc file
# [Created by task 2.5.1 2/19/2017 04:19:13]
# Taskwarrior program configuration file.
# For more documentation, see http://taskwarrior.org or try 'man task', 'man task-color',
# 'man task-sync' or 'man taskrc'
# Here is an example of entries that use the default, override and blank values
# variable=foo -- By specifying a value, this overrides the default
# variable= -- By specifying no value, this means no default
# #variable=foo -- By commenting out the line, or deleting it, this uses the default