Skip to content

Instantly share code, notes, and snippets.

View Skarlso's full-sized avatar
:electron:

Gergely Brautigam Skarlso

:electron:
View GitHub Profile
@Skarlso
Skarlso / athens_deployment.yaml
Last active November 29, 2019 07:31
Service Files for Kubernetes to deploy Athens -- Assumes cert-manager is installed.
apiVersion: apps/v1
kind: Deployment
metadata:
namespace: athens
name: athens-app
labels:
app: athens
spec:
replicas: 1
selector:
#!/usr/bin/python
#Get json output from status service web page
import urllib, json, sys
from socket import gethostname, getfqdn
import subprocess
# this require presence of xmltodict rpm package !
sys.path.append('/usr/local/lib/python2.7/dist-packages')
import xmltodict
@Skarlso
Skarlso / main.go
Created February 16, 2019 21:31
Golang SSH connection with hostkey verification
package main
import (
"bytes"
"fmt"
"io/ioutil"
"log"
"golang.org/x/crypto/ssh"
kh "golang.org/x/crypto/ssh/knownhosts"
@Skarlso
Skarlso / complex_coord.go
Created January 3, 2019 11:41
Complex numbers as coordinates
package main
import "fmt"
type WalkFunc func(a *complex128)
func main() {
coord := 0 + 0i;
up := func(a *complex128) { *a += (1+0i) }
@Skarlso
Skarlso / fork_updater.rb
Last active June 8, 2018 08:50
Ruby script to update all your forked repositories
#!/usr/bin/env ruby
require 'octokit'
require 'logger'
@logger = Logger.new("output.log")
def update_fork(repo)
repo_name = repo.name
# clone the repository -- octokit doesn't provide this feature as it's a github api library
@Skarlso
Skarlso / sync_repos.sh
Created June 7, 2018 14:19
Update all forks
#!/bin/bash
temp=`basename $0`
TMPFILE=`mktemp /tmp/${temp}.XXXXXX` || exit 1
API_CALL="/user/repos?type=owner+fork=true"
function rest_call {
curl -u skarlso:$GIT_TOKEN -s $1 >> $TMPFILE
}
#!/bin/bash
# Derived from http://weierophinney.net/matthew/archives/134-exuberant-ctags-with-PHP-in-Vim.html
exec etags \
--languages=PHP \
--langmap=PHP:+.phpt \
-h ".php" -R \
--exclude="\.git" \
--totals=yes \
--tag-relative=yes \
--PHP-kinds=+cdf \
@Skarlso
Skarlso / concurrency-in-go.md
Created October 21, 2017 05:20 — forked from kachayev/concurrency-in-go.md
Channels Are Not Enough or Why Pipelining Is Not That Easy
@Skarlso
Skarlso / jenkinslog
Last active August 3, 2017 13:35
Filter out Jenkins logs.
#!/usr/bin/env zsh
help() {
echo '
Define somewhere in your secrets:
export JENKINS_SERVER=''
export JENKINS_USERNAME=''
export JENKINS_PASSWORD='' -- token located under your users settings
Usage:
@Skarlso
Skarlso / client.go
Created April 25, 2017 04:38 — forked from spikebike/client.go
TLS server and client
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)