Skip to content

Instantly share code, notes, and snippets.

http://cm-anthill.cobaltgroup.com:8080/rest/project/169/workflows
http://cm-anthill.cobaltgroup.com:8080/rest/workflow/1393/buildlives
http://cm-anthill.cobaltgroup.com:8080/rest/buildlife/153956/sourcechanges
http://cm-anthill.cobaltgroup.com:8080/rest/buildlife/153956/tests?reportName=JUnit%20Report
String host = "localhost"; // or some A.B.C.D
int port = 1234;
String url = "service:jmx:rmi:///jndi/rmi://" + host + ":" + port + "/jmxrmi";
JMXServiceURL serviceUrl = new JMXServiceURL(url);
JMXConnector jmxConnector = JMXConnectorFactory.connect(serviceUrl, null);
if (password != null)
jmxEnv = [(JMXConnector.CREDENTIALS): (String[])["monitor", password]]
def connector = JMXConnectorFactory.connect(new JMXServiceURL(serverUrl), jmxEnv)
@varokas
varokas / gist:3335346
Created August 12, 2012 23:33
MongoDB
If this is your first install, automatically load on login with:
mkdir -p ~/Library/LaunchAgents
cp /usr/local/Cellar/mongodb/2.0.7-x86_64/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
If this is an upgrade and you already have the homebrew.mxcl.mongodb.plist loaded:
launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
cp /usr/local/Cellar/mongodb/2.0.7-x86_64/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/
launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
@varokas
varokas / gist:3943458
Created October 24, 2012 03:09
youtube playlist
val pl = "PLFDDE01E5A88B1338"
val url = "https://gdata.youtube.com/feeds/api/playlists/" + pl
import java.io._
val is = new java.net.URL(url).openStream()
val dis = new DataInputStream(new BufferedInputStream(is));
val str = Stream.continually(dis.readLine()).takeWhile( _ != null ).fold("")( _ + _ + "\n" )
@varokas
varokas / socialdj.scala
Created October 25, 2012 00:46
SocialDJ
import java.io._
import scala.util.parsing.json._
def readFromUrl(url:String):String = {
val is = new java.net.URL(url).openStream()
val dis = new DataInputStream(new BufferedInputStream(is));
Stream.continually(dis.readLine()).takeWhile( _ != null ).fold("")( _ + _ + "\n" )
}
@varokas
varokas / eventbrite_to_wp.html
Created November 14, 2012 03:41
Eventbrite to Wordpress processing
<html>
<head>
<script type="text/javascript" src="http://ajax.aspnetcdn.com/ajax/jQuery/jquery-1.8.2.min.js"></script>
<script type="text/javascript" src="http://cdnjs.cloudflare.com/ajax/libs/coffee-script/1.1.2/coffee-script.min.js"></script>
</head>
<body>
<p>Paste the Eventbrite "Sales By Ticket Type" here</p>
<textarea row="10" col="100" id="input"></textarea><br/>
<p>output</p>
<div>Total: <span id="total"></span></div>
@varokas
varokas / gist:4128206
Created November 21, 2012 22:13
cargo integration test
<build>
<plugins>
<plugin>
<!-- START SNIPPET: cargo-plugin -->
<groupId>org.codehaus.cargo</groupId>
<artifactId>cargo-maven2-plugin</artifactId>
<configuration>
<wait>false</wait>
<container>
<containerId>tomcat${tomcat.major}x</containerId>
@varokas
varokas / Linnode
Last active December 10, 2015 11:59
#User. 2 commands
adduser <username>
adduser <username> sudo
#Build essentials
sudo apt-get install build-essential
#ufw
ufw enable
ufw allow OpenSSH
To have launchd start mongodb at login:
ln -sfv /usr/local/opt/mongodb/*.plist ~/Library/LaunchAgents
Then to load mongodb now:
launchctl load ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist
Or, if you don't want/need launchctl, you can just run:
mongod
We recommend prepending the following path to your PATH environment
variable to have npm-installed binaries picked up:
/usr/local/share/npm/bin
@varokas
varokas / nodejs
Last active December 10, 2015 22:39
random = (n) -> require('crypto').randomBytes(n).toString('hex')
#node ubuntu
sudo apt-get install nodejs
sudo apt-get install npm
sudo npm install coffee-script -g
sudo ln -s /usr/bin/nodejs /usr/bin/node