#!/bin/bash
JQ_VERSION="1.6"
GOSS_VERSION="v0.3.6"
function download {
# $1 is url, # $2 is nameChange IP in Ubuntu server 18.04
The configuration files are stored in 50-cloud-init.yaml (If it does not exist, using command sudo netplan generate to generate it)
network:
ethernets:
eno1:
addresses: []
dhcp4: true
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "io/ioutil" | |
| "log" | |
| "net/http" | |
| "sync" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| apiVersion: extensions/v1beta1 | |
| kind: Deployment | |
| metadata: | |
| name: nginx-proxy | |
| labels: | |
| proxy: nginx | |
| spec: | |
| template: | |
| metadata: | |
| labels: |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Mixins patter | |
| for create other components | |
| * @param {*} heading level for example h1, h2 | |
| */ | |
| export function generateTitle(level) { | |
| return { | |
| render: function(createElement) { | |
| return createElement( | |
| `h${level}`, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| !! Transparent | |
| urxvt*transparent: true | |
| urxvt*shading: 42 | |
| !! Appearance | |
| urxvt.termName: rxvt-unicode | |
| urxvt.scrollBar: false | |
| urxvt.background: black | |
| urxvt.foreground: gray | |
| !! Font prefferenes |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| from __future__ import print_function | |
| from streamlogger import StreamLogger | |
| import logging | |
| import sys | |
| # Set up logger | |
| logger = logging.getLogger(__name__) | |
| logger.setLevel(logging.DEBUG) | |
| handler = logging.FileHandler("./out.log") | |
| formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import logging | |
| import sys | |
| # Setup logger | |
| logger = logging.getLogger(__name__) | |
| logger.setLevel(logging.DEBUG) | |
| handler = logging.FileHandler("./out.log") | |
| formatter = logging.Formatter('%(asctime)s - %(name)s - %(levelname)s - %(message)s') | |
| handler.setLevel(logging.DEBUG) | |
| handler.setFormatter(formatter) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| import ( | |
| "fmt" | |
| "log" | |
| "net/http" | |
| ) | |
| func main() { | |
| http.HandleFunc("/", func(w http.ResponseWriter, r *http.Request) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| d = { | |
| 'a' : 1, | |
| 'c': 1, | |
| 'b': 2 | |
| } | |
| r = list(filter(lambda x: x[1] == 1, d.items())) # x is a tuple (k,v) == x[0], x[1] | |
| print(r) | |
| # result is [('a', 1), ('c', 1)] |