Skip to content

Instantly share code, notes, and snippets.

Oh my zsh.

Install with curl

sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my-zsh/master/tools/install.sh)"

Enabling Plugins (zsh-autosuggestions & zsh-syntax-highlighting)

  • Download zsh-autosuggestions by

Oh my zsh.

Oh My Zsh

Install ZSH.

sudo apt install zsh-autosuggestions zsh-syntax-highlighting zsh

Install Oh my ZSH.

@toanz
toanz / dbcleanup.sh
Created October 27, 2021 01:28 — forked from systra/dbcleanup.sh
CouchDB cleanup - remove old documents (shell method)
#!/bin/bash
# source: http://bravenewmethod.com/2012/05/31/couchdb-cleanup-script-for-purging-old-docs/
# but modified to get rid of node.js dependency
# if database needs auth:
# DBHOST=user:pass@hostname
DBHOST=localhost
PORT=5984
@toanz
toanz / README.md
Created October 19, 2020 07:52 — forked from tdack/README.md
Custom handlebars helpers for Ghost, as an app
@toanz
toanz / backup.python2.py
Created August 16, 2020 10:05 — forked from maxgalbu/backup.python2.py
Updated API version + Python 2 version of https://stackoverflow.com/a/34469893/2265500
import os
import errno
from subprocess import call
from gitlab import Gitlab
def mkdir_p(path):
try:
os.makedirs(path)
except OSError as exc: # Python >2.5
if exc.errno == errno.EEXIST and os.path.isdir(path):
@toanz
toanz / private_fork.md
Created August 11, 2020 01:03 — forked from 0xjac/private_fork.md
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare [email protected]:usi-systems/easytrace.git

@toanz
toanz / Helm + Kustomize Template.yml
Last active August 1, 2020 01:53
Helm + Kustomize Template Structure
_charts/
backendA/
Chart.yaml
Values.yaml
...
backendB/
...
api-gateway/
...
prod/
@toanz
toanz / README.md
Created July 27, 2020 03:43 — forked from taxilian/README.md
Mongodb scripts for incremental backup

Introduction

I can't take credit for much of the work here -- I adapted it from this blog post: https://tech.willhaben.at/mongodb-incremental-backups-dff4c8f54d58

My main contribution was to make it a little easier to use with docker as well as numerous little cleanup tasks. I also made it gzip the oplog backups and added support for SSL connections

Note that I havne't yet tested the point in time restore script; it likely needs work, particularly to make things work with the gzipped oplog files

@toanz
toanz / README.md
Created July 16, 2020 03:58 — forked from LongLiveCHIEF/README.md
Run node, npm, npx, yarn as container

Developing with Node, without installing node!

Note: currently only works on *nix systems (until a powershell script can be created)

With the technique below, you can run node, npm, npx, or yarn commands as if the programs were installed natively on your system, and you won't even know the difference! This includes any ports that your app or dev process will start up and use for development, as well as compatibility with persistent npm config --global cli usage.

See more in the Usage section below.

@toanz
toanz / header.js
Last active July 6, 2020 09:31
tag manager
<!-- Google Tag Manager -->
<script>(function(w,d,s,l,i){w[l]=w[l]||[];w[l].push({‘gtm.start’:
new Date().getTime(),event:‘gtm.js’});var f=d.getElementsByTagName(s)[0],
j=d.createElement(s),dl=l!=‘dataLayer’?’&l=’+l:’’;j.async=true;j.src=
'https://www.googletagmanager.com/gtm.js?id=’+i+dl;f.parentNode.insertBefore(j,f);
})(window,document,‘script’,‘dataLayer’,‘GTM-P4H2WTX’);
function gtag(){dataLayer.push(arguments);}
</script>
<!-- End Google Tag Manager -->