Skip to content

Instantly share code, notes, and snippets.

(setq enh-ruby-program "/home/gnufied/.rbenv/versions/1.9.3-p448/bin/ruby")
(autoload 'enh-ruby-mode "enh-ruby-mode" "Major mode for ruby files" t)
(add-to-list 'auto-mode-alist '("\\.rb$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("\\.rake$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("Rakefile$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("\\.gemspec$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("\\.ru$" . enh-ruby-mode))
(add-to-list 'auto-mode-alist '("Gemfile$" . enh-ruby-mode))
(add-to-list 'interpreter-mode-alist '("ruby" . enh-ruby-mode))
;; Set the starting position and width and height of Emacs Window
(add-to-list 'default-frame-alist '(left . 0))
(add-to-list 'default-frame-alist '(top . 0))
(add-to-list 'default-frame-alist '(height . 45))
(add-to-list 'default-frame-alist '(width . 175))
;; To get rid of Weird color escape sequences in Emacs.
;; Instruct Emacs to use emacs term-info not system term info
;; http://stackoverflow.com/questions/8918910/weird-character-zsh-in-emacs-terminal
(setq system-uses-terminfo nil)
kind: Pod
apiVersion: v1
metadata:
name: nginx-with-vol
labels:
name: nginx-with-vol
spec:
containers:
- name: nginx-with-vol
image: nginx
-- Inside node_auth.test
^^^^^^^^^^ Original object is &core.PersistentVolumeClaim{TypeMeta:v1.TypeMeta{Kind:"", APIVersion:""}, ObjectMeta:v1.ObjectMeta{Name:"mypvc", GenerateName:"", Namespace:"ns", SelfLink:"/api/v1/namespaces/ns/persistentvolumeclaims/mypvc", UID:"fff05c83-cf86-11e7-83e4-0242ac110002", ResourceVersion:"1796", Generation:0
, CreationTimestamp:v1.Time{Time:time.Time{wall:0x0, ext:63646953238, loc:(*time.Location)(0x957dda0)}}, DeletionTimestamp:(*v1.Time)(nil), DeletionGracePeriodSeconds:(*int64)(nil), Labels:map[string]string(nil), Annotations:map[string]string(nil), OwnerReferences:[]v1.OwnerReference(nil), Initializers:(*v1.Initialize
rs)(nil), Finalizers:[]string(nil), ClusterName:""}, Spec:core.PersistentVolumeClaimSpec{AccessModes:[]core.PersistentVolumeAccessMode{"ReadOnlyMany"}, Selector:(*v1.LabelSelector)(nil), Resources:core.ResourceRequirements{Limits:core.ResourceList(nil), Requests:core.ResourceList{"storage":resource.Quantity{i:resource
.int64Amount{value:1, scale:0}, d:resou

Keybase proof

I hereby claim:

  • I am gnufied on github.
  • I am gnufied (https://keybase.io/gnufied) on keybase.
  • I have a public key ASBj6SJdy3cvrRtQl_obIu_tna9OeIpn2PtrDbEYbxiTsQo

To claim this, I am signing this object:

for 37 with volume
Operation * create_delete_loop took on average 73.54864007360001
for 37 without volumes:
Operation create_delete_loop took on average 45.497796535599996
For 35 with volume
Operation * create_delete_loop took on average 48.5834527769
oldSize := oldPvc.Spec.Resources.Requests[api.ResourceStorage]
newSize := pvc.Spec.Resources.Requests[api.ResourceStorage]
if newSize.Cmp(oldSize) <= 0 {
return nil
}
if oldPvc.Status.Phase != api.ClaimBound {
return admission.NewForbidden(a, fmt.Errorf("Only bound persistent volume claims can be expanded"))
}
@gnufied
gnufied / run_kube.md
Last active August 25, 2017 19:32
Using Invoker to run kubernetes locally for development

I use Invoker for running Kubernetes locally while developing Kubernetes. It is relatively simple setup and unlike ./hack/local-up-cluster.sh doesn't involve any magical bits that my tiny brain can't understand. It is basically all kubernetes components started and running individually.

You can use following instructions for running kubenetes locally. Just don't forget to change hostname (xaos.lan to match your hostname). Similarly change ip address used here - "192.168.1.71" to your machine's IP address and similarly location of etcd and kubernetes binaries.

  1. Install Invoker ~> gem install invoker

  2. Compile kube ~> cd kube_home; make

╭─ xaos☯  ⸙-2.4.1   master
╰─kube_scripts/nfs_xaos_demo> k get pods
NAME READY STATUS RESTARTS AGE
writer-pod2 1/1 Running 0 57s
╭─ xaos☯  ⸙-2.4.1   master
╰─kube_scripts/nfs_xaos_demo> k delete pod writer-pod2 --now --force=true
pod "writer-pod2" deleted
╭─ xaos☯  ⸙-2.4.1   master
╰─kube_scripts/nfs_xaos_demo> k get pods
NAME READY STATUS RESTARTS AGE
[Desktop Entry]
Name=AgileAgent
Exec=env WINEPREFIX="/home/gnufied/.wine" wine "/home/gnufied/.wine/drive_c/Program Files (x86)/1Password 4/Agile1pAgent.exe" &
Type=Application
StartupNotify=true
Path=/home/gnufied/.wine/dosdevices/c:/Program Files (x86)/1Password 4
Icon=C775_1Password.0