Skip to content

Instantly share code, notes, and snippets.

View praveenkumar's full-sized avatar
🏠
Working from home

Praveen Kumar praveenkumar

🏠
Working from home
View GitHub Profile
@mfojtik
mfojtik / run.sh
Created November 7, 2018 10:58
POC: Run RHCOS via xhyve on OSX with ignition
# These have to be extracted from the qcow2 image
# TODO: Provide these via docker image?
KERNEL="vmlinuz-3.10.0-862.14.4.el7.x86_64"
INITRD="initramfs-3.10.0-862.14.4.el7.x86_64.img"
# This is where the magic happens
#
# To change the ignition (node type), you can use 'bootstrap', 'master' or 'worker'
# coreos.config.url=http://192.168.0.168:8080/bootstrap.ign
#
apiVersion: v1
items:
- apiVersion: v1
kind: ImageStream
metadata:
annotations:
openshift.io/image.dockerRepositoryCheck: 2017-06-28T15:00:23Z
creationTimestamp: null
generation: 2
labels:
@xjdrew
xjdrew / client.go
Last active February 25, 2026 03:05
golang tls client and server, require and verify certificate in double direction
package main
import (
"crypto/tls"
"crypto/x509"
"flag"
"io"
"io/ioutil"
"log"
"os"
@marcan
marcan / linux.sh
Last active July 26, 2025 08:39
Linux kernel initialization, translated to bash
#!/boot/bzImage
# Linux kernel userspace initialization code, translated to bash
# (Minus floppy disk handling, because seriously, it's 2017.)
# Not 100% accurate, but gives you a good idea of how kernel init works
# GPLv2, Copyright 2017 Hector Martin <marcan@marcan.st>
# Based on Linux 4.10-rc2.
# Note: pretend chroot is a builtin and affects the current process
# Note: kernel actually uses major/minor device numbers instead of device name
@so0k
so0k / kubectl.md
Last active April 8, 2026 10:42
Playing with kubectl output

Kubectl output options

Let's look at some basic kubectl output options.

Our intention is to list nodes (with their AWS InstanceId) and Pods (sorted by node).

We can start with:

kubectl get no
@jasonbrooks
jasonbrooks / kube-setenforce-1.md
Last active January 5, 2017 20:38
kubernetes ansible setenforce 1

I use these ansible scripts (see also) to bring up kubernetes clusters, on centos and fedora. The scripts are awesome, but they put selinux into permissive mode, because, "tokens and selinux don't work together."

That's unfortunate, because one of the main things I'm doing when I turn up a kubernetes cluster is bug-hunting, and selinux can be a source of bugs.

I commented out the bit that put selinux into permissive mode:

#- name: Set selinux permissive because tokens and selinux don't work together
#  selinux: state=permissive policy={{ ansible_selinux.type }}
# when: ansible_selinux is defined and ansible_selinux.status == "enabled"
@mastef
mastef / isexist_vs_isnotexist.go
Created February 4, 2016 08:30
os.IsExist(err) vs os.IsNotExist(err)
/*
Watch out, os.IsExist(err) != !os.IsNotExist(err)
They are error checkers, so use them only when err != nil, and you want to handle
specific errors in a different way!
Their main purpose is to wrap around OS error messages for you, so you don't have to test
for Windows/Unix/Mobile/other OS error messages for "file exists/directory exists" and
"file does not exist/directory does not exist"
#!/usr/bin/env ruby
require 'rubydns'
INTERFACES = [
[:udp, "0.0.0.0", 53],
[:tcp, "0.0.0.0", 53]
]
Name = Resolv::DNS::Name
IN = Resolv::DNS::Resource::IN
@zchee
zchee / cgo.md
Last active June 20, 2025 08:51
cgo convert list

See also, http://libraryofalexandria.io/cgo/

Using Go cgo

cgo has a lot of trap.
but Not "C" pkg also directory in $GOROOT/src. IDE's(vim) Goto command not works.

So, Here collect materials.

@tanb
tanb / xhyve-freebsd-tutorial-1.md
Last active November 27, 2021 13:07
FreeBSD running on xhyve tutorial. (Appendix: Resize image with qemu. Create FreeBSD VM with qemu).

TL;DR

  • Create 5GB FreeBSD image.
  • Install FreeBSD on xhyve.
  • Mount host directory.

Requisites