This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
result = []; | |
function load(url, level) | |
{ | |
console.log("level: "+level+","+url); | |
$.get(url, function(data, status){ | |
var x; | |
if($(data).length>2) | |
{ | |
x=$($(data)[2]); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import com.squareup.okhttp.*; | |
import org.json.JSONObject; | |
import java.io.*; | |
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"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 https://download.docker.com/linux/centos/docker-ce.repo | |
Install docker-ce: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
version: '3' | |
services: | |
kong-migrations: | |
image: "${KONG_DOCKER_TAG:-kong:latest}" | |
command: kong migrations bootstrap | |
environment: | |
KONG_DATABASE: postgres | |
KONG_PG_DATABASE: ${KONG_PG_DATABASE:-kong} | |
KONG_PG_HOST: 10.148.0.27 | |
KONG_PG_PASSWORD: ${KONG_PG_PASSWORD:-kong} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM mhart/alpine-node | |
RUN yarn global add serve | |
WORKDIR /app | |
COPY build . | |
CMD ["serve", "-p", "80", "-s", "."] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Ignore everything | |
** | |
# Allow files and directories | |
!build/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
B1. Cai dat git bash https://git-scm.com/downloads | |
B2. Bat Git Bash. chay lenh | |
ssh-keygen -t rsa | |
enter | |
enter | |
enter cho den khi xong | |
B3. chay lenh "cat ~/.ssh/id_rsa.pub" | |
B4. Copy nhung thu tren man hinh gui cho a Tuan |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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[][]{ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1. Connecting to a database behind a firewall | |
ssh -L 9000:localhost:5432 user@example.com database postgres run port 5432 only access from localhost | |
2. Remote port forwarding | |
ssh -R 9000:localhost:3000 user@example.com | |
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 0.0.0.0:[SERVER]:localhost:[CLIENT_IP] [SERVER_USER]@[SEVER_IP] | |
- remember to run on reboot |
OlderNewer