-
Install MongoDB Enterprise Advanced 4.0 using the following commands:
Purpose Command Add MongoDB Public Key wget -qO - https://www.mongodb.org/static/pgp/server-4.0.asc | sudo apt-key add -
Add MongoDB EA Repo echo "deb [ arch=amd64 ] http://repo.mongodb.com/apt/ubuntu bionic/mongodb-enterprise/4.0 multiverse" | sudo tee /etc/apt/sources.list.d/mongodb-enterprise.list
Update Apt Package Cache sudo apt-get update
Install MongoDB EA 4.0.15 sudo apt-get install -y mongodb-enterprise=4.0.15 mongodb-enterprise-server=4.0.15 mongodb-enterprise-shell=4.0.15 mongodb-enterprise-mongos=4.0.15 mongodb-enterprise-tools=4.0.15
-
Edit the MongoDB Enterprise config file by running
sudo vi /etc/mongod.etc
update the binding, add it to a replica set, and enable username and password auth as shown below or in the sample config.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash -e | |
# redelegate-cro.sh is a script that automatically claims all your delegation | |
# rewards (across any number of validators) in a single transaction (assuming a | |
# minimum reward threshold is met, to avoid spurious transactions). The rewards | |
# are then automatically redelegated to the provided validator address, leaving | |
# behind at least a 0.005 CRO buffer to ensure there is always enough for | |
# regular transaction fees. | |
# | |
# The idea is that it is safe to run this script on a fixed cron schedule and |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
""" | |
Usage: | |
- Save this script somewhere on your path (e.g. `vi /usr/local/bin/aws-console && chmod +x /usr/local/bin/aws-console`) | |
- Make AWS credentials available in one of the usual places where boto3 can find them (~/.aws/credentials, env var, etc.) | |
- Excute the script: `aws-console --profile myprofile` | |
- :tada: Your browser opens and you are signed in into the AWS console | |
""" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"version": "0.2.0", | |
"configurations": [ | |
{ | |
"name": "Debug argocd-server", | |
"type": "go", | |
"request": "launch", | |
"mode": "debug", | |
"program": "${workspaceFolder}/cmd/main.go", | |
"args": [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Usage: $0 <component to debug> | |
# Will start all other components, and leaves starting the component to debug | |
# to the user (most likely, using delve via vscode). | |
MANDATORY_COMPONENTS="dex redis ui git-server dev-mounter" | |
case "$1" in | |
"server") | |
ADDITIONAL_COMPONENTS="repo-server controller" | |
;; |
⚠️ Note 2023-01-21
Some things have changed since I originally wrote this in 2016. I have updated a few minor details, and the advice is still broadly the same, but there are some new Cloudflare features you can (and should) take advantage of. In particular, pay attention to Trevor Stevens' comment here from 22 January 2022, and Matt Stenson's useful caching advice. In addition, Backblaze, with whom Cloudflare are a Bandwidth Alliance partner, have published their own guide detailing how to use Cloudflare's Web Workers to cache content from B2 private buckets. That is worth reading,
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import difflib | |
import wasabi | |
def diff_strings(a, b): | |
output = [] | |
matcher = difflib.SequenceMatcher(None, a, b) | |
for opcode, a0, a1, b0, b1 in matcher.get_opcodes(): | |
if opcode == "equal": | |
output.append(a[a0:a1]) | |
elif opcode == "insert": |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// This file was initially generated by Windows Terminal 1.0.1401.0 | |
// It should still be usable in newer versions, but newer versions might have additional | |
// settings, help text, or changes that you will not see unless you clear this file | |
// and let us generate a new one for you. | |
// To view the default settings, hold "alt" while clicking on the "Settings" button. | |
// For documentation on these settings, see: https://aka.ms/terminal-documentation | |
{ | |
"$schema": "https://aka.ms/terminal-profiles-schema", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
/** | |
Example hack to encrypt a file using a GPG encryption key. Works with GPG v2.x. | |
The encrypted file e.g. /tmp/data.txt.gpg can then be decrypted using the standard command | |
gpg /tmp/data.txt.gpg | |
Assumes you have **created** an encryption key and exported armored version. | |
You have to read the armored key directly as Go cannot read pubring.kbx (yet). |
These are my favorite tools for making my terminal a nice place to work.
- bat:
cat
, with syntax highlighting, git, and diff support - chezmoi: Sync your dotfiles using a Git repo
- diff-so-fancy: better-looking diffs for modern terminals
- eza:
ls
, but pretty by default
NewerOlder