Skip to content

Instantly share code, notes, and snippets.

View prachikhadke's full-sized avatar
🐽
The six honest serving-men: What, Why, When, How, Where and Who.

Prachi prachikhadke

🐽
The six honest serving-men: What, Why, When, How, Where and Who.
View GitHub Profile
@prachikhadke
prachikhadke / nested-goroutines
Created May 7, 2020 00:05
Calling go routines from go routines
package main
import (
"fmt"
"time"
)
func SayHello(name string) {
fmt.Printf("Hello %s!\n", name)
}
@random-robbie
random-robbie / install.sh
Last active February 4, 2023 07:22
Install helm for kubernetes on centos 7
#!/bin/bash
wget https://storage.googleapis.com/kubernetes-helm/helm-v2.12.2-linux-amd64.tar.gz
tar -zxvf helm-v2.12.2-linux-amd64.tar.gz
mv linux-amd64/helm /usr/local/bin/helm
kubectl -n kube-system create sa tiller
kubectl create clusterrolebinding tiller --clusterrole cluster-admin --serviceaccount=kube-system:tiller
helm init --service-account tiller
kubectl create namespace kubeapps
helm install --name kubeapps --namespace kubeapps bitnami/kubeapps
@gazoakley
gazoakley / Jenkinsfile
Last active March 16, 2024 22:50
Jenkinsfile for running Terraform
pipeline {
agent any
parameters {
string(name: 'environment', defaultValue: 'default', description: 'Workspace/environment file to use for deployment')
string(name: 'version', defaultValue: '', description: 'Version variable to pass to Terraform')
booleanParam(name: 'autoApprove', defaultValue: false, description: 'Automatically run apply after generating plan?')
}
environment {
@cyrille-leclerc
cyrille-leclerc / 0-commands.md
Last active January 26, 2024 17:53
CloudBees Jenkins Master CLI Commands

CREATE GROUP

java -jar jenkins-cli.jar ... help create-group
java -jar jenkins-cli.jar create-group CONTAINER GROUP
Creates a groups
 CONTAINER : root | path/to/job-or-folder | path/to/folder/view-name |
             slave-name
@sloanlance
sloanlance / BASH: ISO 8601 Timestamp with Milliseconds
Last active February 9, 2023 19:33
How to get an ISO 8601 timestamp with milliseconds in BASH
Gist title: "BASH: ISO 8601 Timestamp with Milliseconds"
Summary: How to get an ISO 8601 timestamp with milliseconds in BASH
@oinopion
oinopion / read-access.sql
Created October 5, 2016 13:00
How to create read only user in PostgreSQL
-- Create a group
CREATE ROLE readaccess;
-- Grant access to existing tables
GRANT USAGE ON SCHEMA public TO readaccess;
GRANT SELECT ON ALL TABLES IN SCHEMA public TO readaccess;
-- Grant access to future tables
ALTER DEFAULT PRIVILEGES IN SCHEMA public GRANT SELECT ON TABLES TO readaccess;
@miroslavtamas
miroslavtamas / install-apache-maven-3.3.9.sh
Created April 22, 2016 10:48
Install Apache Maven 3.3.9 on CentOS
#!/bin/sh
wget http://www.eu.apache.org/dist/maven/maven-3/3.3.9/binaries/apache-maven-3.3.9-bin.tar.gz
tar xzf apache-maven-3.3.9-bin.tar.gz
mkdir /usr/local/maven
mv apache-maven-3.3.9/ /usr/local/maven/
alternatives --install /usr/bin/mvn mvn /usr/local/maven/apache-maven-3.3.9/bin/mvn 1
alternatives --config mvn
@squarism
squarism / iterm2.md
Last active March 28, 2024 14:16
An iTerm2 Cheatsheet

Tabs and Windows

Function Shortcut
New Tab + T
Close Tab or Window + W (same as many mac apps)
Go to Tab + Number Key (ie: ⌘2 is 2nd tab)
Go to Split Pane by Direction + Option + Arrow Key
Cycle iTerm Windows + backtick (true of all mac apps and works with desktops/mission control)
// Restify Server CheatSheet.
// More about the API: http://mcavage.me/node-restify/#server-api
// Install restify with npm install restify
// 1.1. Creating a Server.
// http://mcavage.me/node-restify/#Creating-a-Server
var restify = require('restify');
@Kartones
Kartones / postgres-cheatsheet.md
Last active March 27, 2024 12:38
PostgreSQL command line cheatsheet

PSQL

Magic words:

psql -U postgres

Some interesting flags (to see all, use -h or --help depending on your psql version):

  • -E: will describe the underlaying queries of the \ commands (cool for learning!)
  • -l: psql will list all databases and then exit (useful if the user you connect with doesn't has a default database, like at AWS RDS)