Skip to content

Instantly share code, notes, and snippets.

Avatar

Christiaan Janssen christiaan-janssen

  • Zoetermeer - Holland
View GitHub Profile
View knife.el
(defun knife-boostrap ()
"Bootstrap a new node using chef."
(interactive)
(let
((ip (read-string "Node IP: "))
(name (read-string "Node name: "))
(role (let ((choices '("default" "mid-server" "unifi-controller")))
(ido-completing-read "Role: " choices))))
(async-shell-command
(concat "knife boostrap " ip
@christiaan-janssen
christiaan-janssen / chef.el
Last active May 14, 2019
Run chef commands from emacs
View chef.el
;;; Package --- Sumary:
;;; Emacs main config file
;;; Commentary:
;;; Code:
(defun parent-directory (dir)
"return parent directory of dir"
(unless (equal "/" dir)
(file-name-directory (directory-file-name dir))))
View .zshrc
export ZSH="~/.oh-my-zsh"
ZSH_THEME="bureau"
COMPLETION_WAITING_DOTS="true"
plugins=(
git
docker
emacs
kitchen
View init.vim
let vimplug_exists=expand('~/.config/nvim/autoload/plug.vim')
if !filereadable(vimplug_exists)
if !executable("curl")
echoerr "You have to install curl or first install vim-plug yourself!"
execute "q!"
endif
echo "Installing Vim-Plug..."
echo ""
View .tmux.conf
#set-option -g status-keys emacs
#set-option -g mode-keys emacs
# Remap prefix to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind | split-window -h
bind - split-window -v
View treemacs.el
(use-package treemacs
:ensure t
:defer t
:init
(with-eval-after-load 'winum
(define-key winum-keymap (kbd "M-0") #'treemacs-select-window))
:config
(progn
(setq treemacs-collapse-dirs (if (executable-find "python3") 3 0)
View init.el
;;; Package --- Sumary:
;;; Commentary:
;;; Code:
;;; Create some ssane defaults
(setq delete-old-versions -1) ;; delete excessclojure play sound backup versions silently
(setq version-control t) ; use version control
(setq vc-make-backup-files t) ; make backups file even when in version controlled dir
(setq backup-directory-alist `(("." . "~/.emacs.d/backups"))) ; which directory to put backups file
View kubctl-commands.sh
# Delete running pod
kubectl get pods | grep Running | awk '{print $1}' | xargs kubectl delete pods
# Delete all evicted pods
kubectl get pods | grep Evicted | awk '{print $1}' | xargs kubectl delete pods
@christiaan-janssen
christiaan-janssen / plot_load.py
Last active Apr 14, 2017
Poor mans load graphs
View plot_load.py
"""
Plot the load of a server with https://plot.ly
save load with:
while :
do
echo `uptime` >> load.txt
sleep 1m
done
@christiaan-janssen
christiaan-janssen / add_users_to_www-data.sh
Created Jul 9, 2015
Find users and add them to a group
View add_users_to_www-data.sh
for user in `cat /etc/passwd | grep '._it' | cut -f1 -d':'`
do
`usermod -a -G www-data $user`
done