Skip to content

Instantly share code, notes, and snippets.

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

Victor Yang pydevops

🏠
Working from home
View GitHub Profile
@eruffaldi
eruffaldi / gettoken.sh
Created September 25, 2018 09:23
Google OAuth 2.0 full example bash script.
#!/bin/bash
#1) on https://console.developers.google.com/ register project and associate API from library
# OUTPUT: client_id,client_secret
client_id="..."
client_secret="...."
#2) get authorization code at the following link using web browser
# OUTPUT: code
scope="https://www.googleapis.com/auth/drive"
https://cloud.google.com/storage/docs/encryption/
BUCKET_NAME=YOUR_NAME_enron_corpus
gsutil mb gs://${BUCKET_NAME}
gsutil cp gs://enron_corpus/allen-p/inbox/1. .
tail 1.
Enable API/Create keyring
gcloud services enable cloudkms.googleapis.com

Create a secrets file:

touch ~/.secret

Make sure it looks like this:

#!/bin/bash
@smileisak
smileisak / operators.md
Created June 6, 2018 10:01
Kubernetes Operator Learning Path

Some useful resources regarding Kubernetes Operators, CRDs, etc.

@ThomasLeister
ThomasLeister / cloud-ubuntu-netplan-secondary-ip-static.md
Created May 25, 2018 08:30
Ubuntu netplan config for secondary ip address

In case there's already a DHCP config for netplan for the private IP address:

File: /etc/netplan/50-cloud-init.yaml

Contents:

# This file is generated from information provided by
# the datasource.  Changes to it will not persist across an instance.
# To disable cloud-init's network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
#!/usr/bin/env bash
set -e
for full_name in $(kubectl get all -o name | grep -vE replicaset\|pod); do
name="$(echo "$full_name" | sed -e "s/.*\///g")";
type="$(echo "$full_name" | sed -e "s/\/.*//g")";
case "${type}" in
deployment*)
type=Deployment
;;
"service")
@lutangar
lutangar / docker-ce.yml
Last active October 18, 2021 19:01
Ansible task to setup docker-ce on ubuntu or debian
---
- name: Update the `apt` package index
apt:
update_cache: yes
- name: Install packages to allow apt to use a repository over HTTPS
package:
name: "{{ item }}"
state: latest
@Potherca
Potherca / README.md
Last active July 9, 2025 22:22
BASH script to clone all git repository in a Group on GitLab, or Organization on GitHub.

Introduction

Starting at a new employer always mean checking out various git repositories.

As the amount of repositories a company has grows, the time needed to clone all of those repositories also grows.

This script automates this task.

In order for this script to work, a personal access token is needed.

@z3t0
z3t0 / notes.org
Created April 30, 2018 02:36
research on database

SQL vs NOSQL

  • SQL: relational, NOSQL: non relational
  • SQL: universal but defined schema
  • NoSQL: unstructured dynamic schema
  • SQL is vertically scalable, increased resources of one machine
  • NoSQL is horizontally scalable, increase number of machines
  • NoSQL can become larger and more powerful
  • NoSQL does not require a DBA (Database Administrator)
    • flexible and high performing