Skip to content

Instantly share code, notes, and snippets.

/etc/network/interfaces
# This file describes the network interfaces available on your system
# and how to activate them. For more information, see interfaces(5).
source /etc/network/interfaces.d/*
# The loopback network interface
auto lo
iface lo inet loopback
How to get into Docker for MAC to adjust DNS:
- docker run -it --privileged --pid=host ubuntu:latest nsenter -t 1 -m -u -n -i sh
@aspyker
aspyker / instructions.txt
Created January 27, 2016 21:55
Updating Hipchat's room avatars
Note: I wasn't (yet) able to get this to work, but adding here so maybe someone else gets further:
- get your host name for the API .. something like COMPANYNAME.hipchat.com
- create an oauth token for your user through the hipchat web UI, lets say it is OAUTHKEY with all permissions
- find an image you want to use for your room avatar and get the base64 encoded version using a tool like:
https://www.base64-image.de/
- save the image to with the below contents, let's say as avatar.json:
{ "avatar" : "base64encodinghere" }
var http = require('http');
const PORT=7001;
function handleRequest(req, res){
console.log(req.connection.remoteAddress + " " + req.method + " " + req.url);
res.statusCode = 400;
res.end("This registry no longer supported, see http://userpage"); // update userpage to instructions of where to use now
}
var server = http.createServer(handleRequest);
xxx's are to protect the innocent
time="2015-10-22T19:10:07.859041867Z" level=debug msg="authorizing request"...
time="2015-10-22T19:10:07.859144898Z" level=debug msg=GetImageLayer...
time="2015-10-22T19:10:07.859212716Z" level=debug msg="(*layerInfoCache).Fetch...
time="2015-10-22T19:10:07.859263105Z" level=debug msg="(*layerStore).Fetch...
time="2015-10-22T19:10:07.892128979Z" level=info msg="s3.GetContent(...
time="2015-10-22T19:10:07.964998121Z" level=info msg="s3.Stat(...
time="2015-10-22T19:10:11.328120032Z" level=info msg="s3.Stat(...
time="2015-10-22T19:10:11.328204918Z" level=info msg="(*layerInfoCache).Fetch...
@aspyker
aspyker / online tools
Created September 17, 2015 16:39
UTC/PST time conversions
http://currentmillis.com/
http://stackoverflow.com/questions/19302129/wildcard-over-ssh-not-working
@aspyker
aspyker / gist:7eed4c41f2de2755add4
Last active August 29, 2015 14:21
Gradle tricks
./gradlew -q subproject:dependencyInsight --dependency group.modulename
./gradle -q subproject:dependencies --configuration runtime
@aspyker
aspyker / gist:2a9ecaed1a2c79f1b0d6
Last active April 27, 2021 00:25
running jmxterm from command line to force gc
wget http://downloads.sourceforge.net/project/cyclops-group/jmxterm/0.2/jmxterm-0.2-uber.jar
a@a:~$ java -jar jmxterm-0.2-uber.jar
Welcome to JMX terminal. Type "help" for available commands.
?$ open localhost:8076
Connection to localhost:8076 is opened
>$ bean java.lang:type=Memory
bean is set to java.lang:type=Memory
>$ run gc
calling operation gc of mbean java.lang:type=Memory
@aspyker
aspyker / gist:a03d263491cc80a4a5bb
Created April 22, 2015 06:17
question on exception handling and scala val/var
// trying to use a val (what I'd like to do somehow)
try {
val someThing = getSomeThingThatCouldThrowException()
}
finally {
if (someThing != null) someThing.close()
}
// foreced to use a var (what works)
var something = null