Skip to content

Instantly share code, notes, and snippets.

vumaasha /
Created Sep 29, 2013
Installing solr on jetty 9. Downloads jetty and solr from the given urls and installs the sample core collection1 in solr in jetty 9. Also creates a use for jetty and installs jetty as a service. *Run the script as super user or using sudo in ubuntu.*
# set the configuration variables below, before running the script
# get the solr nightly build download link from
View gist:5884472
description "service"
start on filesystem
stop on runlevel S
respawn limit 10 5
oom never
kill timeout 86400 #If it's given a stop order, this is how long it will take to stop.
willurd /
Last active Dec 7, 2021
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
gkossakowski /
Created Jun 3, 2013
YourKit probe class that allows one to capture memory snapshots after certain phases has run in the Scala compiler.
import com.yourkit.probes.*;
import com.yourkit.api.*;
public class MemoryProbe {
public static void onEnter(@This run) {
scala.reflect.internal.Phase patmatPhase = run.phaseNamed("patmat");
scala.reflect.internal.Phase postErasurePhase = run.phaseNamed("posterasure");
scala.reflect.internal.Phase icodePhase = run.phaseNamed("icode");
bmfurtado / cssh.applescript
Last active Jul 28, 2020
Create multiple SSH sessions in split panes on iTerm2 and enable key broadcasting.
View cssh.applescript
Moved to:
juddflamm / gist:5391938
Last active Jul 13, 2018
Enabling 2 Way SSL Client Service Calls from within Dropwizard. To do so, you need to load your keystore and truststore and configure HttpClient to us them for HTTPS calls. In this case, my keystore and truststore are the same file with the same password. (Thanks to Coda Hale for an initial solution)
View gist:5391938
//First create the httpClient in Dropwizard's run method as documented
final HttpClient httpClient = new HttpClientBuilder().using(configuration.getHttpClient()).build();
try {
//Create KeyStore obejcts for both the keystore and truststore
KeyStore keystore = KeyStore.getInstance(KeyStore.getDefaultType());
KeyStore truststore = KeyStore.getInstance(KeyStore.getDefaultType());
//Then load the actual keystore/truststore file(s), they are the same file in my case
keystore.load(new FileInputStream(configuration.getKeyStore()), configuration.getKeyStorePassword().toCharArray());
cemo / rate_limit.js
Created Nov 21, 2012 — forked from mattheworiordan/rate_limit.js
Rate limiting function calls with JavaScript and Underscore.js
View rate_limit.js
/* Extend the Underscore object with the following methods */
// Rate limit ensures a function is never called more than every [rate]ms
// Unlike underscore's _.throttle function, function calls are queued so that
// requests are never lost and simply deferred until some other time
// Parameters
// * func - function to rate limit
// * rate - minimum time to wait between function calls
// * async - if async is true, we won't wait (rate) for the function to complete before queueing the next request
View gist:3841860
public ServletContainer getJerseyContainer(DropwizardResourceConfig resourceConfig,
MyServiceConfig serviceConfig) {
// I like having a root module, but you can use as many as you like
final Injector injector = Guice.createInjector(new MyServiceModule(serviceConfig));
return new GuiceContainer(injector) {
public ResourceConfig getDefaultResourceConfig(Map<String,Object> props, WebConfig webConfig) {
smougenot / A_Logstash.conf
Created Jul 26, 2012
Logstash Multiline Filter for Java Stacktrace (tested on field)
View A_Logstash.conf
# stacktrace java as one message
multiline {
#type => "all" # no type means for all inputs
pattern => "(^.+Exception: .+)|(^\s+at .+)|(^\s+... \d+ more)|(^\s*Caused by:.+)"
what => "previous"
View tmux-cheatsheet.markdown

tmux shortcuts & cheatsheet

start new:


start new with session name:

tmux new -s myname