This file contains hidden or 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 pyperf | |
import time | |
from concurrent.futures import ThreadPoolExecutor | |
from django.utils.functional import cached_property as dj_cached_property | |
from functools import cached_property as py_cached_property | |
# Most web requests have some IO, like database access. Simulate with sleeping | |
SLEEP_TIME = 0.01 |
This file contains hidden or 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
#debugging a chart on local | |
helm template --dry-run --debug . --generate-name --values values-stage.yaml |
This file contains hidden or 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 | |
#save as install-k3d.sh | |
#az vm create -g k3s --image UbuntuLTS --admin-username ubuntu --ssh-key-values ~/.ssh/id_rsa.pub -n k3s --custom-data install-k3d.sh | |
#az network nsg rule create -g k3x --nsg-name k3xNSG --priority 1002 --access Allow --protocol Tcp --destination-port-ranges 443 -n https | |
#az network nsg rule create -g k3x --nsg-name k3xNSG --priority 1001 --access Allow --protocol Tcp --destination-port-ranges 80 -n http | |
curl https://get.docker.com/ | sh | |
sudo usermod -aG docker ubuntu |
This file contains hidden or 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 is a save hook for Jupyter that automatically exports your notebook to reveal slides, | |
every time you save it, if | |
- it has at least one cell with a "slideshow" metadata | |
- and if the notebook is not `Untitled...` | |
Add the following to your `.jupyter/jupyter_notebook_config.py` file: | |
(source: https://gist.github.com/mwouts/04a6dfa571bda5cc59fa1429d130998f ) | |
""" | |
import io |
Did you just check out / clone a repository and forget --recursive / --recurse-submodules? Well, do this:
git submodule update --init --recursive --remote
For information about why this nugget was lost and burried in another stack exchange article, see this: https://meta.stackoverflow.com/questions/400424/how-can-i-request-that-a-question-merge-be-reversed
This file contains hidden or 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 | |
# Copyright (c) 2020 Magnus Kroken | |
# Permission is hereby granted, free of charge, to any person obtaining a copy | |
# of this software and associated documentation files (the "Software"), to deal | |
# in the Software without restriction, including without limitation the rights | |
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell | |
# copies of the Software, and to permit persons to whom the Software is | |
# furnished to do so, subject to the following conditions: | |
# The above copyright notice and this permission notice shall be included in |
This file contains hidden or 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
# Put this function to your .bashrc file. | |
# Usage: mv oldfilename | |
# If you call mv without the second parameter it will prompt you to edit the filename on command line. | |
# Original mv is called when it's called with more than one argument. | |
# It's useful when you want to change just a few letters in a long name. | |
# | |
# Also see: | |
# - imv from renameutils | |
# - Ctrl-W Ctrl-Y Ctrl-Y (cut last word, paste, paste) |
The post was created for the question [How to share config between vim and Neovim][question].
In this solution, we try to symlink ~/.config/nvim
to ~/.vim
, and make the conf compatible with vim
.
# nvim conf dir: ~/.config/nvim
# vim conf dir: ~/.vim
# link the 1st as the 2nd with relative links
This file contains hidden or 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 | |
# Proof of concept ara with ansible-runner | |
# Requires https://github.com/ansible/ansible-runner/issues/219#issuecomment-496191227 | |
import ansible_runner | |
import os | |
from ara.setup import callback_plugins | |
PLAYBOOK = """ | |
- name: Test for ansible-runner |