Skip to content

Instantly share code, notes, and snippets.


Block or report user

Report or block ledangtuanbk

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
ledangtuanbk / ssh_tunnel
Created Aug 16, 2019
How to use ssh_tunnel
View ssh_tunnel
1. Connecting to a database behind a firewall
ssh -L 9000:localhost:5432 database postgres run port 5432 only access from localhost
2. Remote port forwarding
ssh -R 9000:localhost:3000
Localhost running port 3000 and want to acess from internet port 9000
- set GatewayPorts yes in /etc/ssh/sshd_config
this can be done by autossh
autossh -M 0 -f -q -N -o "ServerAliveInterval 5" -o "ServerAliveCountMax 1" -o "ExitOnForwardFailure yes" -R
remember to run on reboot
package com.ldt.test;
import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;
public class TestMain2 {
public static void main(String[] args) {
int[][] datas = new int[][]{
View huong dan tao ssh key
B1. Cai dat git bash
B2. Bat Git Bash. chay lenh
ssh-keygen -t rsa
enter cho den khi xong
B3. chay lenh "cat ~/.ssh/"
B4. Copy nhung thu tren man hinh gui cho a Tuan
View .dockerignore
# Ignore everything
# Allow files and directories
View Dockerfile React App
FROM mhart/alpine-node
RUN yarn global add serve
COPY build .
CMD ["serve", "-p", "80", "-s", "."]
ledangtuanbk /
Last active Mar 26, 2019
install docker and docker compose
Install Docker & Docker Compose - Centos 7
Step 1 — Install Docker
Install needed packages:
$ sudo yum install -y yum-utils device-mapper-persistent-data lvm2
Configure the docker-ce repo:
$ sudo yum-config-manager --add-repo
Install docker-ce:
import com.squareup.okhttp.*;
import org.json.JSONObject;
import java.math.BigDecimal;
public class TestMainBHYT {
// private static final String LOGIN = "http://localhost:47503/api/token/take";
// private static final String SEND_FILE = "http://localhost:47503/api/egw/guiHoSoGiamDinh4210";
public static void main(String[] args) {
try {
TransportClient client = new PreBuiltTransportClient(Settings.EMPTY)
.addTransportAddress(new TransportAddress(InetAddress.getByName("localhost"), 9300));
String jsonObject = "{\"age\":14,\"dateOfBirth\":1471466076564,"
+"\"fullName\":\"John Doe\"}";
IndexResponse response = client.prepareIndex("people", "Doe")
.setSource(jsonObject, XContentType.JSON).get();
View text.txt
result = [];
function load(url, level)
console.log("level: "+level+","+url);
$.get(url, function(data, status){
var x;
You can’t perform that action at this time.