Skip to content

Instantly share code, notes, and snippets.

View jettero's full-sized avatar
🕸️
Hliðskjálf

Paul Miller jettero

🕸️
Hliðskjálf
View GitHub Profile
#!/bin/bash
# don't run this, source it
# source cisco-like-help.sh
function ciscolikehelp() {
if [[ $READLINE_POINT=${#READLINE_LINE} && "$READLINE_LINE" =~ \ $ ]]; then
cmd="$( sed -e 's/.*[;|]//' -e "s/ .*//g" <<< "$READLINE_LINE" )"
pcmd=$( type -P $cmd )
TYPE=$( type -t ${pcmd:-$cmd} )
s/\x00/␀/g; # seems like 00 => 2400
s/\x07/␇/g; # and 07 => 2407 … implies that there's
# an easy transform that would literally do
# \x00 — \0x20 → \u2400 — \u2420 automatically.
# damned if I know it though.
__END__
#perl corgifex suggests something like: "\0\1\2"; s/([\x00-\x1f])/"\x{2400}" | $1/eg
@jettero
jettero / .vimrc
Last active August 29, 2015 14:08
Got tired of having all those swap files in the current dir and having them sync over Dropbox or show up in git tracking GUI windows and things
" … blah …
" WARNING: There are probably security problems with using /tmp/ for this!!! \o/
" If this directory isn't owned by the current user and not world writable,
" it's highly likely nefarious evildoers could elite haxx into your vim
" memories through the swap files. (… project for later …)
" (:-2 to remove end of line)
" &g:directory is the global option directory
" let &g:directory="poo" is roughly equiv to set dir=poo
#!/usr/bin/perl
use common::sense;
my $trials = shift // 1_000;
my $orig_t = $trials;
my $DOORS = shift // 3;
my $switch_wins = 0;
my $stay_wins = 0;
#!/bin/bash
#
# AUTHOR: Paul Miller <jettero@cpan.org>
# RE: This relates to a quest: https://github.com/Nuand/bladeRF/issues/386
# PREREQ:
# http://gnuradio.org/redmine/projects/gnuradio/wiki/GRAndDeps
# http://gnuradio.org/redmine/projects/gnuradio/wiki/GRAndBuild
#
ARGS=()
@jettero
jettero / c-blocks-test.pl
Last active August 29, 2015 14:26
just playing with c-blocks
#!/usr/bin/perl
use common::sense;
use C::Blocks;
use C::Blocks::PerlAPI;
cblock {
printf("hello world\n");
}
@jettero
jettero / .gitignore
Last active August 29, 2015 14:26
wanted to check out D Language for a few years now — just build LDC 0.15.2 beta2
*.o
*.elf
hello
#!/usr/bin/perl
use common::sense;
use Text::CSV;
use Data::Dump qw(dump);
our $csv = Text::CSV->new({binary=>1}) or die "cannot use CSV: " . Text::CSV->error_diag;
$csv->eol("\n");
open my $ufh, "user-list.csv" or die "error opening udata.csv: $!";
@jettero
jettero / blogger_content_warning_.user.js
Created April 15, 2009 12:40
my favorite gm scripts all on one page
// ==UserScript==
// @name Blogger Content Warning Autoskip
// @namespace http://www.kuribo.info/
// @include https://www.blogger.com/blogin.g?blogspotURL=*
// ==/UserScript==
(function () {
var link = document.getElementById("continueButton");
if (link) {
location.href = link.href;
@jettero
jettero / knock.pl
Created April 20, 2009 15:41
a collection of random perl scripts
#!/usr/bin/perl
# Copyright 2009 - Paul Miller - GPL
# trivial port knocker script
use strict;
use IO::Socket::INET;
use Getopt::Long;
my ($h, @p);
GetOptions("host=s"=>\$h, "port=s"=>\@p);