Skip to content

Instantly share code, notes, and snippets.

Avatar
🤔
🤔

Andrey Kostakov AyumuKasuga

🤔
🤔
View GitHub Profile
View iptables
*nat
:PREROUTING ACCEPT [3423:660395]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [43075:8811003]
:POSTROUTING ACCEPT [40442:8299404]
:DOCKER - [0:0]
-A PREROUTING -m addrtype --dst-type LOCAL -j DOCKER
-A OUTPUT ! -d 127.0.0.0/8 -m addrtype --dst-type LOCAL -j DOCKER
-A POSTROUTING -s 172.17.0.0/16 ! -o docker0 -j MASQUERADE
-A POSTROUTING -s 172.17.0.3/32 -d 172.17.0.3/32 -p tcp -m tcp --dport 5432 -j MASQUERADE
View kshell
#!/bin/sh
if [ "$1" = "" ]; then
echo "Usage: kshell <pod>"
exit 1
fi
COLUMNS=`tput cols`
LINES=`tput lines`
TERM=xterm
kubectl exec -i -t $1 env COLUMNS=$COLUMNS LINES=$LINES TERM=$TERM bash
@AyumuKasuga
AyumuKasuga / wifi-resume.service
Created Aug 27, 2017
/etc/systemd/system/wifi-resume.service
View wifi-resume.service
#/etc/systemd/system/wifi-resume.service
#sudo systemctl enable wifi-resume.service
[Unit]
Description=Restart networkmanager at resume
After=suspend.target
After=hibernate.target
After=hybrid-sleep.target
[Service]
Type=oneshot
View remove_old_images.sh
docker images | grep 'days ago\|weeks ago' | grep -v 'centos' | awk '{print $3}' | xargs --no-run-if-empty docker rmi
View keybase.md

Keybase proof

I hereby claim:

  • I am AyumuKasuga on github.
  • I am ayumukasuga (https://keybase.io/ayumukasuga) on keybase.
  • I have a public key whose fingerprint is FCCB 2936 1732 D16D 854C 2607 B772 AA0B 1657 F017

To claim this, I am signing this object:

@AyumuKasuga
AyumuKasuga / list_filter_collapse.js
Last active Jan 27, 2016 — forked from jjdelc/list_filter_collapse.js
Collapse list_filter in Django admin
View list_filter_collapse.js
;(function($){
ListFilterCollapsePrototype = {
bindToggle: function(){
var that = this;
this.$filterEl.click(function(){
that.$filterList.slideToggle();
});
},
init: function(filterEl) {
this.$filterEl = $(filterEl).css('cursor', 'pointer');
View .vimrc
set hidden
set nocompatible
set expandtab
set tabstop=4
set softtabstop=4
set shiftwidth=4
set scrolloff=10
set autoindent
set smartindent
set number
View gist:718e45841c4a081a38fd
#iptables -t nat -A PREROUTING -i br0 -p udp --dport 53 -j DNAT --to-destination 192.168.47.100:9053
#iptables -t nat -A PREROUTING -i br0 -p tcp -m tcp -d ! 192.168.47.100 -j DNAT --to-destination 192.168.47.100:9040
#iptables -t nat -A PREROUTING -i br1 -j DROP
View totbox iptbles
/etc/iptables.rules
# Generated by iptables-save v1.4.14 on Thu Jun 5 19:52:31 2014
*nat
:PREROUTING ACCEPT [0:0]
:INPUT ACCEPT [0:0]
:OUTPUT ACCEPT [0:0]
:POSTROUTING ACCEPT [0:0]
-A PREROUTING -i wlan0 -p udp --dport 53 -j REDIRECT --to-ports 53
-A PREROUTING -i wlan0 -p tcp --syn -j REDIRECT --to-ports 9040
View auto_clean_rpm.py
import os
from collections import defaultdict
LIMIT = 1
file_dict = defaultdict(list)
remove_files = []
for filename in os.listdir('.'):
start = filename.split('-')[0]
You can’t perform that action at this time.