Skip to content

Instantly share code, notes, and snippets.

View ivan4th's full-sized avatar

Ivan Shvedunov ivan4th

  • Spacemesh
  • Yerevan, Armenia
  • 04:00 (UTC +04:00)
View GitHub Profile
defscrollback 10000
termcapinfo xterm|xterms|xs|rxvt ti@:te@
startup_message off
hardstatus alwayslastline
hardstatus string '%{= kK}%-Lw%{= KW}%50>%n%f* %t%{= kK}%+Lw%< %{= kG}%-=%D %d %M %Y %c%{-}'
altscreen on
# screen -t server 0 /home/ivan4th/work/cms/run-server.sh
# screen -t swank-js 1 /home/ivan4th/bin/run-swank-js.sh
# screen -t ipython 3 ipython
# screen -t htop 0 htop
@ivan4th
ivan4th / ssh-config.d-support.sh
Created November 18, 2015 10:21
.ssh/config.d support
# http://code-and-hacks.peculier.com/articles/setting-terminal-title-in-gnu-screen/
function settitle () {
if [ "$TERM" != "screen" ]; then
return
fi
if [ -n "$STY" ] ; then
# We are in a screen session
# echo "Setting screen titles to $@"
printf "\033k%s\033\\" "$@"
# screen -X eval "at \\# title $@" "shelltitle $@"
@ivan4th
ivan4th / my-jabber-chat-with.el
Created March 20, 2013 15:14
ido-based jabber-chat-with variant for jabber.el
(require 'ido)
(provide 'my-jabber-chat-with)
(defvar *my-jid-history* '())
(defun my-jabber-read-jid-completing (prompt)
(let* ((hist-items (remove-duplicates *my-jid-history* :test #'equal))
(choices
(mapcar #'symbol-name (jabber-concat-rosters))))
(setf choices (append hist-items
@ivan4th
ivan4th / netwatch.sh
Created December 27, 2015 00:05
Network connection watcher script
#!/bin/bash
set -u -e
exec >> /tmp/conncheck.log
exec 2>&1
router_ip="192.168.20.1"
ping_ip="8.8.8.8"
admin_pw="$(echo '.....insert base64 encoded pw here .....'|base64 -d)"
check_interval=300
recheck_count=10
@ivan4th
ivan4th / k8s_apply_int_ext_mixup.txt
Created July 7, 2016 11:14
kubectl apply int/ext mixup debugging on the client side
ivan4th@ivan4th:~/work/kubernetes/src/k8s.io/kubernetes (fix-kubectl-apply-for-init-containers *%) $ cat ~/work/ictest1.yaml
apiVersion: v1
kind: Pod
metadata:
name: nginx
labels:
app: nginx
annotations:
pod.alpha.kubernetes.io/init-containers: "[{\"name\":\"wait\",\"image\":\"ubuntu:16.04\",\"command\":[\"/bin/sh\",\"-c\",\"sleep 10\"]}]"
spec:
ivan4th@ivan4th:~/work/kubernetes/src/k8s.io/kubernetes (fix-kubectl-apply-for-init-containers *%) $ git diff
diff --git a/pkg/kubectl/apply.go b/pkg/kubectl/apply.go
index 6f183f1..7bad4ae 100644
--- a/pkg/kubectl/apply.go
+++ b/pkg/kubectl/apply.go
@@ -19,6 +19,7 @@ package kubectl
import (
"encoding/json"
+ "fmt"
@ivan4th
ivan4th / kube-proxy-goroutines.txt
Created February 3, 2017 18:26
kube-proxy hangs - goroutines
(dlv) goroutines
[79 goroutines]
Goroutine 1 - User: .go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/pkg/proxy/iptables/proxier.go:421 k8s.io/kubernetes/pkg/proxy/iptables.(*Proxier).SyncLoop (0xdd5f7e)
Goroutine 2 - User: .usr/local/go/src/runtime/proc.go:260 runtime.gopark (0x43307a)
Goroutine 3 - User: .usr/local/go/src/runtime/proc.go:260 runtime.gopark (0x43307a)
Goroutine 4 - User: .usr/local/go/src/runtime/proc.go:2524 runtime.exitsyscall (0x4394d4)
Goroutine 17 - User: .usr/local/go/src/runtime/asm_amd64.s:2087 runtime.goexit (0x464081)
Goroutine 18 - User: .usr/local/go/src/runtime/proc.go:260 runtime.gopark (0x43307a)
Goroutine 19 - User: .go/src/k8s.io/kubernetes/_output/dockerized/go/src/k8s.io/kubernetes/vendor/github.com/golang/glog/glog.go:879 k8s.io/kubernetes/vendor/github.com/golang/glog.(*loggingT).flushDaemon (0x56a331)
Goroutine 20 - User: .usr/local/go/src/runtime/proc.go:260 runtime.gopark (0x43307a)
@ivan4th
ivan4th / kube-proxy-threads.txt
Created February 3, 2017 18:27
kube-proxy hangs - threads
(dlv) threads
Thread 1 at 0x464d07 .usr/local/go/src/runtime/sys_linux_amd64.s:95 runtime.usleep
Thread 7 at 0x465123 .usr/local/go/src/runtime/sys_linux_amd64.s:388 runtime.futex
Thread 8 at 0x464d07 .usr/local/go/src/runtime/sys_linux_amd64.s:95 runtime.usleep
Thread 9 at 0x465123 .usr/local/go/src/runtime/sys_linux_amd64.s:388 runtime.futex
Thread 10 at 0x464d07 .usr/local/go/src/runtime/sys_linux_amd64.s:95 runtime.usleep
Thread 11 at 0x465123 .usr/local/go/src/runtime/sys_linux_amd64.s:388 runtime.futex
Thread 12 at 0x464d07 .usr/local/go/src/runtime/sys_linux_amd64.s:95 runtime.usleep
Thread 13 at 0x464d07 .usr/local/go/src/runtime/sys_linux_amd64.s:95 runtime.usleep
Thread 14 at 0x465237 .usr/local/go/src/runtime/sys_linux_amd64.s:479 runtime.osyield
@ivan4th
ivan4th / kube-proxy-sigquit.txt
Created February 3, 2017 18:28
kube-proxy log - killed with SIGQUIT
I0130 17:16:29.223801 1 server.go:215] Using iptables Proxier.
W0130 17:16:30.386099 1 server.go:468] Failed to retrieve node info: nodes "node158" not found
W0130 17:16:30.386240 1 proxier.go:249] invalid nodeIP, initialize kube-proxy with 127.0.0.1 as nodeIP
I0130 17:16:30.386275 1 server.go:227] Tearing down userspace rules.
I0130 17:16:30.386376 1 healthcheck.go:119] Initializing kube-proxy health checker
I0130 17:16:30.488856 1 conntrack.go:81] Set sysctl 'net/netfilter/nf_conntrack_max' to 1572864
I0130 17:16:30.489253 1 conntrack.go:66] Setting conntrack hashsize to 393216
I0130 17:16:30.492146 1 conntrack.go:81] Set sysctl 'net/netfilter/nf_conntrack_tcp_timeout_established' to 86400
I0130 17:16:30.492177 1 conntrack.go:81] Set sysctl 'net/netfilter/nf_conntrack_tcp_timeout_close_wait' to 3600
I0130 17:16:31.580885 1 proxier.go:472] Adding new service "kube-system/kubedns:dns" at 10.224.0.3:53/UDP
@ivan4th
ivan4th / kube-proxy-gp
Created February 3, 2017 18:52
gp details for kube-proxy
(dlv) thread 14
Switched from 34689 to 14
(dlv) print gp
*runtime.g {
stack: runtime.stack {lo: 842350829568, hi: 842350831584},
stackguard0: 18446744073709550302,
stackguard1: 18446744073709551615,
_panic: *runtime._panic nil,
_defer: *runtime._defer nil,
m: *runtime.m {