Skip to content

Instantly share code, notes, and snippets.

View Xorlev's full-sized avatar

Michael Rose Xorlev

View GitHub Profile
@Xorlev
Xorlev / osx-10.11-setup.md
Created October 26, 2015 17:14 — forked from kevinelliott/osx-10.11-setup.md
Mac OS X 10.11 El Capitan Setup

Mac OS X 10.11 El Capitan

Custom recipe to get OS X 10.11 El Capitan running from scratch, setup applications and developer environment. This is very similar (and currently mostly the same) as my 10.10 Yosemite setup recipe (as found on this gist https://gist.github.com/kevinelliott/0726211d17020a6abc1f). Note that I expect this to change significantly as I install El Capitan several times.

I use this gist to keep track of the important software and steps required to have a functioning system after a semi-annual fresh install. On average, I reinstall each computer from scratch every 6 months, and I do not perform upgrades between distros.

This keeps the system performing at top speeds, clean of trojans, spyware, and ensures that I maintain good organizational practices for my content and backups. I highly recommend this.

You are encouraged to fork this and modify it to your heart's content to match your own needs.

@Xorlev
Xorlev / RateLimitingForwardingSpout.java
Created October 24, 2014 18:27
A rate limited spout wrapper using Archaius dynamic properties to control overall rate limit. Interrogates Storm for total number of spouts to divide rate limit evenly between spout instances.
package com.fullcontact.storm.spout;
import backtype.storm.spout.SpoutOutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.IRichSpout;
import backtype.storm.topology.OutputFieldsDeclarer;
import com.google.common.util.concurrent.RateLimiter;
import com.netflix.config.DynamicDoubleProperty;
import com.netflix.config.DynamicPropertyFactory;
import org.slf4j.Logger;
@Xorlev
Xorlev / gist:9676261f61c5be7a6e44
Created July 28, 2014 17:43
Java 8 - SSL Concurrency Issues
New I/O worker #21 [BLOCKED] CPU time: 1s
java.security.Provider.getService(String, String)
sun.security.jca.ProviderList$ServiceList.tryGet(int)
sun.security.jca.ProviderList$ServiceList.access$200(ProviderList$ServiceList, int)
sun.security.jca.ProviderList$ServiceList$1.hasNext()
javax.crypto.KeyGenerator.nextSpi(KeyGeneratorSpi, boolean)
javax.crypto.KeyGenerator.<init>(String)
javax.crypto.KeyGenerator.getInstance(String)
sun.security.ssl.JsseJce.getKeyGenerator(String)
sun.security.ssl.HandshakeMessage$Finished.getFinished(HandshakeHash, int, SecretKey)

Keybase proof

I hereby claim:

  • I am xorlev on github.
  • I am xorlev (https://keybase.io/xorlev) on keybase.
  • I have a public key whose fingerprint is 106C 2C05 76E1 3B35 69B0 B2CA 1606 E6ED 31AD 179A

To claim this, I am signing this object:

$ sudo /opt/java7/bin/jmap -permstat 21101
Attaching to process ID 21101, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 24.51-b03
finding class loader instances ..sun.jvm.hotspot.debugger.UnmappedAddressException: cb953000
at sun.jvm.hotspot.debugger.PageCache.checkPage(PageCache.java:208)
at sun.jvm.hotspot.debugger.PageCache.getData(PageCache.java:63)
at sun.jvm.hotspot.debugger.DebuggerBase.readBytes(DebuggerBase.java:217)
at sun.jvm.hotspot.debugger.linux.LinuxDebuggerLocal.readCInteger(LinuxDebuggerLocal.java:482)
// To force synchronous .queue() behavior
ConfigurationManager.getConfigInstance()
.setProperty("hystrix.command."+ReportUsageCommand.class.getSimpleName()+".execution.isolation.strategy", "SEMAPHORE");
new ReportUsageCommand(my, ctor, args).queue(); // is now synchronous.
@Xorlev
Xorlev / MultipleStreamBolt.java
Last active April 7, 2019 15:31
Example of emitting on multiple streams
package storm.examples;
import backtype.storm.task.OutputCollector;
import backtype.storm.task.TopologyContext;
import backtype.storm.topology.OutputFieldsDeclarer;
import backtype.storm.topology.base.BaseRichBolt;
import backtype.storm.tuple.Fields;
import backtype.storm.tuple.Tuple;
import backtype.storm.tuple.Values;
import java.util.Map;
@Xorlev
Xorlev / MutationUtils.java
Created December 11, 2013 05:20
Utils useful for making ColumnFamilyOutputFormat work with CQL3 tables (CQL3 is all composite types)
package com.fullcontact.hadoop.cassandra;
import com.google.common.collect.Lists;
import org.apache.cassandra.db.marshal.AbstractType;
import org.apache.cassandra.db.marshal.CompositeType;
import org.apache.cassandra.db.marshal.UTF8Type;
import org.apache.cassandra.thrift.Column;
import org.apache.cassandra.thrift.ColumnOrSuperColumn;
import org.apache.cassandra.thrift.Mutation;
import org.apache.cassandra.utils.ByteBufferUtil;
@Xorlev
Xorlev / kato.js
Last active December 24, 2015 10:09
Kato.im Fluid.app userscript to update the dock badge with the # of unread messages.
// ==UserScript==
// @name Kato.im Fluid Dock Badge
// @description Displays the unread count of messages, adapted from http://userscripts.org/scripts/review/177616
// @author Michael Rose
// ==/UserScript==
window.fluid.dockBadge = '';
setTimeout(updateDockBadge, 1000);
setTimeout(updateDockBadge, 3000);
setInterval(updateDockBadge, 5000);
@Xorlev
Xorlev / MetricsWeb.java
Created September 2, 2013 21:17
Storm embedded webserver
public class MetricsWeb extends BaseTaskHook {
private static final Logger log = LoggerFactory.getLogger(MetricsWeb.class);
private static Server server = null;
private static CuratorFramework zk = null;
private static ServiceDiscovery<Void> dsc = null;
@Override
public void prepare(Map conf, TopologyContext context) {
if ("production".equals(conf.get("environment"))) {
initWebConsole(9090);