Skip to content

Instantly share code, notes, and snippets.

@MOZGIII
MOZGIII / .screenrc
Last active January 4, 2016 17:49
Minecraft Server Upstart Script (with multi-user screen support)
multiuser on
acladd user1
acladd user2
acladd user3
password none
@MOZGIII
MOZGIII / vagrant virtualbox 4.3.10 fix
Last active August 29, 2015 14:00
vagrant virtualbox 4.3.10 fix
sudo ln -s /opt/VBoxGuestAdditions-4.3.10/lib/VBoxGuestAdditions /usr/lib/VBoxGuestAdditions
@MOZGIII
MOZGIII / designer.html
Created October 3, 2014 18:05
designer
<link rel="import" href="../notification-elements/notification-alert.html">
<polymer-element name="my-element">
<template>
<style>
:host {
position: absolute;
width: 100%;
height: 100%;
cross :: Fractional a => [a] -> [a] -> [a]
cross u v
| length u == 3 && length v == 3 =
[u !! 1 * v !! 2 - u !! 2 * v !! 1,
u !! 2 * v !! 0 - u !! 0 * v !! 2,
u !! 0 * v !! 1 - u !! 1 * v !! 0]
| otherwise = error "Cross product only supported for 3d vectors"
dot :: Fractional a => [a] -> [a] -> a
dot us vs = sum (zipWith (*) us vs)
#!/usr/bin/env ruby
class State
attr_accessor :layers, :iterations
attr_accessor :success_rate, :time
def self.csv_headers
"layers,iterations,success_rate,time"
end
@MOZGIII
MOZGIII / twitch
Last active August 29, 2015 14:27
A tiny wrapper for livestreamer to watch twitch streams
#!/usr/bin/env python3
import sys
import os
if len(sys.argv) < 2:
print("Usage: %s [stream_name | http://stream_url]" % sys.argv[0])
sys.exit(2)
stream_url = sys.argv[1]
if not stream_url.startswith('http://') and not stream_url.startswith('https://'):
#!/usr/bin/env ruby
ENV['BUNDLE_GEMFILE'] ||= File.expand_path('../../Gemfile', __FILE__)
ENV["BUNDLE_IGNORE_CONFIG"] = 'true'
install_only = ARGV.to_a.map(&:to_sym)
install_only = [:host] if install_only.empty?
require 'bundler'
Bundler.configure
@MOZGIII
MOZGIII / gitlab.rb
Created June 26, 2016 17:34
Gitlab configuration in custom file
# ...
def load_file(file); eval(File.read(file), binding, file); end
load_file '/etc/gitlab/gitlab-custom.rb'
@MOZGIII
MOZGIII / extend.sh
Last active September 24, 2016 19:27
CAC disk size extension
#!/bin/bash
pvcreate /dev/sda3
vgextend localhost-vg /dev/sda3
lvextend /dev/localhost-vg/root -l +100%FREE
resize2fs /dev/mapper/localhost--vg-root
@MOZGIII
MOZGIII / debain-installer-armhf-pxe-boot
Last active October 1, 2017 16:16
Running debian installer via PXE boot (on cubox-i, but may help you on other platforms)
run findfdt
run bootcmd_dhcp