Skip to content

Instantly share code, notes, and snippets.

@raghur
raghur / README.adoc
Last active May 15, 2021 07:23
Debug F# tests in VSCode
  1. Install .net core test explorer

  2. In the test to debug, add a breakpoint

  3. In the test explorer window, select the test and right click 'Debug'

  4. have a launch config to attach like so:

            {
                "name": "attach",
                "type": "coreclr",
@raghur
raghur / settings.json
Created October 7, 2020 04:11
vs code vim
{
"vim.useSystemClipboard": true,
"vim.leader": "space",
"vim.hlsearch": true,
"vim.insertModeKeyBindings": [
{
"before": ["j", "k"],
"after": ["<Esc>"]
},
],
@raghur
raghur / zsh.zshrc
Created August 25, 2020 03:39
Show the time command was launched in zsh
AGKOZAK_CUSTOM_RPROMPT='[%D{%L:%M:%S %p}]'
reset-prompt-and-accept-line() {
zle reset-prompt
zle accept-line
}
zle -N reset-prompt-and-accept-line
bindkey '^m' reset-prompt-and-accept-line
@raghur
raghur / es-values.yaml
Last active July 24, 2020 06:06
eventstore helm values
clusterSize: 3
imageTag: release-5.0.8
persistence:
enabled: true
size: 2Gi
storageClass: managed-premium
# keep in mind that if you update the release name from 'eventstore', then update the match expression below as well
# placement constraint for production like env
affinity:
@raghur
raghur / pyramid.py
Created February 25, 2020 15:21
pyramid
import sys
import logging
import itertools
logging.basicConfig(format="%(asctime)s %(message)s", level=logging.DEBUG)
def termGenerator(sequence, start, length, k):
"""Generate kth term in a rolling sequence of 1, 3, 5... letters
Even terms are reversed
"""
# pick seqLen chars after skipping first startPos chars
@raghur
raghur / github_releases_opml.sh
Last active June 5, 2021 15:01
Create opml feed for releases from your starred repos
# fetch starred repos, form feed urls to releases, create opml file that can be imported into your favourite feed reader
curl -sL "api.github.com/users/raghur/starred?page=1&per_page=500" | \
jq -r '"<outline xmlUrl=\"https://github.com/" + .[].full_name + "/releases.atom\" />"' | \
awk -e 'BEGIN {print "<opml version=\"1.0\"><body> <outline title=\"Github Releases\" text=\"Github Releases\">"}
{print}
END {print "</outline></body></opml>"}' > subs.opml
#!/bin/sh
# Start/stop all init scripts in /opt/etc/init.d including symlinks
# starting them in numerical order and
# stopping them in reverse numerical order
#logger "Started $0${*:+ $*}."
ACTION=$1
CALLER=$2
@raghur
raghur / levels.sh
Created November 12, 2018 17:47
Router to check HP ink levels and notify
#! /opt/bin/bash
# replace these
user="user token"
token="app token"
mypidfile=/tmp/levels.sh.pid
if [ -e $mypidfile ]; then
exit 0
fi
trap "rm -f $mypidfile" EXIT
set Boost_INCLUDEDIR=d:\sdks\boost-1.65.1\boost\
set BOOST_LIBRARYDIR=d:\sdks\boost-1.65.1\lib64-msvc-14.0\
set BOOST_ROOT=d:\sdks\boost-1.65.1\
cd build
d:\Utils\cmake-3.10.0-win64-x64\bin\cmake.exe -G "NMake Makefiles" -DPY3:BOOL=ON -DPYTHON_EXECUTABLE=d:\sdks\python36\python -DPYTHON_INCLUDE_DIRS=d:\sdks\python36\include\ -DPYTHON_LIBRARY=d:\sdks\python36\libs\python36.lib ..
nmake
@raghur
raghur / find.sh
Created September 12, 2017 03:07
find top 10 most space consuming folders inside a folder.
find -maxdepth 1 -path './*' -type 'd' -print0 |xargs -0 du -hs |sort -hr |head -10