Skip to content

Instantly share code, notes, and snippets.

View cpanxaoc's full-sized avatar

Brian Manning cpanxaoc

View GitHub Profile
#!/usr/bin/perl
#
# The GtkListStore is used to store data in list form, to be used
# later on by a GtkTreeView to display it. This demo builds a
# simple GtkListStore and displays it. See the Stock Browser
# demo for a more advanced example.
#
# Perl version by Dave M <dave.nerd@gmail.com>
use strict;
@cpanxaoc
cpanxaoc / gist:6178556dd4426becd9b7
Last active August 29, 2015 14:21
Rex iptables DSL example
iptables table => q(filter),
append => q(INPUT),
protocol => q(tcp),
match => q(state),
state => q(NEW),
dport => 22,
jump => q(ACCEPT);
iptables table => q(filter),
append => q(INPUT),
protocol => q(tcp),
@cpanxaoc
cpanxaoc / gist:4063ba92d5a97f3b8560
Created May 20, 2015 23:33
gcc -v for Debian Wheezy
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-linux-gnu/4.7/lto-wrapper
Target: x86_64-linux-gnu
Configured with: ../src/configure -v --with-pkgversion='Debian 4.7.2-5' --with-bugurl=file:///usr/share/doc/gcc-4.7/README.Bugs --enable-languages=c,c++,go,fortran,objc,obj-c++ --prefix=/usr --program-suffix=-4.7 --enable-shared --enable-linker-build-id --with-system-zlib --libexecdir=/usr/lib --without-included-gettext --enable-threads=posix --with-gxx-include-dir=/usr/include/c++/4.7 --libdir=/usr/lib --enable-nls --with-sysroot=/ --enable-clocale=gnu --enable-libstdcxx-debug --enable-libstdcxx-time=yes --enable-gnu-unique-object --enable-plugin --enable-objc-gc --with-arch-32=i586 --with-tune=generic --enable-checking=release --build=x86_64-linux-gnu --host=x86_64-linux-gnu --target=x86_64-linux-gnu
Thread model: posix
gcc version 4.7.2 (Debian 4.7.2-5)
@cpanxaoc
cpanxaoc / gist:24d94a0bb1df2e525555
Created May 22, 2015 01:15
Output of convert_item_to_head2.pl
==== Checking module Rex.pm ====
9 header: =head1 NAME
13 header: =head1 DESCRIPTION
19 header: =head1 GETTING HELP
21 over(1): =over 4
23 item: =item * Web Site: L<http://rexify.org/>
25 item: =item * IRC: irc.freenode.net #rex
27 item: =item * Bug Tracker: L<https://github.com/RexOps/Rex/issues>
29 item: =item * Twitter: L<http://twitter.com/jfried83>
31 back: =back
@cpanxaoc
cpanxaoc / gist:3bb97b202794668cb547
Created May 27, 2015 23:25
Rex task/batch regex for ctags
my $regex = qr/
^task[ \t]* "([a-zA-Z0-9_]+)"\s{0,},
|^task[ \t]*q{1,2}\(([a-zA-Z0-9_-]+)\)\s{0,},
|^batch[ \t]*"([a-zA-Z0-9_-]+)"\s{0,},
|^batch[ \t]*q{1,2}\(([a-zA-Z0-9_-]+)\)\s{0,},
/x;
@cpanxaoc
cpanxaoc / gist:32599c599ac1ac3fbace
Created May 28, 2015 22:39
Output of 'ctags --list-kinds=perl
[ёжик][bdmanning ~]$ ctags --list-kinds=perl
ctags: Warning: Language "perl" already defined
c constants
f formats
l labels
p packages
s subroutines
d subroutine declarations [off]
t task
t task
@cpanxaoc
cpanxaoc / gist:f1cee7b5a8010515974f
Created May 28, 2015 23:25
Updated taglist.vim that has Rex DSL function names, so they show up when using taglist in VIM
diff --git a/plugin/taglist.vim b/plugin/taglist.vim
index 59901f6..74303d0 100644
--- a/plugin/taglist.vim
+++ b/plugin/taglist.vim
@@ -432,7 +432,8 @@ let s:tlist_def_make_settings = 'make;m:macro'
let s:tlist_def_pascal_settings = 'pascal;f:function;p:procedure'
" perl language
-let s:tlist_def_perl_settings = 'perl;c:constant;l:label;p:package;s:subroutine'
+let s:tlist_def_perl_settings = 'perl;b:batch;t:task;'
@cpanxaoc
cpanxaoc / gist:616dcc9a2348fddf646d
Created June 2, 2015 21:00
Methods/Functions from Rex (Rex DSL) for VIM
" Methods/Functions from Rex (Rex DSL)
" Borrowed from https://gist.github.com/ferki/d83ebd67ce828ef9d00f
syn keyword perlStatementScalar cache cat desc ensure extract groups_file
\ LOCAL needs password path private_key
\ public_key rm sayformat sudo sudo_password
\ unlink update_package_db update_system user
syn keyword perlStatementList account append_if_no_such_line
\ append_or_amend_line batch chgrp chmod
\ chown clearpart cmdb cp create_user
\ cron_entry file get ln pkg run run_task
utf8 "\x82" does not map to Unicode at /Users/cpanxaoc/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Path/Tiny.pm line 1445.
utf8 "\xA8" does not map to Unicode at /Users/cpanxaoc/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Path/Tiny.pm line 1445.
utf8 "\xBD" does not map to Unicode at /Users/cpanxaoc/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Path/Tiny.pm line 1445.
utf8 "\xFB" does not map to Unicode at /Users/cpanxaoc/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Path/Tiny.pm line 1445.
utf8 "\xC9" does not map to Unicode at /Users/cpanxaoc/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Path/Tiny.pm line 1445.
utf8 "\xE6" does not map to Unicode at /Users/cpanxaoc/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Path/Tiny.pm line 1445.
utf8 "\xBE" does not map to Unicode at /Users/cpanxaoc/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Path/Tiny.pm line 1445.
utf8 "\xAD" does not map to Unicode at /Users/cpanxaoc/.plenv/versions/5.20.2/lib/perl5/site_perl/5.20.2/Path/Tiny.pm lin
grep -v name Top1000.csv | awk -F',' '{print $1}' | sort -u | perl -nE'chomp($_); $_ = lc($_);say ucfirst($_) . q( ) . length($_);' | tee last_names.txt