Skip to content

Instantly share code, notes, and snippets.

#sudo dnf system-upgrade download --releasever=39
year="date +%y"
echo "sudo dnf system-upgrade download --releasever=$((`$year`+16))"
@andreaskern
andreaskern / gist:a8159efe949bf77c62664da1c4087f62
Created April 6, 2020 11:46
wine wrapper to look for executable in working directory first fish shell
function wwine; if test -e $argv; wine ./$argv ; else; echo "no file $argv" found; end; end

Keybase proof

I hereby claim:

  • I am andreaskern on github.
  • I am akern (https://keybase.io/akern) on keybase.
  • I have a public key ASD1puQyDbt-gMbtjMPPhs7h8qvyNDKct1xPWGjpwFVnnwo

To claim this, I am signing this object:

@andreaskern
andreaskern / dumpBlocks.sh
Created June 1, 2019 14:10
dump blocks in json from bitcoind
#!/usr/bin/env bash
set -e
CLI='bitcoin-cli -datadir=. '
BLOCK_HEIGHT=$(${CLI} -getinfo | jq .blocks)
BLOCK_END=$BLOCK_HEIGHT
BLOCK_START=$(expr ${BLOCK_END} - 1000)
VERBOSITY=5
echo Fetching blocks from $BLOCK_START to $BLOCK_END and putting them into the json folder
@andreaskern
andreaskern / tasks.json
Last active November 12, 2018 12:48 — forked from mattmc3/tasks.json
VSCode tasks for running a Makefile
// Makefile
// ${workspaceRoot} the path of the folder opened in VS Code
// ${file} the current opened file
// ${fileBasename} the current opened file's basename
// ${fileDirname} the current opened file's dirname
// ${fileExtname} the current opened file's extension
// ${cwd} the task runner's current working directory on startup
{
"version": "2.0.0",
"command": "make",
@andreaskern
andreaskern / jsDateParse.jl
Last active November 10, 2015 13:33
parse javascript Date with julia Date
#what julia can do Dates.DateTime("2015-11-10T10:50:14.323")
#what nodejs deliverts "Tue Nov 10 2015 07:50:58 GMT+0000 (UTC)"
import Dates
function jsDateParse(jsDate)
x = jsDate
transformed = x[12:15]"-"x[5:7]"-"x[9:10]"T"x[17:24]
df = Dates.DateFormat("yyyy-uuu-ddTHH:MM:ss")
Dates.DateTime(transformed,df)
end
@andreaskern
andreaskern / hack2.template.html
Created September 6, 2015 11:09
monospace font hack2
<html>
<head>
<link rel="stylesheet" href="//cdn.jsdelivr.net/font-hack/2.010/css/hack-extended.min.css">
<style>
code {
font hack
}
</style>
</head>
<body>

vimdiff cheat sheet

enable vim mouse support with

:set mouse=a

to resize the windows by dragging the border.

##git mergetool

@andreaskern
andreaskern / gist:01d1d292f7f146186ee5
Created February 12, 2015 20:38
elasticsearch problem
# bad
curl -XPOST localhost:9200/logger-good-123/logs -d '
{"_id":{"$oid":"54d9e3bf30320c3335017e69"},"status":"ok","info":"device","_sz":701,"_ip":"127.0.2.46","_gw":"59:DE:AD:BE:EF:68","_ct":"gagent","@timestamp":"2015-02-10T10:55:59.252+00:00","@version":"1","type":"apiv1"}'
# good
curl -XPOST localhost:9200/logger-good-123/logs -d '
{"@timestamp":"2015-02-10T10:55:59.252+00:00","_id":{"$oid":"54d9e3bf30320c3335017e69"},"status":"ok","info":"device","_sz":701,"_ip":"127.0.2.46","_gw":"59:DE:AD:BE:EF:68","_ct":"gagent","@version":"1","type":"apiv1"}'
@andreaskern
andreaskern / private-npmjs-registry.md
Last active March 27, 2016 09:08 — forked from dandean/private-npmjs-registry.md
Install npm registry on Ubuntu 14.04

Install CouchDB, Nodejs and npm

sudo aptitude install couchdb nodejs npm

Add required ini configurations: