Skip to content

Instantly share code, notes, and snippets.

View ivan4th's full-sized avatar

Ivan Shvedunov ivan4th

  • Spacemesh
  • Yerevan, Armenia
  • 01:15 (UTC +04:00)
View GitHub Profile
@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 / 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 / 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 $@"
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 / 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