Skip to content

Instantly share code, notes, and snippets.

View lotusirous's full-sized avatar
💭
for { Learn() }

Kha Nguyen lotusirous

💭
for { Learn() }
View GitHub Profile
@lotusirous
lotusirous / gulpfile.js
Created January 1, 2020 05:41
A gulp file to minify and prefix css
var gulp = require("gulp");
var sass = require("gulp-sass");
var postcss = require("gulp-postcss");
var autoprefixer = require("autoprefixer");
var cssnano = require("cssnano");
gulp.task("sass", function() {
var processors = [autoprefixer(), cssnano()];
return gulp

ORA-28000 : the account is locked in oracle

The following is solution to change username and password in oracle db system. The system requires you have access to system account to reset other account.

I tested oracle docker image with command

docker run --rm -v oracle_data:/u01/app/oracle  -p 1521:1521 -e ORACLE_ALLOW_REMOTE=true epiclabs/docker-oracle-xe-11g

Which is

package main
import "fmt"
type User struct {
Name string
UID int
Menus []string
}

cat a file in a docker image

docker run --rm -i nginx:alpine /bin/sh -c "cat /etc/nginx/conf.d/default.conf"
package main
type Jedi interface {
HasForce() bool
}
type Knight struct {
}
var _ Jedi = (*Knight)(nil)
net:
port: 27017
bindIp: prod.master
storage:
dbPath: /home/admin/mongodb/data
wiredTiger:
engineConfig:
cacheSizeGB: 2
journalCompressor: snappy
@lotusirous
lotusirous / go-kit-snippet.json
Created July 14, 2019 10:38
snippet for working with go-kit
{
"Create go-kit Endpoint": {
"prefix": "kendpoint",
"body": [
"// ${1:MakeServiceEndpoint} constructs a Sum endpoint wrapping the service.",
"func ${1:MakeServiceEndpoint}(s ${2:Service}) endpoint.Endpoint {",
" return func(ctx context.Context, request interface{}) (response interface{}, err error) {",
"$0",
" return ${3:ResponseStruct}, nil",
" }",

Things should be done for running docker in production

Add /etc/docker/daemon.json if you don't mind the full-of-disk and cgroup problems

{
  "exec-opts": ["native.cgroupdriver=systemd"],
  "storage-driver": "overlay2",
  "log-driver": "json-file",
 "log-opts": {