This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python | |
import socket # Import socket module | |
from threading import Thread | |
def on_new_client(clientsocket, addr): | |
try: | |
while True: | |
msg = clientsocket.recv(1024) | |
if not msg: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
PID=$(jps | grep Main | awk '{print $1}') | |
CUR=$(jstat -gc $PID | tail -n 1 | awk '{split($0,a," "); sum=a[3]+a[4]+a[6]+a[8]; print sum/1024}') | |
MAX=$(jstat -gccapacity $PID | tail -n 1 | awk '{split($0,a," "); sum=a[2]+a[8]; print sum/1024}') | |
echo $CUR/$MAX |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
### Keybase proof | |
I hereby claim: | |
* I am henrikno on github. | |
* I am henrikno (https://keybase.io/henrikno) on keybase. | |
* I have a public key ASDW-yzrF0xb95QlVFxbM29dhaYqKlvyFAxIienhFwbzFQo | |
To claim this, I am signing this object: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import java.net.InetSocketAddress; | |
import java.util.ArrayList; | |
import java.util.List; | |
import java.util.concurrent.TimeUnit; | |
import java.util.function.Consumer; | |
import org.elasticsearch.action.WriteConsistencyLevel; | |
import org.elasticsearch.action.bulk.BulkItemResponse; | |
import org.elasticsearch.action.bulk.BulkRequestBuilder; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@Override | |
public void takeLeadership(CuratorFramework curatorFramework) throws Exception { | |
ourThread = Thread.currentThread(); | |
logger.debug(format("(%s) Got leadership", ourThread)); | |
try { | |
waitForAndPerformWork(); | |
} catch (InterruptedException e) { | |
logger.debug(format("(%s) Interrupted ", ourThread), e); | |
} finally { | |
logger.debug(format("(%s) No longer leader", ourThread)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[INFO] ------------------------------------------------------------------------ | |
[INFO] Building brave-zipkin-spancollector 2.0.3-SNAPSHOT | |
[INFO] ------------------------------------------------------------------------ | |
[INFO] | |
[INFO] --- maven-clean-plugin:2.4.1:clean (default-clean) @ brave-zipkin-spancollector --- | |
[INFO] Deleting /home/henrik/Dropbox/code/brave/brave-zipkin-spancollector/target | |
[INFO] | |
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ brave-zipkin-spancollector --- | |
[INFO] | |
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ brave-zipkin-spancollector --- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Running com.github.kristofa.brave.resteasyexample.ITRestEasyExample | |
16:20:16,183 INFO [main] server.Server (Server.java:270) - jetty-8.1.9.v20130131 | |
16:20:16,352 INFO [main] webapp.StandardDescriptorProcessor (StandardDescriptorProcessor.java:282) - NO JSP Support for /RestEasyTest, did not find org.apache.jasper.servlet.JspServlet | |
16:20:16,534 INFO [main] handler.ContextHandler$Context (ContextHandler.java:2021) - Initializing Spring FrameworkServlet 'dispatcher' | |
16:20:16,534 INFO [main] servlet.FrameworkServlet (FrameworkServlet.java:454) - FrameworkServlet 'dispatcher': initialization started | |
16:20:16,552 INFO [main] support.AbstractApplicationContext (AbstractApplicationContext.java:510) - Refreshing WebApplicationContext for namespace 'dispatcher-servlet': startup date [Sun Sep 29 16:20:16 CEST 2013]; root of context hierarchy | |
16:20:16,678 INFO [main] support.AnnotationConfigWebApplicationContext (AnnotationConfigWebApplicationContext.java:245) - Found 11 annotated classes in package [com.github.kr |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "Font.h" | |
#include <GL/glew.h> | |
#include <cstdio> | |
#include <cassert> | |
#include <cstdlib> | |
void Font::SetHeight(float h) { | |
m_height = h; | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include "PortAudio.h" | |
#include <portaudio.h> | |
#include <cstdio> | |
float spec_left[512]; | |
float spec_right[512]; | |
PortAudio::PortAudio() { | |
PaError err; | |
err = Pa_Initialize(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -x | |
INRES="1920x1200" | |
OUTRES="1280x720" | |
FPS="30" | |
ffmpeg -f x11grab -s "$INRES" -r "$FPS" -i :0.0 -f alsa -ac 2 \ | |
-i default -vcodec libx264 -s "$OUTRES" \ | |
-acodec libmp3lame -ab 128k -ar 44100 \ | |
-threads 0 -f flv $1 |
NewerOlder