Skip to content

Instantly share code, notes, and snippets.

View raymondtlin's full-sized avatar

Raymond T. Lin raymondtlin

View GitHub Profile
import org.apache.avro.Schema;
import org.apache.avro.io.BinaryDecoder;
import org.apache.avro.io.DatumReader;
import org.apache.avro.io.DecoderFactory;
import org.apache.avro.specific.SpecificDatumReader;
import org.apache.avro.specific.SpecificRecordBase;
import org.apache.kafka.clients.consumer.ConsumerRecord;
import org.apache.kafka.clients.consumer.ConsumerRecords;
#!/bin/sh
IPT="/sbin/iptables" #Iptable's path
#Network interfaces :
interface=wlan0 # Internet
start() {
### DELETE ALL ENTRIES ###
$IPT -F
curl --insecure -v https://www.google.com 2>&1 | awk 'BEGIN { cert=0 } /^\* Server certificate:/ { cert=1 } /^\*/ { if (cert) print }'
@raymondtlin
raymondtlin / .bash_profile
Created August 22, 2018 14:52 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
DECLARE @tbl VARCHAR(255);
SET @tbl = 'charges'
SELECT
o.name
, i.index_id
, i.name
, i.type_desc
, SUBSTRING(ikey.cols, 3, LEN(ikey.cols)) AS key_cols
@raymondtlin
raymondtlin / iptables_rules.sh
Created June 17, 2018 20:45 — forked from virtualstaticvoid/iptables_rules.sh
25 Most Frequently Used Linux IPTables Rules Examples
# Modify this file accordingly for your specific requirement.
# http://www.thegeekstuff.com
# 1. Delete all existing rules
iptables -F
# 2. Set default chain policies
iptables -P INPUT DROP
iptables -P FORWARD DROP
iptables -P OUTPUT DROP