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
while true; do echo "HELLO FROM THE OTHER SIDE" | perl -MIO::Socket::INET -ne 'BEGIN{$l=IO::Socket::INET->new(LocalPort=>31337,Proto=>"tcp",Listen=>5,ReuseAddr=>1);$l=$l->accept}print $l $_';done |
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
#!/bin/bash | |
# RancherOS docker version updater. | |
# Author: @rajiteh | |
# License: BSD | |
# | |
# How to use: | |
# You need to use a persistent console (tested on ubuntu). | |
# Set up the script to be called at console initalization time. | |
# | |
# Example cloud-config.yml usage. |
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
$LogLineContext = "MAIN" | |
Function LogLine($msg, $context) | |
{ | |
if($context -ne $null) { | |
$script:LogLineContext = $context | |
} | |
Write-host "[$($LogLineContext)]:" $msg | |
} | |
function RunCommand($cmd) { |
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 bash | |
# This script should be run periodically to ensure that dhclient process is active. | |
pidfile_glob="/run/dhclient*" | |
regex="/run/dhclient\.([a-z]+[0-9]+)\.pid" | |
matched=0 | |
function _logger() { | |
logger "DHCLIENT KEEPALIVE: " $@ | |
echo "DHCLIENT KEEPALIVE: " $@ | |
} |
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
var withJquery = function(callback, version) { | |
if (typeof version == "undefined") { version = "2.1.1"; } | |
var script = document.createElement("script"); | |
script.src = "https://code.jquery.com/jquery-" + version + ".min.js"; | |
script.type = "text/javascript"; | |
document.getElementsByTagName("head")[0].appendChild(script); | |
var interval = setInterval(function() { | |
if (typeof jQuery === "function") { | |
window.$ = jQuery; | |
clearInterval(interval); |
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
/* | |
Traverses a defined set of collections and replaces a nested value in the document. Nested arrays handled automatically. | |
Author: @rajiteh | |
Usage: | |
var searches = | |
{ | |
'collection_name': [ | |
[ 'key', 'sub_key', 'sub_sub_key', ... ], // Path to target value. | |
... |
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
/* | |
Recursively traverses all collections and objects/arrays contained within documents replacing every | |
instance of 'find' with 'replace'. | |
mongo <db_name> mongo_search_and_replace.js | |
*/ | |
function escapeRegExp(str) { | |
return str.replace(/[\-\[\]\/\{\}\(\)\*\+\?\.\\\^\$\|]/g, "\\$&"); | |
} |
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
--- | |
# ^^^ YAML documents must begin with the document separator "---" | |
# | |
#### Example docblock, I like to put a descriptive comment at the top of my | |
#### playbooks. | |
# | |
# Overview: Playbook to bootstrap a new host for configuration management. | |
# Applies to: production | |
# Description: | |
# Ensures that a host is configured for management with Ansible. |
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
<?php | |
class LaravelTestDatabaseBootstrapper { | |
protected static $_instance; | |
protected $projectRoot; | |
protected $envFile; | |
protected $app = null; | |
protected function __construct($envFile, $projectRoot) { |
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
// Use Gists to store code you would like to remember later on | |
console.log(window); // log the "window" object to the console |