Skip to content

Instantly share code, notes, and snippets.

@jwthanh
jwthanh / responsive_breakpoint.css
Created June 19, 2016 07:40
Modem responsive css breakpoint
/* ======= Desktops and laptops ======= */
@media only screen and (min-width : 1224px) {
/*------------ Styles go here ------------- */
}
/* ======= Large screens ======= */
@media only screen and (min-width : 1824px) {
/*------------ Styles go here ------------- */
}
@jwthanh
jwthanh / jwt.go
Created July 4, 2017 09:38 — forked from OdinsPlasmaRifle/jwt.go
JWT Tokens using jwt-go
package components
import (
"crypto/rsa"
jwt "github.com/dgrijalva/jwt-go"
"io/ioutil"
"log"
"time"
)
@jwthanh
jwthanh / nginx.conf
Created October 13, 2017 13:00 — forked from sergejmueller/nginx.conf
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Nginx
location ~* \.(txt|log|xml|css|js)$ {
add_header X-Robots-Tag noindex;
}
@jwthanh
jwthanh / nginx.conf
Created October 13, 2017 13:00 — forked from sergejmueller/nginx.conf
Stop search engines from indexing .txt, .log, .xml, .css and .js files in Nginx
location ~* \.(txt|log|xml|css|js)$ {
add_header X-Robots-Tag noindex;
}
@jwthanh
jwthanh / ethminer_ubuntu_nvidia.md
Created October 24, 2017 16:38 — forked from johnstcn/ethminer_ubuntu_nvidia.md
NVIDIA/CUDA ethminer setup under Ubuntu Server 16.04

Headless Ethminer (nVidia) Setup Guide

Cian Johnston, July 2017

A couple of weeks ago, I decided I should put my gaming rig to work crypto mining. I did not expect to make any significant profit on this, it was more of a fun project to set up. However, there were a large number of tutorials and guides already out there, and many were more than a year out of date.

This guide assumes the reader already has a crypto wallet set up, is comfortable with Linux and the command line, and knows how to use Google if they run into problems.

The end result is an Ubuntu 16.04 LTS headless server running CUDA ethminer via systemd.

Hardware

@jwthanh
jwthanh / cleanup.sh
Created June 10, 2018 06:33 — forked from superseb/cleanup.sh
Cleanup host added as custom to Rancher 2.0
#!/bin/sh
docker rm -f $(docker ps -qa)
docker volume rm $(docker volume ls -q)
cleanupdirs="/var/lib/etcd /etc/kubernetes /etc/cni /opt/cni /var/lib/cni /var/run/calico"
for dir in $cleanupdirs; do
echo "Removing $dir"
rm -rf $dir
done
@jwthanh
jwthanh / docker-compose.yaml
Last active October 25, 2018 10:43
JV Console
# Production ready docker configuration
version: '2.0'
services:
proxy:
image: nginx
volumes:
- /data/jv-console/nginx/nginx.conf:/etc/nginx/nginx.conf
- /data/jv-console/nginx/.htpasswd:/etc/nginx/.htpasswd
ports:
#- "5000:5000"

Restart

cd zk-multiple-kafka-multiple/
docker-compose down
docker-compose up -d

Xem thông tin

docker ps | grep zkmultiplekafka
@jwthanh
jwthanh / dns.yaml
Last active May 23, 2019 04:39
Kubernetes installation
# should apply this config if pod could not ping outside internet
apiVersion: v1
kind: ConfigMap
metadata:
name: kube-dns
namespace: kube-system
data:
upstreamNameservers: |
["8.8.8.8", "8.8.4.4"]
@jwthanh
jwthanh / android-generate-keystores.md
Created November 30, 2018 06:34 — forked from henriquemenezes/android-generate-keystores.md
Android: Generate Release/Debug Keystores

Android: Generate Release/Debug Keystores

Generate Keystores

Debug Keystore

$ keytool -genkey -v -keystore debug.keystore -storepass android -alias androiddebugkey -keypass android -keyalg RSA -keysize 2048 -validity 10000 -dname "C=US, O=Android, CN=Android Debug"