Skip to content

Instantly share code, notes, and snippets.

View futurist's full-sized avatar

James Yang futurist

  • China
View GitHub Profile
@futurist
futurist / ogg2mp3.sh
Created September 5, 2022 08:44
ogg2mp3
#!/bin/bash
# vim:ft=zsh ts=2 sw=2 sts=2 et
# Simple script to convert OGG to MP3
# http://github.com/netzverweigerer
# Usage: ogg2mp3 <file1> [<file2> <file3> ...]
# Set options for LAME encoder
# vbr, ~192k:
@futurist
futurist / slice.go
Created July 2, 2022 10:26 — forked from heri16/slice.go
Golang - convert slice such as []string to []interface{}
module slice
func InterfaceSlice(slice interface{}) []interface{} {
switch slice := slice.(type) {
case []string:
new := make([]interface{}, len(slice))
for i, v := range slice {
new[i] = v
}
return new
@futurist
futurist / channel0.go
Created June 2, 2022 09:27 — forked from tenfyzhong/channel0.go
有没buffer的channel例子代码
package main
import (
"log"
"time"
)
func chan0SendOnly() {
c0 := make(chan bool)
log.Println("c0, sending")

On master and nodes

Pull images form internet access laptop

docker pull gcr.io/google_containers/kube-apiserver-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-controller-manager-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-proxy-amd64:v1.5.0
docker pull gcr.io/google_containers/kube-scheduler-amd64:v1.5.0
docker pull weaveworks/weave-npc:1.8.2
docker pull weaveworks/weave-kube:1.8.2
@futurist
futurist / install-kubernetes-flannel-centos7.md
Created March 18, 2022 12:12 — forked from rkaramandi/install-kubernetes-flannel-centos7.md
Installing Kubernetes with the Flannel Network Plugin on CentOS 7

Install Prerequisites on ALL (Worker and Master) Nodes

Let's remove any old versions of Docker if they exist:

sudo yum remove docker \
                  docker-common \
                  docker-selinux \
                  docker-engine
@futurist
futurist / version-up.sh
Last active April 2, 2021 03:40 — forked from OleksandrKucherenko/version-up.sh
Calculate Next Suitable Version Tag for Your Git based project
#!/usr/bin/env bash
## Copyright (C) 2017, Oleksandr Kucherenko
## Fork from: https://gist.github.com/OleksandrKucherenko/9fb14f81a29b46886ccd63b774c5959f
## Last revisit: 2021-04-01 [email protected]
# For help:
# ./versionip.sh --help
# For developer / references:
# https://ryanstutorials.net/bash-scripting-tutorial/bash-functions.php
@futurist
futurist / docker-compose.yml
Created March 22, 2021 07:11 — forked from heysamtexas/docker-compose.yml
Pristine config for Traefik 2.0, Docker, and LetsEncrypt with sample container. Includes a HTTP to HTTPS redirect
version: '3'
services:
traefik:
container_name: traefik
image: traefik:v2.0
command:
- "--api.insecure=true"
- "--providers.docker=true"
@futurist
futurist / example.prf
Created December 18, 2020 15:12 — forked from mattes/example.prf
unison profile
root = /Users/matthias/somedir
root = ssh://matthias@host:9000/somedir
auto = true
log = true
logfile = /Users/matthias/.unison/unison.log
maxbackups = 5
backup = Name *
@futurist
futurist / GettingStartedTutorial1Commands.txt
Created December 3, 2020 02:31 — forked from bassem-mf/GettingStartedTutorial1Commands.txt
Getting Started With Graph Databases, Apache TinkerPop, and Gremlin - Tutorial 1
// Create an instance of the "Modern" toy graph
graph = TinkerFactory.createModern()
// Create the traversal source
g = graph.traversal()
// Get all vertices