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
<?xml version="1.0"?> | |
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | |
<modelVersion>4.0.0</modelVersion> | |
<groupId>de.ring0.lhw</groupId> | |
<artifactId>system</artifactId> | |
<version>0.0.1-SNAPSHOT</version> | |
<dependencies> | |
<dependency> | |
<groupId>com.almworks.sqlite4java</groupId> | |
<artifactId>sqlite4java</artifactId> |
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 <stdio.h> | |
#include <stdlib.h> | |
#include <stdint.h> | |
#ifdef _MSC_VER | |
#include <intrin.h> /* for rdtscp and clflush */ | |
#pragma optimize("gt",on) | |
#else | |
#include <x86intrin.h> /* for rdtscp and clflush */ | |
#endif |
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
require 'thread' | |
class ProducerConsumer | |
def initialize producers = 5, consumers = 5, queue_size = 5 | |
@producers, @consumers = producers, consumers | |
@queue = SizedQueue.new queue_size | |
@mutex = Mutex.new | |
@threads = [] | |
end | |
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
# Change Java Runtime: | |
sudo update-alternatives --config java | |
# Delete Open-JDK | |
sudo apt-get purge openjdk-\* icedtea-\* icedtea6-\* | |
# Change fonts - remove hinting: | |
http://askubuntu.com/questions/32624/ugly-fonts-in-netbeans-how-can-i-make-it-use-the-system-font | |
# Change RubyMine AntiAliasing first: |
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
# BASH function to get the result | |
# of a ^ b when a, b are in the | |
# following hexadecimal string | |
# form: AF396463D8705 ... | |
# Obtained from here: | |
# http://www.codeproject.com/Tips/470308/XOR-Hex-Strings-in-Linux-Shell-Script | |
# Author is Sanjay1982 (see http://www.codeproject.com/Members/Sanjay1982) | |
# Usage: |
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 | |
# Perform installation as root | |
# Install prereqs | |
yum -y install libcurl libcurl-devel rrdtool rrdtool-devel rrdtool-prel libgcrypt-devel gcc make gcc-c++ | |
# Get Collectd, untar it, make it and install | |
wget http://collectd.org/files/collectd-5.4.0.tar.gz | |
tar zxvf collectd-5.4.0.tar.gz |
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 -xe | |
EBS_DEVICE='/dev/sdh' | |
INSTANCE_ID=$1 | |
AKI=${2:-'aki-5f15f636'} | |
ARI=${3:-'ari-0915f660'} | |
ARCH=${4:-'i386'} | |
SIZE=${5:-10} | |
AZ=${6:-'us-east-1d'} | |
NAME=${7:-"ami-from-$INSTANCE_ID"} |
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
<script src="https://threejs.org/build/three.min.js"></script> | |
<script src="https://threejs.org/examples/js/utils/BufferGeometryUtils.js"></script> | |
<script src="https://threejs.org/examples/js/controls/OrbitControls.js"></script> | |
<script> | |
var noise = ` | |
// | |
// Description : Array and textureless GLSL 2D/3D/4D simplex | |
// noise functions. | |
// Author : Ian McEwan, Ashima Arts. | |
// Maintainer : stegu |
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/env ruby | |
# A simply utility to show character counts for each line of input and | |
# highlight lines longer than 80 characters. | |
# | |
# Written as an example for http://jstorimer.com/2011/12/12/writing-ruby-scripts-that-respect-pipelines.html | |
# | |
# Examples: | |
# | |
# $ hilong Gemfile |
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
/** | |
// Example implementation as follows: | |
public class AWSS3_GetService extends AWS { | |
public override void init() { | |
resource = '/[your bucket]/[your folder 1]/[your folder 2]/[file name].[extension]'; | |
region = 'eu-west-2'; | |
service = 's3'; | |
endpoint = new Url('https://' + service + '.' + region + '.amazonaws.com/'); | |
accessKey = 'SET HERE'; | |
method = HttpMethod.XGET; |