This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Logging | |
def initialize | |
@PROMPTS = { | |
:info => '>>'.bold.green, | |
:warn => '**'.bold.yellow, | |
:error => '!!'.red, | |
:fatal => '!!'.bold.red, | |
:debug => '**'.bold.cyan | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
################################################################################ | |
# # | |
# Copyright (c) 2013, Mike 'Fuzzy' Partin <[email protected]> # | |
# All rights reserved. # | |
# # | |
# Redistribution and use in source and binary forms, with or without # | |
# modification, are permitted provided that the following conditions are met: # | |
# # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ ls | |
./ ../ Python-2.7.4.tar.bz2 car.py* ruby-1.8.6-p420.tar.gz | |
$ ./car.py | |
Sat May 25 19:55:33 2013 | |
objA = Libarchive(fname="/home/mpartin/.cpkg/tmp/ruby-1.8.6-p420.tar.gz", debug=True) | |
DEBUG: Loaded library <CDLL '/usr/lib/libarchive.so', handle 80079d000 at 801775f90> | |
objB = Libarchive(fname="/home/mpartin/.cpkg/tmp/Python-2.7.4.tar.bz2", debug=True) | |
DEBUG: Loaded library <CDLL '/usr/lib/libarchive.so', handle 80079d000 at 80177e0d0> | |
ret = objA.extractArchive() |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
################################################################################ | |
# # | |
# Copyright (c) 2013, Mike 'Fuzzy' Partin <[email protected]> # | |
# All rights reserved. # | |
# # | |
# Redistribution and use in source and binary forms, with or without # | |
# modification, are permitted provided that the following conditions are met: # | |
# # |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'drb' | |
class PingCheck | |
attr_accessor :cfg | |
def initialize(count=3, wait=3) | |
@cfg = Hash.new | |
@cfg[:count] = count | |
@cfg[:wait] = wait |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
slndir() { | |
if [ -z "${1}" ] || [ -z "${2}" ]; then | |
echo 'Usage: slndir /dir1 /dir2/' | |
else | |
SRC=${1} | |
if [ "${2}" = "." ] || [ "${2}" = "./" ]; then | |
DST=${PWD} | |
else | |
DST=${2} | |
fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ cpkg | |
cpkg <command> <...> | |
Commands: | |
list [pkg] List packages or versions of [pkg] | |
use [global|(session)] <pkg>-<ver> Use <pkg>-<ver> | |
drop [global|(session)] <pkg>-<ver> Stop using <pkg>-<ver> | |
In progress: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*- | |
* Copyright (c) 2010 The FreeBSD Foundation | |
* All rights reserved. | |
* | |
* This software was developed by Edward Tomasz Napierala under sponsorship | |
* from the FreeBSD Foundation. | |
* | |
* Redistribution and use in source and binary forms, with or without | |
* modification, are permitted provided that the following conditions | |
* are met: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import os, re, sys, time | |
import subprocess as SP | |
class oList(list): | |
def join(self): | |
retv = '' | |
for i in self: | |
retv += i+' ' |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
require 'find' | |
Find.find(ARGV[0]) do |f| | |
c = ARGV[0].split('/').size | |
d = f.split('/').size | |
e = "#{ENV['CPKG_SESSION_DIR']}/#{f.split('/')[c...d].join('/')}" | |
begin File.symlink(f, e); | |
rescue Errno::EEXIST | |
end | |
end |