start new:
tmux
start new with session name:
tmux new -s myname
export function format(value, n, x, s, c) { | |
if (!value) return '' | |
var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\D' : '$') + ')', | |
num = value.toFixed(Math.max(0, ~~n)); | |
return (c ? num.replace('.', c) : num).replace(new RegExp(re, 'g'), '$&' + (s || ',')); | |
}; |
# Backup | |
docker exec CONTAINER /usr/bin/mysqldump -u root --password=root DATABASE > backup.sql | |
# Restore | |
cat backup.sql | docker exec -i CONTAINER /usr/bin/mysql -u root --password=root DATABASE | |
module.exports = function(number) { | |
const rules = [ | |
{ | |
type: 'elo', | |
pattern: /^(((40117[89])|(431274)|(438935)|(451416)|(457393)|(45763[12])|(504175)|(627780)|(636297)|(636368)|(65500[0-3])|(65165[2-4])|(65048[5-8])|(650489|65049[0-4])|(506699|5067[0-6][0-9]|50677[0-8])|(509[0-8][0-9]{2}|5099[0-8][0-9]|50999[0-9])|(65003[1-3])|(65003[5-9]|65004[0-9]|65005[01])|(65040[5-9]|6504[1-3][0-9])|(65048[5-9]|65049[0-9]|6505[0-2][0-9]|65053[0-8])|(65054[1-9]|6505[5-8][0-9]|65059[0-8])|(65070[0-9]|65071[0-8])|(65072[0-7])|(65090[1-9]|65091[0-9]|650920)|(65165[2-9]|6516[67][0-9])|(65500[0-9]|65501[0-9])|(65502[1-9]|6550[34][0-9]|65505[0-8]))\d{0,16})$/, | |
length: [16], | |
cvcLength: [3] | |
}, { | |
type: 'hipercard', | |
pattern: /^(606282\d{10}(\d{3})?)|(3841\d{15})$/, |
host: 000.000.000.000 | |
port: 0000 | |
send | |
cat file.txt > /dev/tcp/000.000.000.000/0000 | |
receive | |
nc -lkvv 4444 > file.txt |
import validateEmail from 'validator/lib/isEmail' | |
const exec = (func) => { | |
return (val) => { | |
try { | |
return func(val) | |
} catch (error) { | |
return false | |
} | |
} |
version: '3' | |
services: | |
plex: | |
image: linuxserver/plex:150 | |
container_name: plex | |
restart: unless-stopped | |
network_mode: "host" | |
environment: | |
- "VERSION=latest" |
export const withQueryWrapper = (params) => { | |
return (Component) => { | |
return (props) => ( | |
<Query {...params}> | |
{({ data, loading }) => ( | |
loading ? null : | |
<Component | |
{...props} | |
data={data} |
#!/bin/bash | |
# Get directory of script | |
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )" | |
if [[ $# -ne 1 ]] | |
then | |
echo "ERROR: This script expects the namespace name to be given as an argument" | |
echo "e.g. ./ecr-cred-updater.sh my-namespace" | |
exit 1 |
Last updated June 23, 2022
There are now two ways to approach this:
This Gist explains how to do this using gpg in a step-by-step fashion. Kryptonite is actually wickedly easy to use-but you will still need to follow the instructions