Skip to content

Instantly share code, notes, and snippets.

View dzintars's full-sized avatar
🇱🇻
Playing with Zuul CI

Dzintars dzintars

🇱🇻
Playing with Zuul CI
View GitHub Profile
apiVersion: v1
kind: Pod
metadata:
name: jenkins
labels:
app: jenkins
spec:
restartPolicy: Always
containers:
- name: jenkins-server

FZF

Move up/down in results - ctrl+j and ctrl+k

Open file in vertical split - ctrl+v

Open file in horizontal split - ctrl+x

Open file in new tab - ctrl+t

@dzintars
dzintars / github.sh
Last active September 2, 2020 16:37
#!/bin/sh
# Author: Dzintars Klavins
# This script will setup GitHub with multiple SSH identities
# Don't forget to make this file executable
# Setup multiple SSH identities for different Git accounts (with different credentials)
# Empty content of file
> ~/.config/Code/User/settings.json
# Place configuration in file.
@dzintars
dzintars / AsciiDoc.adoc
Last active June 26, 2021 12:19
AsciiDoc snippets for GitHub

Collection of things you can do with AsciiDoc in GitHub

@dzintars
dzintars / GetWinKey.vbs
Last active November 11, 2021 19:40
Get Windows 7 key
Set WshShell = CreateObject("WScript.Shell")
MsgBox ConvertToKey(WshShell.RegRead("HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\DigitalProductId"))
Function ConvertToKey(Key)
Const KeyOffset = 52
i = 28
Chars = "BCDFGHJKMPQRTVWXY2346789"
Do
Cur = 0
x = 14
@dzintars
dzintars / Bazel-Typescript.md
Last active December 4, 2021 05:22
Personal notes on Bazel Typescript setups

Bazel Typescript

To avoid ../../../../../../filename.ts garbage in the source code you can use Typescript Path Aliases. This approach not only cleans up your imports but also helps when making refacoring and moving packages/modules around. No matter where you will place your package, all imports allways will be resolvable.

But this is not enought at runtime. For example if you want to run WebPack dev-server. By default webpack does not know how to resolve those imports. You need to tweak WebPack config

Other resources:

#!/bin/bash
# Author: Dzintars Klavins
# This script will delete all network connections and devices.
# WARNING!!! Network connection will be lost!
# Delete all existing connections.
# All credits to: https://www.rene-pickhardt.de/index.html%3Fp=1955.html
for i in `nmcli c | \
grep -o -- "[0-9a-fA-F]\{8\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{4\}-[0-9a-fA-F]\{12\}"` ; \
@dzintars
dzintars / install-protoc-compiler.sh
Last active January 4, 2022 17:19
Install protoc-gen-go
#!/bin/sh
# Author: Dzintars Klavins
# This script will install Protoc compiler
# Don't forget to make this file executable
###################################
# Protocol Buffers installation #
###################################
@dzintars
dzintars / Qutebrowser.md
Created January 13, 2022 12:44
How to open Ranger in a Sway floating window from Qutebrowser

In a `~/.config/qutebrowser/config.py

config.set("fileselect.handler", "external")
config.set("fileselect.single_file.command", ['alacritty', '--class', 'ranger', '-e', 'ranger', '--choosefile', '{}'])
config.set("fileselect.multiple_files.command", ['alacritty', '--class', 'ranger', '-e', 'ranger', '--choosefile', '{}'])

In a ~/.config/sway/config

for_window [app_id="ranger"] floating enable
@dzintars
dzintars / Neovim.md
Last active March 19, 2022 08:06
Neovim setup

My Neovim setup

https://github.com/oswee/prime/ansible/custom/roles/nvim

Structure

99% of the config examples i saw in the wild gives me a feeling that people actually don't know what they are doing with Neovim configuration. Neither I do. But I am questioning myself: How to structure configuration in a clean, modular, swappable, easy to read and navigate way. There, in the wild, I see things like: "Throw it all in a single file", "Plugins are evil, vanilla Vim is all I need", "I will leave that dead code for the reference in case if I need it",