Skip to content

Instantly share code, notes, and snippets.

View giabao's full-sized avatar

Bùi Việt Thành giabao

View GitHub Profile
@giabao
giabao / dummy0.netdev
Created July 3, 2021 15:53 — forked from kquinsland/dummy0.netdev
How to get consul-agent and systemd.resolvd to co-exist peicefully and still be able to resolve *.consul hostsnames from within docker
# Creates a "dummy" network interface
# we'll configure this interface with a link-local address
# See: https://www.freedesktop.org/software/systemd/man/systemd.netdev.html
##
[NetDev]
Name=dummy0
Kind=dummy
@giabao
giabao / README.md
Last active October 2, 2024 21:41
bitwarden deduplicate import
  1. (optional) Import Data from chrome, firefox, keepass,..
  2. Export Vault to bitwarden.json file
  3. Get Ammonite
sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/com-lihaoyi/Ammonite/releases/download/2.4.0/2.13-2.4.0) > /usr/local/bin/amm && chmod +x /usr/local/bin/amm' && amm
  1. Download the dedup.scala file below then run it in ammonite
amm dedup.scala bitwarden.json

Keybase proof

I hereby claim:

  • I am giabao on github.
  • I am thanhbv (https://keybase.io/thanhbv) on keybase.
  • I have a public key ASB8AOdn8vYIKXo0s22E-X5K-HrHETYLe4kFziNcrXx8FAo

To claim this, I am signing this object:

ssh-rsa AAAAB3NzaC1yc2EAAAABJQAAAIEA1vaL6SWIVHewr2EcHQvDCAzaOckQzDY5AvnJkSzj2IE7p9af7Rt5OZJa/bnuX24+tfIBT3x4FJZSnpILYDBtPr2CleNX4JRxt7RWcXytzNYJQyYfmoucTLgG1YUlJS9u9tzyZGJfBDCNFQ7dv+hUUHVNgfC0XPIKU1jBdcK7gkU=
#!/bin/bash
# This script add letsencrypt certs to $JAVA_HOME/jre/lib/security/cacerts
# see https://community.letsencrypt.org/t/will-the-cross-root-cover-trust-by-the-default-list-in-the-jdk-jre/134/22
JAVA_HOME=${1-text}
[ $# -eq 0 ] && { echo "Usage: sudo $0 \$JAVA_HOME" ; exit 1; }
KEYSTORE=$JAVA_HOME/jre/lib/security/cacerts
alias keytool=$JAVA_HOME/bin/keytool
# Add this to your nginx.conf under http { }
server {
listen 843;
server_name localhost;
location / {
rewrite ^(.*)$ /crossdomain.xml;
}
@giabao
giabao / gist:9453227
Created March 9, 2014 19:32
spray#743
2014-02-26 23:49:09,281 - [ERROR] - from akka.actor.OneForOneStrategy in cdn-akka.actor.default-dispatcher-5
Internal error
java.lang.IllegalStateException: Internal error
at sun.security.ssl.SSLEngineImpl.initHandshaker(SSLEngineImpl.java:451) ~[na:1.7.0_51]
at sun.security.ssl.SSLEngineImpl.readRecord(SSLEngineImpl.java:986) ~[na:1.7.0_51]
at sun.security.ssl.SSLEngineImpl.readNetRecord(SSLEngineImpl.java:884) ~[na:1.7.0_51]
at sun.security.ssl.SSLEngineImpl.unwrap(SSLEngineImpl.java:758) ~[na:1.7.0_51]
at javax.net.ssl.SSLEngine.unwrap(SSLEngine.java:624) ~[na:1.7.0_51]
at spray.io.SslTlsSupport$$anon$1$$anon$2$$anon$11.apply(SslTlsSupport.scala:287) ~[io.spray.spray-io-1.3-RC1.jar:na]
at spray.io.SslTlsSupport$$anon$1$$anon$2$PumpAction.apply(SslTlsSupport.scala:250) ~[io.spray.spray-io-1.3-RC1.jar:na]
@giabao
giabao / dl
Last active May 23, 2016 15:22
Use aria2c to download file1. add params (to speedup downloading): -s16 -x16 -k1M2. add --check-certificate=false3. simulate -o option of curl: dl -o /dir/file url will download file to /dir/file insteads of ./dir/file_______Install:1. apt-get install aria2c2. Download & chmod a+x /usr/bin/dl
alias dl='aria2c -x16 -s16 -k1M'
cd ~/Downloads/
dl --header="Cookie: oraclelicense=a" http://download.oracle.com/otn-pub/java/jdk/8u91-b14/jdk-8u91-linux-x64.tar.gz
sudo mkdir -p /opt/java && cd /opt/java
sudo mv ~/Downloads/jdk-8u91-linux-x64.tar.gz .
sudo tar -xzf jdk-8u91-linux-x64.tar.gz
sudo ln -sfT jdk1.8.0_91 default
sudo rm -f jdk-8u91-linux-x64.tar.gz
update-alternatives --display java
@giabao
giabao / URLError_at_complete_facebook
Created December 31, 2013 04:11
Lỗi khi đăng ký tài khoản trên http://edx.dtu.vn:8001 qua facebook
<!DOCTYPE html>
<!-- saved from url=(0461)http://edx.dtu.vn:8001/complete/facebook/?redirect_state=RjeiBi9CnWDVFOGxS54cyIO2E8FR8TDM&code=AQAWcF5IFkQl-OVcyyLeGgfDEv7zcV4bW98Lm6VR_16Q-S8vczhrcWPR1Xx9nizcWXalVXyrncjk6HOYNVgzSuJfyZwk1DzxhdeHwFTdclEmF8XksE3U9X9LFOVpe3h6ZeGlODIqVPMHvpmjt2EMTPSe0P3GDY4XDDW5a4sZvgRGmImL2p8mqSFwaHeppOwlRVLzKwtJ0ZreVimsisizRpXpu4qj17UESNHaNaxcn5kwfX8K_FemKOplcNs-dNVg8awUvKnd9BV4TYyUhHanLXRo5_VGCUNSg0XUoPCPj-s-3NBSRzJJ2tKzpbpXawHvyL0&state=RjeiBi9CnWDVFOGxS54cyIO2E8FR8TDM#_=_ -->
<html lang="en"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta name="robots" content="NONE,NOARCHIVE">
<title>URLError at /complete/facebook/</title>
<style type="text/css">
html * { padding:0; margin:0; }
body * { padding:10px 20px; }
body * * { padding:0; }
@giabao
giabao / script.js
Last active December 28, 2015 23:59 — forked from juandopazo/result.js
var fs = require('fs');
var http = require('http');
var ProgressBar = require('progress');
var Handlebars = require('handlebars');
var lineSep = '\r\n';
var typeSep = /\|+|\/|\sor\s|\:/g;
var invalidNameRegEx = /\.|\:|\-|\[|\]|\(\)/g;
var typeCleanupRegex = /\{|\}.*/g;
var indentation = ' ';