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
minimum=30 | |
for pid in /proc/[0-9]*; do number_fds=$(ls $pid/fd | wc -l); if [ $number_fds -ge $minimum ]; then printf "PID %6d has %4d FDs\n" $(basename $pid) $(ls $pid/fd | wc -l); ps aux | grep $(echo $pid | cut -d/ -f3) | grep -v grep; fi; done |
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
for package in $(jq -r '.devDependencies | keys | .[]' package.json); do version=$(jq -r --arg pkg $package '.dependencies[$pkg].version' package-lock.json); echo "$package: $version"; done |
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 | |
# https://alexei-led.github.io/post/k8s_node_shell/ | |
if [ -z "${1}" ]; then | |
echo "ERROR No kubernetes node supplied. | |
Script needs a node name as first argument! | |
Find node names with: | |
$ kubectl get node |
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
type Entry<T> = [ keyof T, T[keyof T] ] | |
type Entries<T> = Entry<T>[] | |
type Key<T> = (keyof T) | |
type Keys<T> = Key<T>[] | |
type Value<T> = T[keyof T] | |
type Values<T> = Value<T>[] | |
type HasKeys<T> = { [key in keyof T]: any } | |
const keys = <T>(obj: T): Keys<T> => Object.keys(obj) as Keys<T> | |
const toEntries = <T>(obj: T): Entries<T> => Object.entries(obj) as Entries<T> |
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
https://www.oreilly.com/library/view/managing-projects-with/0596006101/ch07.html |
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 | |
STACK_URL=myuser.stackstorage.com | |
STACK_USER=myuser | |
STACK_PASSWORD=nooneknowsthis | |
curl \ | |
--silent \ | |
-X POST \ | |
-H "Content-Type: application/json" \ |
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
// Trello | |
// Add a List for each weekday | |
// Pass throught https://skalman.github.io/UglifyJS-online/ | |
// Then add 'javascript:' before the code | |
// and add 'void(0);' after the code | |
// Add a bookmark in Chrome and put this as the url | |
(function () { | |
function getLastDate (lastDate = null) { |
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 bash | |
# DigitalOcean Kubernetes | |
# The kubeconfig you download from DigitalOcean invalidates every 7 days | |
# By appending this to your .bashrc file the kubeconfig gets refreshed every 6 days | |
# | |
# Pre | |
# - install 'doctl': https://github.com/digitalocean/doctl#installing-doctl | |
# - auth with DigitalOcean API token: https://github.com/digitalocean/doctl#authenticating-with-digitalocean | |
# |
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
(function (context, trackingId, options) { | |
const history = context.history; | |
const doc = document; | |
const nav = navigator || {}; | |
const storage = localStorage; | |
const encode = encodeURIComponent; | |
const pushState = history.pushState; | |
const typeException = 'exception'; | |
const generateId = () => Math.random().toString(36); | |
const getId = () => { |
NewerOlder