Skip to content

Instantly share code, notes, and snippets.

View bortels's full-sized avatar

Tom Bortels bortels

  • Simi Valley, CA, USA
View GitHub Profile
@bortels
bortels / gist:d33bb54d2f98f9e5eb21
Last active August 29, 2015 14:22
Exposing a port on a running docker container

So - that was just complex enough that it might be nice to document and share it.

So - I am using docker and --link to expose a redis database to only the apps that use it. Which (as of now) is fine, so long as those apps are on the same host. But - I wanted to use the redis 'slaveof' command to quickly replicate the data to another redis running on a different host. Yes - I could grab the db from disk, scp, and restore. But it's handy to be able to quickly spawn a new copy elsewhere. I could not simply restart the original redis container exposing ports, because it is prod with people reading/writing to it.

So - The solution that works is: Run a new container, exposing the port you want, linked to the original container - and use socat to bridge the internal link to the external port.

While doing wildly unrelated research, I came across the "AI Box Experiment" pages. After reading a bit, I was surprised to see ANY outcomes where the AI was let out; it seems fairly self-evident to me this should not happen. Because the conversations are private, I have not seen the arguments the AI player made - but while thinking about it, I suspect I can make a Gatekeeper argument that can counter them all - ie. I can argue to keep it in the box, and what the AI says is irrelevant.

Here is the argument, in the form of a "proof". I hesitate to use that term - it lack the rigor of a proper proof - but it is perhaps the framework or outline of a real proof, if you agree that the logic is basically sound. If you do not - I, personally, would appreciate reasonable, supported arguments about where it fails. I trust this community will not fall prey to the usual tropes of wishful thinking and so on. I would ask you follow each item, and only proceed if you agree; like any

@bortels
bortels / keybase.md
Last active August 29, 2015 14:04
keybase.md

Keybase proof

I hereby claim:

  • I am bortels on github.
  • I am bortels (https://keybase.io/bortels) on keybase.
  • I have a public key whose fingerprint is 6360 00D7 9A8E 8882 E5EE 296D 4740 D330 5224 5B90

To claim this, I am signing this object:

@bortels
bortels / vmware_support_fail
Created July 7, 2014 19:20
vmware support
tbortels [12:03 PM]
Sigh. "For fastest results, use email" - ok, i prefer that. Go thru making request, fill out nice details, "Unable to Complete Your Request
The content is unavailable." boom
tbortels [12:04 PM]
so - I'm moving on to phone contact. grr
tbortels [12:09 PM]
I give up. vmware phone support is useless, unless someone can show me the "give me a live person" button.
@bortels
bortels / README.md
Created July 1, 2014 23:58
Messing with infonodes

Inspired by http://bl.ocks.org - this is me trying to learn d3, especially regarding the interactive node stuff.

If you see me doing something bloody insane - don't pity me, or laugh, teach me the right way!

This started with a flat-out copy-paste of one of Mike's force-directed tree demos - http://bl.ocks.org/mbostock/1062288

No promises are made as to how functional it will be before I get distracted by bright lights and pretty colors.

@bortels
bortels / arraynotes
Created July 1, 2014 06:54
stuff I should have remembered from school
The below is ruby(ish) - but is really about matrix math
array.transpose flips array around diagonal axis (UL to LR):
a = [[1, 2, 3],
[4, 5, 6],
[7, 8, 9]]
a.transpose => [[1, 4, 7],
[2, 5, 8],
<link rel="import" href="../cool-clock/cool-clock.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
@bortels
bortels / addip.pl
Created January 27, 2014 20:55
Add Host Record (A and PTR) to infoblox via WAPI
#!/usr/bin/perl
# Add an IP to infoblox
# Note a valid login is required. You can use your own for testing, but for
# long term use, please request a svc_ service account for your script.
use LWP::UserAgent;
use JSON;
# We expect a fully-qualified DNS name and IP on the command line
@bortels
bortels / backupipad.pl
Created January 20, 2014 19:42
Backup my jailbroken iPad nightly to my unix box
#!/usr/bin/perl
# Backup ipad app Documents folders in a sane manner
# Expects public key login (ie. no password) as user "mobile"
$dest = '/backups/ipaddocs';
$find = 'find ./ -maxdepth 2 -name "*.app" -type d';
$appdir = '/private/var/mobile/Applications';
open (I, "ssh -n mobile\@192.168.1.86 'cd $appdir ; $find' |");
@bortels
bortels / openhtml5console.ps1
Created December 11, 2013 01:26
Open Remote VMWare Console in powershell
# Based on http://sourceforge.net/p/vghetto/code/HEAD/tree/scripts/generateHTML5VMConsole.pl#l54
# Requires Openssl - get it from http://www.openssl.org/related/binaries.html
$openssl = "C:\OpenSSL-Win64\bin\openssl.exe"
$vm = get-vm -name "canary"
# Get the session associated with the vcenter this VM is on. Ugly Hack.
# /VIServer=tbortels@dcacloudvc.diginsite.net:443/VirtualMachine=VirtualMachine-vm-804/
$uid = $vm.uid