Skip to content

Instantly share code, notes, and snippets.

View kyrias's full-sized avatar
🏳️‍🌈

Johannes Löthberg kyrias

🏳️‍🌈
View GitHub Profile
anonymous
anonymous / intro.rkt
Created September 5, 2014 15:00
#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 November 20, 2013 17:41
WIP tmux config
# 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 July 26, 2016 18:31
Ruby Hello World
  = 1
   =  + 
    =   *  + 
     =    *  
      =
[     *(   +  )+  ,
        =     *    + ,
         =     *    +    -  ,
        ,
        =        +    ,
@tillkuhn
tillkuhn / nginx-ingress-lb.yaml
Created November 22, 2016 17:41
Kubernetes configuration file to create and expose Nginx Ingress Controller Service with sticky sessions, virtual host stats and default backend
---
################################################################################
## 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:
@alanbriolat
alanbriolat / default.conf
Created September 28, 2011 14:01
nginx userdir + PHP-FPM
server {
listen 80;
server_name localhost;
# ... other default site stuff, document root, etc. ...
location ~ ^/~(?<userdir_user>.+?)(?<userdir_uri>/.*)?$ {
alias /home/$userdir_user/public_html$userdir_uri;
index index.html index.htm index.php;
autoindex on;
@KenMacD
KenMacD / cmd.md
Created October 7, 2011 02:41
GPG Offline Master Key
@ssp
ssp / git-extract-file.markdown
Created January 23, 2012 13:21
Extract a single file from a git repository

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

@quchen
quchen / trolling_haskell
Last active February 24, 2024 01:30
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

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.)

@Earnestly
Earnestly / makepkg_overview.rst
Last active March 22, 2024 03:48
A brief overview of the process involved in creating a pacman package.

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