Skip to content

Commit

Permalink
fix proxy and new aliases for zshrc/git
Browse files Browse the repository at this point in the history
  • Loading branch information
ppalucki committed Sep 11, 2024
1 parent fbb9be8 commit 8f83c13
Show file tree
Hide file tree
Showing 5 changed files with 20 additions and 4 deletions.
4 changes: 4 additions & 0 deletions gitconfig_2022
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,10 @@ d = difftool
dd = difftool -t dirdiff -d --no-prompt
ds = diff --stat
b = !git --no-pager branch -vv
ba = !git --no-pager branch -a -vv
bd = !git --no-pager for-each-ref --sort=committerdate refs/heads/ --format='%(committerdate:short) (%(committerdate:relative)) %(refname:short)'
bda = !git --no-pager for-each-ref --sort=committerdate refs/remotes/ --format='%(committerdate:short) (%(committerdate:relative)) %(refname:short)'
# below similar to above with pager
branches = branch -vv
branchall = branch -a -vv
branchesall = branch -a -vv
Expand Down
4 changes: 4 additions & 0 deletions proxy/cleartables.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ iptables -t nat -X REDSOCKS
iptables -t nat -X DOCKER
iptables -t nat -X DOCKER-ISOLATION
iptables -t filter -F
iptables -t filter -X DOCKER
iptables -t filter -X DOCKER-USER
iptables -t filter -X DOCKER-ISOLATION-STAGE-1
iptables -t filter -X DOCKER-ISOLATION-STAGE-2

iptables -Z PROXY -t nat
iptables -Z
Expand Down
8 changes: 6 additions & 2 deletions proxy/start_proxy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@ set -x
# # sysctl -w net.ipv4.conf.all.route_localnet=1
# # sysctl -p
# sc-restart docker
sysctl -n net.ipv4.conf.all.route_localnet=0
sysctl -n net.ipv4.conf.docker0.route_localnet=1
## config before 2024
#sysctl -n net.ipv4.conf.all.route_localnet=0
#sysctl -n net.ipv4.conf.docker0.route_localnet=1

## config after 2024
sysctl -n net.ipv4.conf.all.route_localnet=1 # required to route all even new docker networks created by kind

### ------------------- NAT ------------------------------------
#Creating Chain for transparency rules and adding for flow chains (output and "routing")
Expand Down
4 changes: 3 additions & 1 deletion proxy/tips.sh
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ sudo iptables-save | grep :CNI | cut -f 1 -d " " | cut -f 2 -d ':' | sudo xargs
sudo iptables --flush
sudo iptables -t nat -F
sudo iptables -t nat -Z REDSOCKS
sud oiptables -t nat -Z POSTROUTING
sudo iptables -t nat -Z POSTROUTING
sudo iptables -t nat -Z PREROUTING
sudo iptables -t nat -Z OUTPUT
sudo iptables -t nat -X REDSOCKS
Expand All @@ -71,3 +71,5 @@ watch -n0.5 --no-title -d=p 'echo --------------------- nat --------------------
export ANSIBLE_CACHE_PLUGIN_CONNECTION=/tmp/ansible-caches ANSIBLE_CACHE_PLUGIN=jsonfile
ANSBILE_KEEP_REMOTE_FILES=1


watch -n1 -d sudo bash -c 'iptables-save -c 2>/dev/null | grep -v "#"'
4 changes: 3 additions & 1 deletion zshrc_2022
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,9 @@ setopt hist_ignore_all_dups
alias kaf="kubectl apply -f"
alias kg="kubectl get"
alias kbusybox="kubectl run --rm -i -t busybox --image=busybox --restart=Never"
alias knethost="kubectl run --rm -i -t busybox --image=nicolaka/netshoot --restart=Never"
alias knethost="kubectl run --rm -i -t nethost --image=nicolaka/netshoot --restart=Never"
alias busybox="docker run -ti --rm busybox"
alias nethost="docker run -ti --rm nethost --image=nicolaka/netshoot --restart=Never"
alias tmuxz='tmux new-session /bin/zsh \; set default-shell /bin/zsh'
alias -g LS=' | less -S'
alias -g GG=' 2>&1 | grep'
Expand Down

0 comments on commit 8f83c13

Please sign in to comment.