Skip to content

Instantly share code, notes, and snippets.

View artheus's full-sized avatar

Morten Hekkvang artheus

  • SBAB Bank AB
  • Stockholm | Sweden
View GitHub Profile
@artheus
artheus / modpack.sh
Created January 30, 2021 09:05
Shell script for downloading mods for Curseforge Modpack on Linux clients (using Vanilla Minecraft Launcher)
#!/bin/bash
## Usage:
## 1. Download the modpack zip from CurseForge
## 2. Extract zip to where you want your modpacks game directory to be (e.g. ~/minecraft/modpack/gamedir)
## 3. In terminal, run this script in your chosen game directory
## If successful, it should print out which mods its downloading, until it is done
## 4. Create an "Installation" in the Vanilla Minecraft Launcher
## * Version should be set to the correct modded minecraf version installed (eg. 1.16.4-forge-35.1.13)
## * Make sure you are running the correct java version, and are giving an appropriate amount of RAM
@artheus
artheus / inheritance_test.go
Created September 22, 2019 13:38
Golang inheritance example
package encoding
import (
"github.com/stretchr/testify/assert"
"testing"
)
type genericEntity struct {
ID int64
Name string
actually-additions
ae2-stuff
appleskin
applied-energistics-2
baubles
better-builders-wands
bibliocraft
blood-magic
botania
buildcraft
@artheus
artheus / reactor.lua
Created October 28, 2017 11:55
BR Reactor controller script.
local component = require("component")
local r = component.br_reactor
local capacity = r.getEnergyCapacity();
while true do
s = r.getEnergyStored();
if r.getActive() then
if s/capacity > 0.8 then
@artheus
artheus / wp_function.sh
Last active October 26, 2017 13:44
My workspace bash function with completion
function wp() {
cd "$HOME/workspace/$1"
}
__wp_path_comp()
{
local cur_word="${COMP_WORDS[COMP_CWORD]}"
local wpcontent
wpcontent=`find $HOME/workspace/${cur_word}* -maxdepth 0 -type d -print 2> /dev/null | sed -e "s|$HOME/workspace/||" `
@artheus
artheus / mobfarm.lua
Last active October 25, 2017 12:52
mobfarm control script for a ftb server w. opencomputers
API = require("buttonAPI")
local event = require("event")
local computer = require("computer")
local term = require("term")
local component = require("component")
local gpu = component.gpu
local rs = component.redstone
local colors = require("colors")
local sides = require("sides")
@artheus
artheus / pacman-mirrors-replace.vim
Last active June 22, 2020 18:48
Vim Country Substitution for pacman.d/mirrorlist
" This is a substitution command for VIM where you can replace the word´Sweden´ with the country you want to keep.
" Whenever I install Arch linux on my machines, I usually only keep the mirrors from my country. If you do the
" same thing, you can use this to do it fast!
:%s/^##\s\(Sweden\)\@!\(.*\)\nServer = .*\n//
" Do you have any suggestions on making it better? Please comment!
@artheus
artheus / py3lock.py
Created September 28, 2016 10:36
Small change to Gist made by https://gist.github.com/Airblader
#!/usr/bin/python
import os
import xcb
from xcb.xproto import *
from PIL import Image, ImageFilter
XCB_MAP_STATE_VIEWABLE = 2
def screenshot():
@artheus
artheus / api_generation.yaml
Last active September 25, 2016 10:18
Sample config, API backend generation
!import "common.groovy"
!import "springboot.groovy"
!import "postgres.groovy"
!merge "moreConfig.yaml" #!dominant
!merge "otherConfig.yaml" #!submissive
springboot:
- db: "postgres"