Skip to content

Instantly share code, notes, and snippets.

View renevo's full-sized avatar
🌩️
Building a private cloud!

Tom Anderson renevo

🌩️
Building a private cloud!
View GitHub Profile
@renevo
renevo / gist:3844304
Created October 6, 2012 07:22
Minecraft Launch
private static void AutoLaunchApplication(IEnumerable<string> commandLineOptions)
{
const string java6Location = @"C:\Program Files\Java\jre6\bin\javaw.exe";
const string java7Location = @"C:\Program Files\Java\jre7\bin\javaw.exe";
var javaLocation = File.Exists(java7Location) ? java7Location : java6Location;
// check for java - eww
if (!File.Exists(javaLocation)) // default java location for both 32/64 bit
{
@renevo
renevo / gist:3844307
Created October 6, 2012 07:22
NativeMethods
public static class NativeMethods
{
public static IntPtr GetAndSetWindowFullScreenWindowed(string windowTitle)
{
var minecraftWindow = FindWindowEx(IntPtr.Zero, IntPtr.Zero, null, windowTitle);
if (minecraftWindow == IntPtr.Zero)
{
return IntPtr.Zero;
}
@renevo
renevo / program.cs
Last active December 25, 2015 20:29
Pulling ModPack from Git using NGit
using System;
using System.IO;
using NGit;
using NGit.Api;
// USES NuGet package ngit2 for Git.
namespace GitTest
{
class Program
@renevo
renevo / program.cs
Created August 16, 2015 22:34
Simple akka.net
public class Program
{
public static void Main(string[] args)
{
using (var system = ActorSystem.Create("MyAkka"))
{
IActorRef tester = system.ActorOf<TestActor>("Test");
tester.Tell("Hello");
Console.ReadLine();
@renevo
renevo / licensecheck.js
Created August 27, 2015 05:48
Simple way to output all licenses
console.log('This is how wars begin');
var checker = require('license-checker');
checker.init({
start: './'
}, function(json) {
Object.keys(json).forEach(function(license) {
console.log('%s License: %s', license, json[license].licenses);
});
@renevo
renevo / mods.txt
Last active February 21, 2017 04:41
1.11.2 Vanilla Mod List
Server:
fast leaf decay
https://minecraft.curseforge.com/projects/fastleafdecay
AromaCore/Backup
https://minecraft.curseforge.com/projects/aromabackup
Simple harvest
https://minecraft.curseforge.com/projects/simpleharvest
@renevo
renevo / temp
Created March 12, 2017 06:48
Outputs CPU temperature for Mericans...
awk '{printf("%.1f°F\n",(($1*1.8)/1e3)+32)}' /sys/class/thermal/thermal_zone0/temp
@renevo
renevo / dockaplz
Last active March 13, 2017 23:45
Cleans all the docker stuff
docker stop $(docker ps -a -q)
docker rm $(docker ps -a -q)
docker rmi $(docker images -a -q) --force
docker volume prune -f
docker network prune -f
@renevo
renevo / scale
Created March 15, 2017 22:02
Scales compose on run
docker-compose up -d && docker-compose scale node=4 && docker-compose up -d
@renevo
renevo / compose.cmd
Last active March 15, 2017 22:54
nginx reload on compose scale
docker-compose up -d
docker-compose scale node=3
docker-compose up -d
for /f %%i in ('docker ps -f "Name=nginx_instance_name_from_compose" -q') do set CONTAINER_ID=%%i
echo FOUND CONTAINER ID %CONTAINER_ID%
docker exec %CONTAINER_ID% nginx -s reload