Skip to content

Instantly share code, notes, and snippets.

@vrischmann
vrischmann / main.zig
Created June 4, 2023 14:13
zig translate-c bug
const std = @import("std");
const c = @cImport({
@cInclude("test.h");
});
pub fn main() !void {
const foo = c.SQLITE_TRANSIENT;
_ = foo;
}
@vrischmann
vrischmann / README.md
Last active July 11, 2020 22:20
IEX Cloud international stock prices

How to use IEX Cloud to fetch international stock prices with Beancount

  1. Create a free IEX Cloud account and note your secret token.
  2. Get the symbol data for your region (for example fr).
  3. Clone Beancount.
  4. Replace the beancount/sources/iex.py with this one which uses IEX Cloud instead of the old API.
  5. Mark your commidities using the symbol data, for example:
2018-01-01 commodity EDF
@vrischmann
vrischmann / README.md
Last active September 20, 2024 17:03
Using ZLS with nvim-lsp

Using ZLS with nvim-lsp

This configures nvim-lsp to use zls.

Steps

  • build zls as described in its README
  • install nvim-lsp (I'm using the Vim8 native packages), once installed add the file zls.lua under the directory lua/nvim_lsp
  • change the cmd path to point to your zls binary
  • add the content of init.vim to your $HOME/.config/nvim/init.vim, modify the mappings if you want.
@vrischmann
vrischmann / Microsoft.PowerShell_profile.ps1
Created May 3, 2020 11:07
PowerShell profiles that applies the vcvarsalls.bat file from Visual Studio 2019
pushd "C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Auxiliary\Build"
# Adapt the argument `x86_amd64` if it's not what you need. Run the bat file to see what's available.
cmd /c "vcvarsall.bat x86_amd64 &set" |
foreach {
if($_ -match "(.*?)=(.*)")
{
Set-Item -force -path "ENV:\$($matches[1])" -value "$($matches[2])"
}
@vrischmann
vrischmann / README.md
Created May 23, 2019 14:04
script for fish to switch kubernetes contexts and namespaces with support for auto completion

installation

  • Copy kctx.fish to $HOME/.config/fish/functions
  • Copy kctx_completions.fish to $HOME/.config/fish/completions
@vrischmann
vrischmann / unbound.conf
Created April 22, 2019 15:53
Unbound forward to Cloudflare with DNS-over-TLS (with validation)
server:
tls-cert-bundle: "/etc/pki/ca-trust/extracted/pem/tls-ca-bundle.pem"
forward-zone:
name: "."
forward-ssl-upstream: yes
forward-addr: 1.1.1.1@853#cloudflare-dns.com
@vrischmann
vrischmann / tmux-ssh-ansible-inventory.md
Created July 15, 2018 13:43
Automate SSH sessions to some hosts from an Ansible inventory using tmux

What it does

This script automates launching SSH sessions to hosts defined in an Ansible inventory file.

It parses the inventory file (at ./hosts) and understand Ansible patterns like webserver[0:1],db[4:10]:!db9.stuff.com.

So if you have this inventory for example:

[webserver]

webserver01.stuff.com

Keybase proof

I hereby claim:

  • I am vrischmann on github.
  • I am sphax (https://keybase.io/sphax) on keybase.
  • I have a public key ASBKrO-dT2hN7YGUU6Uu5g7O7GxE37Z1E7wpwv-F5nfRqgo

To claim this, I am signing this object:

@vrischmann
vrischmann / .credentials
Last active January 20, 2023 11:57
Running SBT with a Nexus proxy with authentication
realm=Sonatype Nexus Repository Manager
host=nexus.company.com
user=admin
password=admin123