docker run --detach --name debug --privileged --net=host --pid=host debian tail -f /dev/null
docker exec -it debug apt update
docker exec -it debug apt install git tmux htop sysstat procps
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 multiprocessing | |
import os | |
import signal | |
from itertools import count | |
from time import sleep | |
def work(n): | |
print("Task", n, "starting") | |
signal.signal(signal.SIGINT, signal.SIG_IGN) |
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
from django.http import HttpResponse | |
def health(get_response): | |
def middleware(request): | |
if request.path == "/health": | |
return HttpResponse("Healthy") | |
return get_response(request) |
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
{ | |
"annotations": { | |
"list": [ | |
{ | |
"builtIn": 1, | |
"datasource": "-- Grafana --", | |
"enable": true, | |
"hide": true, | |
"iconColor": "rgba(0, 211, 255, 1)", | |
"name": "Annotations & Alerts", |
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
[program:firewall] | |
user = root | |
command = /opt/firewall.sh | |
autorestart = false |
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
gsettings set org.gnome.desktop.wm.keybindings switch-applications "[]" | |
gsettings set org.gnome.desktop.wm.keybindings switch-applications-backward "[]" | |
gsettings set org.gnome.desktop.wm.keybindings switch-windows "[]" | |
gsettings set org.gnome.desktop.wm.keybindings switch-windows-backward "[]" | |
gsettings set org.gnome.desktop.wm.keybindings cycle-windows "['<Super>Tab']" | |
gsettings set org.gnome.desktop.wm.keybindings cycle-windows-backward "['<Shift><Super>Tab']" |
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 | |
PROXY=$(curl -s ipinfo.io/ip) | |
BACKEND="(dig +short example.com) | |
set -x | |
iptables -t nat -F | |
iptables -t nat -A PREROUTING -p tcp --dport 80 -d $PROXY -j DNAT --to $BACKEND:80 | |
iptables -t nat -A PREROUTING -p tcp --dport 443 -d $PROXY -j DNAT --to $BACKEND:443 |
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 * as LibhoneyEventAPI from 'honeycomb-beeline/lib/api/libhoney'; // tslint:disable-line no-submodule-imports | |
import * as tracker from 'honeycomb-beeline/lib/async_tracker'; // tslint:disable-line no-submodule-imports | |
shimmer.wrap(LibhoneyEventAPI.prototype, 'startSpan', original => function () { | |
const eventPayload = original.apply(this, arguments); | |
const context = tracker.getTracked(); | |
if (context.stack.length > 1) context.stack.pop(); | |
return eventPayload; | |
}); |
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
query ($login:String!, $first:Int!, $after:String,$before:String) { | |
user(login:$login) { | |
pullRequests(first:$first,after:$after,before:$before) { | |
nodes{ | |
repository { | |
nameWithOwner | |
} | |
number | |
} | |
pageInfo { |
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 | |
auth_email='my email' | |
auth_key='my auth key' | |
zone_id='my zone id' | |
record_id='my record id' | |
name='my record name' | |
addr="$(curl -f -s myip.redcoat.grep.ro)" | |
url="https://api.cloudflare.com/client/v4/zones/$zone_id/dns_records/$record_id" | |
body='{"type":"A","name":"'$name'","content":"'$addr'","ttl":1,"proxied":false}' |
NewerOlder