Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
#
# setup.sh
# FTP Server Setup
# (c) 2014 Edge Case, Inc. All Rights Reserved.
# [email protected]
#
[ "$(whoami)" != "root" ] && echo "ERROR: root privileges required." && exit 1
export DEBIAN_FRONTEND=noninteractive;
@x684867
x684867 / papertrail_installer
Created September 16, 2014 17:35
This gist contains a script to install papertrail...
#!/bin/bash
#
# (c) 2014 EdgeCase, Inc. All Rights Reserved.
# [email protected]
#
apt-get install rsyslog-gnutls -y
cd /etc
wget https://papertrailapp.com/tools/papertrail-bundle.pem
@x684867
x684867 / JSON-config.js
Last active December 26, 2015 17:49
JSON configuration management utility.
/*
JSON Config (JSON Configuration Management Tools)
(c) 2013 Sam Caldwell. Public Domain
JSON-config.js extends the JSON object to provide tools for validating, managing and interacting
with JSON-based configuration files. This utility may be loaded as follows--
require('JSON-config.js')();
If the above line appears more than once, no harm will occur. A simple notice will appear in
@x684867
x684867 / polymorphic javascript
Last active December 26, 2015 15:09
Polymorphic JavaScript (untested)
function overloadScreenLog(source,pid){
/*
1. Extract the current source code of root.screen.log().
2. Extend its functionality by appending additional code.
3. Eval() the result to create a new method.
*/
var source_code="{"
+"function(){"
+"root.screen.log=function(message){"
+(root.screen.log.toString().replace(/function\ \([a-z]*\)\{*/gm,'')).replace(/\}$/,'')
@x684867
x684867 / gist:7164397
Last active December 26, 2015 14:19
JSON-active.js extends the JSON.commented object (which in turn extends JSON-active) to allow a JSON file which contains both C-Style comments and functions. The JSON specification does not allow either comments or functions. While the lack of comments is poorly justified by most perspectives, the lack of functions is seen as more reasonable. JS…
/*
JSON Active (JSON Object Extension)
(c) 2013 Sam Caldwell. Public Domain
Requires JSON-commented.js
JSON-active.js extends the JSON.commented object (which in turn extends JSON-active) to allow
a JSON file which contains both C-Style comments and functions. The JSON specification does not
allow either comments or functions. While the lack of comments is poorly justified by most
perspectives, the lack of functions is seen as more reasonable. JSON (according to the
@x684867
x684867 / JSON-commented.js
Created October 23, 2013 03:18
I wrote this because I am rebelling against the stupid JSON specification which does not allow for comments. This module extends the JSON object to create JSON.commented which has two methods-- JSON.commented.parse( jsonString ); and JSON.commented.load( jsonFile ); The parse() method will parse a given JSON string ( using JSON.parse() ) but onl…
/*
JSON Commented (JSON Object Extension)
(c) 2013 Sam Caldwell. Public Domain
*/
module.exports=JSON_commented;
function JSON_commented(){
root.JSON.commented={}
root.JSON.commented.parse=function(jsonString){
It is true that the law must be black and white, clearly and easily defined unless an arbitrary and capricious society might
evolve to enslave the masses. Where the law does not exist, the rule of force will prevail at the hands of a mob and a tyrant
will emerge. However, laws must also be written to allow for instantaneous judgement, as those who write the laws are not
infallible. Where the law is defined narrowly and without capacity to consider unforeseen circumstances, the law creates
injustice and oppression.
To believe that justice can be served when the individual's circumstances are ignored over the purity of the law is totalitarian
and bureaucratic. Many conservatives decry the executive discretion implicit in our three-branched form of government with
respect to immigration. When executives at the federal or state level fail to brand illegal immigrants as "criminals" they do
so without applying the same standard to executives at the federal or state level who have asserted an intent (or in som
function init_object(o){ if(typeof(o)==undefined) o={} };
modules.export=function(){
var baseObject="root.config.modules";
var o={}
root.config.modules.forEach(
function(m,i,a){
if(typeof(m)=='object'){
init_object(root.config.modules);
init_object(root.config.modules[m.group]);
/*
/srv/nemesis/app/app.bootstrap.js
Nemesis Web Services Master Process Script
(c) 2013 Sam Caldwell. All Rights Reserved.
root.app
This is the master process (app.bootstrap.js) for the Nemesis web services.
Each of the four (4) web services (audit,broker,cipher,keys) are launched
@x684867
x684867 / gist:6858740
Created October 6, 2013 20:32
Generating password-less self-signed certificates with no user input.
openssl req \
-new \
-newkey rsa:4096 \
-days 365 \
-nodes \
-x509 \
-subj "/C=US/ST=Texas/L=Round Rock/O=Dis/CN=$FQDN" \
-keyout $PRIVATE_KEY \
-out $CRT