Skip to content

Instantly share code, notes, and snippets.

View b-a-t's full-sized avatar

Timur Bakeyev b-a-t

View GitHub Profile
@b-a-t
b-a-t / docker_iptables
Created May 25, 2021 21:33 — forked from deric/docker_iptables
Generate iptables port forwarding for running containers (assumes default Docker chains already exists)
#!/bin/bash
set -o nounset -o pipefail
#
function -h {
cat <<USAGE
Generate iptables rules for running docker containers. Use
$(basename $0) -v -n
to inspect iptables rules without applying changes.
USAGE:
-b / --binary iptables binary
@b-a-t
b-a-t / docker_iptables.rules
Last active May 25, 2021 21:32 — forked from x-yuri/1.txt
docker 18.09.6 basic iptables rules with comments
*nat
:PREROUTING ACCEPT
:INPUT ACCEPT
:OUTPUT ACCEPT
:POSTROUTING ACCEPT
:DOCKER -
# (nat.1)
# when receiving a connection targeting a local address
# from the outside world to 1.1.1.1,
@b-a-t
b-a-t / nginx-sigquit.Dockerfile
Created February 25, 2020 12:51 — forked from nottrobin/nginx-sigquit.Dockerfile
nginx should use STOPSIGNAL SIGQUIT
FROM nginx
RUN echo 'server {\n\
listen 80 default_server;\n\
location / {\n\
proxy_pass http://httpbin.org/delay/10;\n\
}\n\
}' > /etc/nginx/conf.d/default.conf
STOPSIGNAL SIGQUIT
@b-a-t
b-a-t / Dumper.py
Created February 13, 2020 13:42 — forked from passos/Dumper.py
A perl Data.Dumper clone for Python
"""
A perl Data.Dumper clone for Python
Author: simon@log4think.com
2011-07-08
Copyright 2011 Jinyu LIU
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 all copies or substantial portions of the Software.
{
"title": "Control_L + Shift_L to Control + Space",
"rules": [
{
"description": "Control_L + Shift_L to Control + Space",
"manipulators": [
{
"type": "basic",
"from": {
"key_code": "left_shift",
@b-a-t
b-a-t / main.yaml
Created September 4, 2018 00:18 — forked from theory14/main.yaml
Ansible role for updating FreeBSD machines with freebsd-update and pkg
---
- name: Check status of jailing
shell: "sysctl security.jail.jailed | cut -d: -f2 | tr -d ' '"
register: is_jail
when: "ansible_os_family == 'FreeBSD' "
- name: Fetch and Install Updates
command: "{{ item }}"
when: "ansible_os_family == 'FreeBSD' and is_jail.stdout == '0'"