Skip to content

Instantly share code, notes, and snippets.

View hungbang's full-sized avatar
🏠
Working from home

Harry B. hungbang

🏠
Working from home
View GitHub Profile
@hungbang
hungbang / mysql56-ubuntu17.txt
Created April 20, 2018 11:48
install mysql 5.6 in ubuntu 17
Install MySQL 5.6 in Ubuntu 16.04
Ubuntu 16.04 only provides packages for MySQL 5.7 which has a range of backwards compatibility issues with code written against older MySQL versions.
Oracle maintains a list of official APT repositories for MySQL 5.6, but those repositories do not yet support Ubuntu 16.04. However, the 15.10 repos will work for 16.04.
Uninstall existing mysql 5.7 if any
sudo apt remove mysql-client mysql-server libmysqlclient-dev mysql-common
Check you removed everything
@hungbang
hungbang / string-to-sha1.java
Created April 26, 2018 07:45 — forked from giraam/string-to-sha1.java
Hashing a String with SHA1 in Java
import java.io.*;
import java.util.logging.*;
import javax.xml.bind.DatatypeConverter;
/**
* Hashing with SHA1
*
* @param input String to hash
* @return String hashed
*/
@hungbang
hungbang / Sha1Hash.java
Created April 26, 2018 07:46 — forked from dleast/Sha1Hash.java
SHA1 Hash fuction - JAVA
public class Sha1Hash {
/** Creates a new instance of Sha1Hash */
public Sha1Hash() {
}
/**
* @param inputData
* @return
*/
@hungbang
hungbang / example.html
Created July 13, 2018 09:15 — forked from 2J/example.html
Angular 2 tabs example
<tabs>
<tab tabTitle="Tab 1">Tab 1 Content</tab>
<tab tabTitle="Tab 2" [active]="true">Tab 2 Content</tab>
<tab tabTitle="Tab 3" [disabled]="true">Tab 3 Content</tab>
<tab tabTitle="Link Tab 4" href="http://google.com">Link Tab</tab>
<tab tabTitle="Link Tab 5" href="http://google.com" [disabled]="true">Disabled Link Tab</tab>
</tabs>
@hungbang
hungbang / kubernetes.md
Created September 22, 2018 08:37 — forked from carlessanagustin/kubernetes.md
Kubernetes tutorial steps

1. Create cluster

Cluster up and running

minikube version
minikube start
kubectl version
@hungbang
hungbang / 1_kubernetes_on_macOS.md
Created September 25, 2018 15:15 — forked from kevin-smets/1_kubernetes_on_macOS.md
Local Kubernetes setup on macOS with minikube on VirtualBox and local Docker registry

Requirements

Minikube requires that VT-x/AMD-v virtualization is enabled in BIOS. To check that this is enabled on OSX / macOS run:

sysctl -a | grep machdep.cpu.features | grep VMX

If there's output, you're good!

Prerequisites

@hungbang
hungbang / import-db.sh
Created October 11, 2018 03:28 — forked from hartleybrody/import-db.sh
Copy data from Heroku Postgres into local database
# copy/import data from heroku postgres to localhost pg database
# useful for copying admin's work on live site into local database to reproduce errors
# https://devcenter.heroku.com/articles/heroku-postgres-import-export
# take heroku pg snapshot and download
heroku pg:backups:capture
heroku pg:backups:download
# load the dump into local postgres database, assuming $DATABASE_URL set locally
@hungbang
hungbang / remove-node_modules
Created October 17, 2018 14:34 — forked from cassidoo/remove-node_modules
Remove node_modules from git
Add to .gitignore file
node_modules
Then call:
git rm -r --cached node_modules
git commit -m "Remove node_modules now that they're ignored!"
git push origin master

Deploy project to ipfs

  1. Start Ipfs daemon to create a node

ipfs daemon

  1. To get your peers that will share content

ipfs swarm peers

@hungbang
hungbang / gcb-kubernetes.yaml
Created November 1, 2018 15:13 — forked from Philmod/gcb-kubernetes.yaml
Deploy a new image from Google Cloud Container Builder to Kubernetes, by storing GKE credentials in GCS.
steps:
- name: 'gcr.io/cloud-builders/npm'
args: ['install']
- name: 'gcr.io/cloud-builders/npm'
args: ['test']
- name: 'gcr.io/cloud-builders/docker'
args: ["build", "-t", "gcr.io/$PROJECT_ID/frontend:$REVISION_ID", "."]
- name: 'gcr.io/cloud-builders/docker'
args: ["push", "gcr.io/$PROJECT_ID/frontend:$REVISION_ID"]
- name: 'gcr.io/cloud-builders/gcloud'