Skip to content

Instantly share code, notes, and snippets.

View netfeed's full-sized avatar

Victor Bergöö netfeed

  • Gothenburg, Sweden
View GitHub Profile
#!/usr/bin/env python
import argparse
import sys
import shlex
import subprocess
import os
import os.path
def get_command(branch=None, grep=None):

Debian Nvidia install

  • create keys
    • sudo open-ssl req -new -x509 -newkey rsa:2048 -keyout /path/to/nvidia-private.key -outform DER /path/to/nvidia-public.der -days 36500 -subj "/CN=Graphics Driver"
  • load new keys into mok
    • sudo mokutil --import /path/to/public-nvidia.der
    • create password, remember password
  • disable nouveau
    • echo options nouveau modset=0 | sudo tee -a /etc/modprobe.d/nouveau-kms.conf
  • sudo update-initramfs -u
@netfeed
netfeed / Application.java
Last active November 26, 2017 10:43
vertx auto routing
package reflection.magic;
import io.vertx.core.Vertx;
import io.vertx.core.VertxOptions;
import io.vertx.core.http.HttpMethod;
import io.vertx.core.http.HttpServer;
import io.vertx.core.http.HttpServerOptions;
import io.vertx.ext.web.Route;
import io.vertx.ext.web.Router;
import org.reflections.Reflections;
diff --git a/src/http/request.cr b/src/http/request.cr
index 8cc855f..d64e7b9 100644
--- a/src/http/request.cr
+++ b/src/http/request.cr
@@ -7,7 +7,6 @@ class HTTP::Request
getter headers
getter body
getter version
- getter cookies
@netfeed
netfeed / chbot.py
Last active August 29, 2015 14:18
Clicker Heroes (http://www.clickerheroes.com/) click bot
# the goal of the bot is to do as many clicks as possible and collect gold from candy when it appears
# works better in chrome than firefox (firefox might hang)
#
# > virtualenv venv
# > source venv/bin/activate
# > pip install PyUserInput python3-xlib
# > python chbot.py
#
# change GAME_UPPER_LEFT_X / Y to fit the game is located in your version
@netfeed
netfeed / cache.go
Last active August 29, 2015 14:04
Simple interface against groupcache to cache structs and then get it back from the cache
package cache
import (
"bytes"
"encoding/json"
"github.com/golang/groupcache"
)
type GetterFunc func(string) (interface{}, error)
#!/usr/bin/env perl
use strict;
use warnings;
# apt-get install libtext-csv-xs-perl
use Getopt::Long;
use Text::CSV_XS;

Cheesecake - grundrecept

Ett snabbt och lätt grundrecept för cheesecake. Väldigt enkelt att arbeta om för att göra mer "spännande" varianter. Går bra att göra dagen innan och blir i mitt tycke bättre då.

Properties

  • Preptime: 20-30 min
  • Cooktime: 50-60 min
  • Yield: 12-16 bitar
  • Lactose: Ja
@netfeed
netfeed / i18n.clj
Created December 3, 2012 10:36
clojure-i18n
(ns omnom.i18n
"This is a simplified bare minimum re-work of https://github.com/ptaoussanis/tower"
(:require [clojure.java.io :as io]
[clojure.string :as string]))
(def ^:dynamic *Locale* :sv)
(defonce ^:private config (atom {}))
(defn- update-config! [dict] (swap! config conj dict))
@netfeed
netfeed / gist:3930511
Created October 22, 2012 09:06
Print specified, or all, columns from a CSV-file
#!/usr/bin/env perl
use strict;
use warnings;
use Getopt::Long;
use Text::CSV_XS;
my $delimiter = ',';
my $binary = 0;