Skip to content

Instantly share code, notes, and snippets.

View the-redback's full-sized avatar
:octocat:

Abdullah Al Maruf the-redback

:octocat:
View GitHub Profile
@the-redback
the-redback / docker-gravity
Created March 1, 2018 05:01
Pull Down all Docker Images of a Organization
#!/bin/bash
set -eou pipefail
# ${1} = <organization-name>
docker search ${1} | grep -o -E '^[[:alnum:]]+/[^[:blank:]]+' | xargs -L 1 -P 1 docker pull -a
@the-redback
the-redback / vscode-updater
Last active April 30, 2019 06:20
Update or Install latest vscode without uninstalling previous one.
#!/bin/bash
set -eou pipefail
wget https://vscode-update.azurewebsites.net/latest/linux-deb-x64/stable -O /tmp/code_latest_amd64.deb
sudo dpkg -i /tmp/code_latest_amd64.deb
$ kubectl get --raw /apis/rbac.authorization.k8s.io | jq
{
  "kind": "APIGroup",
  "apiVersion": "v1",
  "name": "rbac.authorization.k8s.io",
  "versions": [
    {
      "groupVersion": "rbac.authorization.k8s.io/v1",
 "version": "v1"
#!/bin/bash
set -exou pipefail
helm init || true
kubectl create serviceaccount --namespace kube-system tiller
kubectl create clusterrolebinding tiller-cluster-rule --clusterrole=cluster-admin --serviceaccount=kube-system:tiller
kubectl patch deploy --namespace kube-system tiller-deploy -p '{"spec":{"template":{"spec":{"serviceAccount":"tiller"}}}}'
type T struct {
A int
B string
}
t := T{23, "skidoo"}
s := reflect.ValueOf(&t).Elem()
typeOfT := s.Type()
for i := 0; i < s.NumField(); i++ {
apiVersion: apiextensions.k8s.io/v1beta1
kind: CustomResourceDefinition
metadata:
creationTimestamp: 2018-11-27T10:05:51Z
generation: 1
labels:
app: catalog
name: appbindings.appcatalog.appscode.com
resourceVersion: "1515"
selfLink: /apis/apiextensions.k8s.io/v1beta1/customresourcedefinitions/appbindings.appcatalog.appscode.com
{
"kind": "AppBinding",
"apiVersion": "appcatalog.appscode.com/v1alpha1",
"metadata": {
"name": "kubedb:postgres:demo:infant-postgres",
"namespace": "demo",
"creationTimestamp": null,
"labels": {
"kubedb.com/kind": "Postgres",
"kubedb.com/name": "infant-postgres"
{
"cmd" : ["g++ -std=c++14 $file_name -o $file_base_name && timeout 4s ./$file_base_name<inputf.in>outputf.in"],
"selector" : "source.c",
"shell": true,
"working_dir" : "$file_path"
}
{
"hot_exit": false,
"ignored_packages":
[
"Vintage"
],
"remember_open_files": false,
"save_on_focus_lost": true,
// Save via writing to an alternate file, and then renaming it over the
[
{
"keys":["ctrl+space"],
"command":"auto_complete"
},
{
"keys":["ctrl+space"],
"command":"replace_completion_with_auto_complete",
"Context":[
{"key":"last_command","operator":"equal","operand":"insert_best_completion"