Skip to content

Instantly share code, notes, and snippets.

Thuan Ng thuannvn

  • www.entrybiz.com
  • Ho Chi Minh, VietNam
Block or report user

Report or block thuannvn

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
@thuannvn
thuannvn / i2_playbook.yml
Last active Mar 26, 2019
i2_playbook.yml
View i2_playbook.yml
---
- hosts: 127.0.0.1
connection: local
become: true
tasks:
- name: install wget
yum:
name: wget
state: present
- name: install openjdk
@thuannvn
thuannvn / status_ok.json
Last active Mar 22, 2019
status_ok.json
View status_ok.json
{
"notifications":{
"slack":{
"channel":"#business-listing",
"username":"statusok",
"channelWebhookURL":"https://hooks.slack.com/services/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"
}
},
"database":{
"influxDb":{
@thuannvn
thuannvn / install-jenkins.yaml
Last active Mar 12, 2019
Install jenkins on aws AMI linux
View install-jenkins.yaml
---
- hosts: 127.0.0.1
connection: local
become: true
tasks:
- name: install wget
yum:
name: wget
state: present
- name: install openjdk
View elasticpress-polylang.php
<?php
/**
* Filter Elasticsearch posts by current language.
*/
add_filter( 'ep_formatted_args', function( $formatted_args, $args ) {
if ( function_exists( 'pll_current_language' ) ) {
$lang = pll_current_language();
if ( $lang !== false ) {
@thuannvn
thuannvn / formatted-args.txt
Created Jan 23, 2019 — forked from solepixel/formatted-args.txt
ElasticPress arguments
View formatted-args.txt
Array
(
[from] => 0
[size] => 54
[sort] => Array
(
[0] => Array
(
[meta_value_num] => Array
(
@thuannvn
thuannvn / README.md
Created Jan 22, 2019 — forked from hofmannsven/README.md
How to create a Post Like System for WordPress.
@thuannvn
thuannvn / us_state_abbreviations.py
Created Jan 22, 2019 — forked from JeffPaine/us_state_abbreviations.py
A python list of all US state abbreviations.
View us_state_abbreviations.py
states = ["AL", "AK", "AZ", "AR", "CA", "CO", "CT", "DC", "DE", "FL", "GA",
"HI", "ID", "IL", "IN", "IA", "KS", "KY", "LA", "ME", "MD",
"MA", "MI", "MN", "MS", "MO", "MT", "NE", "NV", "NH", "NJ",
"NM", "NY", "NC", "ND", "OH", "OK", "OR", "PA", "RI", "SC",
"SD", "TN", "TX", "UT", "VT", "VA", "WA", "WV", "WI", "WY"]
@thuannvn
thuannvn / us_state_abbrev.py
Created Jan 22, 2019 — forked from rogerallen/us_state_abbrev.py
A Python Dictionary to translate US States to Two letter codes
View us_state_abbrev.py
us_state_abbrev = {
'Alabama': 'AL',
'Alaska': 'AK',
'Arizona': 'AZ',
'Arkansas': 'AR',
'California': 'CA',
'Colorado': 'CO',
'Connecticut': 'CT',
'Delaware': 'DE',
'Florida': 'FL',
@thuannvn
thuannvn / pirewall.sh
Created Nov 27, 2018 — forked from sturadnidge/pirewall.sh
Script to setup a basic ruleset for iptables, used on my raspberrypi firewall.
View pirewall.sh
#!/bin/sh
# * eth0 = Internet interface (DHCP)
# * eth1 = LAN interface (192.168.1.0/24)
# * eth2 = DMZ interface (172.16.0.0/16)
# * Traffic open from firewall to internet
# * Traffic open and translated from LAN and DMZ to internet
# * Traffic open from LAN to Firewall
# * Traffic open from LAN to DMZ
# * Traffic open from internet to a DMZ web server
@thuannvn
thuannvn / hackerrank - Sock Merchant - python3
Created Nov 9, 2018
hackerrank - Sock Merchant - python3
View hackerrank - Sock Merchant - python3
#!/bin/python3
import sys
n = 10
arr = [1, 1, 3, 1, 2, 1, 3, 3, 3, 3 ]
arr_m = {}
def calculatePairs(a,arr):
match_count = 0
for item in arr:
You can’t perform that action at this time.