Skip to content

Instantly share code, notes, and snippets.

@mcastelino
mcastelino / .vimrc
Last active September 6, 2016 19:29
vimrc with YCM and Syntastic Support alongside tagbar and nerdtree git
execute pathogen#infect()
syntax on
filetype plugin indent on
setlocal cinoptions=:0
setlocal spell spelllang=en_us
set nu
"Theme
set background=dark
colorscheme solarized
@mcastelino
mcastelino / .tmux.conf
Last active August 8, 2016 23:50
tmux configuration with logical key sequences and co-existence with mobaxterm
# remap prefix from 'C-b' to 'C-a'
unbind C-b
set-option -g prefix C-a
bind-key C-a send-prefix
# split panes using | and -
bind h split-window -h
bind v split-window -v
unbind '"'
unbind %
@mcastelino
mcastelino / DockerTips.md
Last active November 30, 2016 20:41
Docker tips and tricks

Delete dangling volumes

docker volume rm $(docker volume ls -f dangling=true -q)

docker rmi $(docker images -f dangling=true -q)

Get the docker log on a systemd platform

@mcastelino
mcastelino / demo_script.txt
Last active March 27, 2017 16:19
CC Swarm Demo
# Delete any old containers and services
sudo docker service ls
sudo docker service rm $(sudo docker service ls -q)
sudo docker rm -f $(sudo docker ps -a -q)
# Show you can just run containers with the "exact same CLI"
docker run -it debian
@mcastelino
mcastelino / random tips
Last active November 19, 2018 01:20
Clearlinux tips
#How to dump qemu device properties (example for virtio-net)
qemu-system-x86_64 -device virtio-net,help
#To rollback to DESIRED_VERSION
swupd verify --fix -m $(DESIRED_VERSION)
git reset --soft "HEAD^"
git commit --amend
#side by side terminal diff
@mcastelino
mcastelino / git_rebase_to_squash
Last active September 14, 2023 17:50
github code review workflow for branches
Thought I would document something that helps speed up github code review process for people who have lots of PR's in flight that build
on top of each other
My normal workflow involves
1. Branch off of master for PR1 on branch branch_pr1
2. Submit a PR from branch_pr1 (head of this branch is sha_pr1_old)
3. Wait for code review comments ##
4. Continue development for PR2 on branch_pr2 which is off of branch_pr2 (you have branched off at sha_pr1_old)
5. Submit a PR from branch_pr2
6. When you get code review feedback for branch_pr1, incorporate it and squash them back on branch_pr1 (to keep a clean history on github)
@mcastelino
mcastelino / fedora_fonts
Created September 5, 2016 14:47
Fixing fonts on Fedora 24 - Freetype
https://www.reddit.com/r/Fedora/comments/3o6ijr/trying_fedora_23_for_the_first_time_why_do_fonts/
http://rpmfusion.org/Configuration
su -c 'dnf install http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm'
sudo dnf install freetype-freeworld
Add them to /etc/fonts/local.conf for system wide use.
@mcastelino
mcastelino / building_vim.txt
Created September 12, 2016 20:56
Building vim from sources for use with vim-go as well a YCM
# Ensure that you install all the dependencies
sudo apt-get install libncurses5-dev libgnome2-dev libgnomeui-dev \
libgtk2.0-dev libatk1.0-dev libbonoboui2-dev \
libcairo2-dev libx11-dev libxpm-dev libxt-dev python-dev \
python3-dev ruby-dev lua5.1 lua5.1-dev libluajit-5.1-dev git
# Ensure that you have the right python config directory
pip install python-config
/usr/bin/python2.7-config --configdir
@mcastelino
mcastelino / minikube_proxy.md
Last active February 20, 2019 04:00
HOWTO: minikube behind a proxy

https://github.com/kubernetes/minikube

Note: Ensure that you have an active default virtual machine network setup on your machine. This can be verified using

virsh net-list 

You should see something along the lines of

@mcastelino
mcastelino / ubuntu cloud image creation
Last active September 29, 2016 20:26
ubuntu cloud image creation
How to create a simple cloud image
sudo apt-get install cloud-utils
wget https://cloud-images.ubuntu.com/xenial/current/xenial-server-cloudimg-amd64-disk1.img
mv xenial-server-cloudimg-amd64-disk1.img xenial-server-cloudimg-amd64-disk1.img.dist
qemu-img convert -O qcow2 xenial-server-cloudimg-amd64-disk1.img.dist xenial-server-cloudimg-amd64-disk1.img
qemu-img resize xenial-server-cloudimg-amd64-disk1.img +40G
user-data
#cloud-config