View bench_test.go
This file contains 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 caskdb | |
import ( | |
"github.com/cornelk/hashmap" | |
"math" | |
"sync" | |
"testing" | |
) | |
type m struct { |
View debugstruct.go
This file contains 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
func debugStruct(d interface{}) { | |
s, _ := json.MarshalIndent(d, "", "\t") | |
fmt.Println(string(s)) | |
} |
View docker-compose.yaml
This file contains 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
version: '3.1' | |
services: | |
db: | |
image: mysql | |
ports: | |
- "3306:3306" | |
environment: | |
MYSQL_DATABASE: morph | |
MYSQL_USER: mysql |
View main.go
This file contains 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" | |
"time" | |
) | |
func main() { | |
function2() |
View main.go
This file contains 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 ( | |
"bufio" | |
"fmt" | |
"os/exec" | |
"time" | |
) | |
func main() { |
View main.go
This file contains 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 ( | |
"errors" | |
"fmt" | |
"log" | |
"os" | |
"strconv" | |
"sync" | |
"time" |
View mime.types
This file contains 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
# This file maps Internet media types to unique file extension(s). | |
# Although created for httpd, this file is used by many software systems | |
# and has been placed in the public domain for unlimited redisribution. | |
# | |
# The table below contains both registered and (common) unregistered types. | |
# A type that has no unique extension can be ignored -- they are listed | |
# here to guide configurations toward known types and to make it easier to | |
# identify "new" types. File extensions are also commonly used to indicate | |
# content languages and encodings, so choose them carefully. | |
# |
View Setup Microk8s Dashboard on Ubuntu
This file contains 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
mkdir -p k8s/cert/ && cd k8s/cert/ | |
openssl req -nodes -newkey rsa:2048 -keyout dashboard.key -out dashboard.csr -subj "/C=/ST=/L=/O=/OU=/CN=*" | |
openssl x509 -req -sha256 -days 3650 -in dashboard.csr -signkey dashboard.key -out dashboard.crt | |
microk8s kubectl -n kube-system delete secret kubernetes-dashboard-certs | |
microk8s kubectl -n kube-system create secret generic kubernetes-dashboard-certs --from-file=dashboard.crt --from-file=dashboard.key | |
microk8s kubectl -n kube-system edit deploy kubernetes-dashboard -o yaml | |
# change args part | |
args: |
View conn_pool.py
This file contains 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 datetime import datetime | |
from multiprocessing import Lock | |
import mysql.connector | |
USER = "root" | |
PASSWD = "admin" | |
HOST = 'localhost' | |
DB = "db_test" |
View init_ubuntu_mate.sh
This file contains 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
sudo apt-get remove account-plugin-facebook account-plugin-flickr account-plugin-jabber account-plugin-salut account-plugin-twitter account-plugin-windows-live account-plugin-yahoo aisleriot brltty duplicity empathy empathy-common | |
sudo apt remove rhythmbox rhythmbox-plugins rhythmbox-plugin-zeitgeist sane-utils shotwell shotwell-common telepathy-gabble telepathy-haze telepathy-idle telepathy-indicator telepathy-logger telepathy-mission-control-5 telepathy-salut | |
sudo apt install git zsh curl | |
/bin/bash -c "$(curl -sL https://git.io/vokNn)" | |
sh -c "$(curl -fsSL https://raw.github.com/ohmyzsh/ohmyzsh/master/tools/install.sh)" | |
git clone https://github.com/zsh-users/zsh-autosuggestions ${ZSH_CUSTOM:-~/.oh-my-zsh/custom}/plugins/zsh-autosuggestions |
NewerOlder