Skip to content

Instantly share code, notes, and snippets.

😄
ohai!

Johannes Löthberg kyrias

😄
ohai!
Block or report user

Report or block kyrias

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@tillkuhn
tillkuhn / nginx-ingress-lb.yaml
Created Nov 22, 2016
Kubernetes configuration file to create and expose Nginx Ingress Controller Service with sticky sessions, virtual host stats and default backend
View nginx-ingress-lb.yaml
---
################################################################################
## K8S Default Backend for Nginx if no endpoint is available e.g. 404 servers
###############################################################################
apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: nginx-default-backend
namespace: kube-system
labels:
View nix-multi.md

Multi user nix installation

Each section should be run as the user or as root, pay attention to which one!

Install nix single user

As $USER

curl https://nixos.org/nix/install | sh
@Earnestly
Earnestly / makepkg_overview.rst
Last active Dec 20, 2019
A brief overview of the process involved in creating a pacman package.
View makepkg_overview.rst

A Brief Tour of the Makepkg Process: What Makes a Pacman Package

Introduction

This is a terse document covering the anatomy of a package built for the pacman package manager.

The following example commands can mostly run verbatim to manually create a

View intro.rkt
#lang racket
;; hello world in Racket
;; comments begin with ;
;; some people like to use ;;
;; function application is done by surrounding the function name and arguments in parens
;;
;; if you have seen languages like Python or JavaScript, f(a,b,c) is (f a b c) in scheme
(displayln "Hello, world!")
@Apsu
Apsu / .tmux.conf
Created Nov 20, 2013
WIP tmux config
View .tmux.conf
# Prefix and cycle
set-option -g prefix C-\\
bind C-\ last-window
# Reload config
bind r source-file ~/.tmux.conf
# vi copy-mode
setw -g mode-keys vi
@qrohlf
qrohlf / helloworld
Last active Jul 26, 2016
Ruby Hello World
View helloworld
  = 1
   =  + 
    =   *  + 
     =    *  
      =
[     *(   +  )+  ,
        =     *    + ,
         =     *    +    -  ,
        ,
        =        +    ,
@quchen
quchen / trolling_haskell
Last active Mar 27, 2020
Trolling #haskell
View trolling_haskell
13:15 <xQuasar> | HASKELL IS FOR FUCKIN FAGGOTS. YOU'RE ALL A BUNCH OF
| FUCKIN PUSSIES
13:15 <xQuasar> | JAVASCRIPT FOR LIFE FAGS
13:16 <luite> | hello
13:16 <ChongLi> | somebody has a mental illness!
13:16 <merijn> | Wow...I suddenly see the error of my ways and feel
| compelled to write Node.js!
13:16 <genisage> | hi
13:16 <luite> | you might be pleased to learn that you can compile
| haskell to javascript now
View _Example polkit rules_.md

These are only examples, for a few very common actions. You are expected to write your own rules for the rest. The syntax is regular JavaScript, but see the polkit(8) manpage for the object structure and available API. These examples are for polkit versions 106 and later, with the JS interpreter. They won't work with Debian's polkit v105.

  • If you don't know the action name, run pkaction:

    pkaction | grep cups
    
  • The possible results are YES, AUTH_SELF(_KEEP), AUTH_ADMIN(_KEEP), NO. Returning a result is final. Returning null will continue checking other rules.

  • Put your rules in /etc/polkit-1/rules.d/*.rules. (You can check everything in one giant addRule, or you can have a separate file and separate addRule for each program; it doesn't matter.)

@ssp
ssp / git-extract-file.markdown
Created Jan 23, 2012
Extract a single file from a git repository
View git-extract-file.markdown

How to extract a single file with its history from a git repository

These steps show two less common interactions with git to extract a single file which is inside a subfolder from a git repository. These steps essentially reduce the repository to just the desired files and should performed on a copy of the original repository (1.).

First the repository is reduced to just the subfolder containing the files in question using git filter-branch --subdirectory-filter (2.) which is a useful step by itself if just a subfolder needs to be extracted. This step moves the desired files to the top level of the repository.

Finally all remaining files are listed using git ls, the files to keep are removed from that using grep -v and the resulting list is passed to git rm which is invoked by git filter-branch --index-filter (3.). A bit convoluted but it does the trick.

1. copy the repository to extract the file from and go to the desired branch

@KenMacD
KenMacD / cmd.md
Created Oct 7, 2011
GPG Offline Master Key
View cmd.md
You can’t perform that action at this time.