Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am eugeneteo on github.
  • I am eugeneteo (https://keybase.io/eugeneteo) on keybase.
  • I have a public key whose fingerprint is 8BF0 573E 621C A7DC 15CC A8A9 4DC4 10CA 2181 DE4B

To claim this, I am signing this object:

@eugeneteo
eugeneteo / animate.R
Created February 11, 2017 05:57 — forked from thomasp85/animate.R
Animating graph over time
library(ggraph)
library(gganimate)
library(igraph)
# Data from http://konect.uni-koblenz.de/networks/sociopatterns-infectious
infect <- read.table('out.sociopatterns-infectious', skip = 2, sep = ' ', stringsAsFactors = FALSE)
infect$V3 <- NULL
names(infect) <- c('from', 'to', 'time')
infect$timebins <- as.numeric(cut(infect$time, breaks = 100))
# We want that nice fading effect so we need to add extra data for the trailing
@eugeneteo
eugeneteo / generate.py
Created January 23, 2017 00:06 — forked from adulau/generate.py
Simple script to scatter plot ISN values over time (+ TCP port as color) from pcap
# Simple script to show the ISN value from a tshark output (extracting non relative ISN)
#
# tshark -n -r <yourcapturefile.cap" -T fields -e frame.time_epoch -T fields -e ip.src -T fields -e tcp.srcport -T fields -e ip.dst -T fields -e tcp.dstport -T fields -e tcp.seq -T fields -e tcp.flags -T fields -e ip.ttl -o tcp.relative_sequence_numbers:FALSE | awk -e '{print $1"\t"$6"\t"$5}' | python3 generate.py
#
# by Alexandre Dulaunoy - for analysis session given more info -> http://www.foo.be/cours/dess-20162017/
#
#
import numpy as np
import fileinput
@eugeneteo
eugeneteo / gist:a84dc4a9d6d67780485f5727438181bf
Last active July 19, 2016 10:37
AY2016/17 Semester 1 NSCSM CDRE - Topic 8b

AY2016/17 Semester 1 NSCSM IT8002 CDRE

IT8002: CYBER DEFENCE AND RANGE EXERCISES

Topic 8b - Linux and Apache Security

Instructor: Eugene Teo

Lecture 8b

  • Slide 3: Why Open Source misses the point of Free Software
    • "Open source is a development methodology; free software is a social movement. For the free software movement, free software is an ethical imperative, essential respect for the users' freedom. By contrast, the philosophy of open source considers issues in terms of how to make software “better”—in a practical sense only."
    • Four Freedoms of Free Software
  • Slide 7: Kernel space: ring0; Userspace: ring3
@eugeneteo
eugeneteo / TestNgrams.scala
Created March 28, 2016 06:58 — forked from thvasilo/TestNgrams.scala
Simple job to ensure LZO compressed Google Ngrams data can be read
import org.apache.spark._
import org.apache.spark.SparkContext._
import org.apache.spark.rdd.RDD
import scala.util.Random
import java.io._
import java.util.Properties
import org.apache.hadoop.fs._;
import org.apache.hadoop.conf._;
import org.apache.hadoop.io._;

Keybase proof

I hereby claim:

  • I am eugeneteo on github.
  • I am eugeneteo (https://keybase.io/eugeneteo) on keybase.
  • I have a public key ASBwLvglCHIrAdV25waRiuGaJcdLsssYlmhYW00VDIDykgo

To claim this, I am signing this object:

$ aws iam get-user
A client error (AccessDenied) occurred when calling the GetUser operation: User: arn:aws:iam::548698731369:user/emr is not authorized to perform: iam:GetUser on resource: arn:aws:iam::548698731369:user/emr
$ export AWS_SECRET_ACCESS_KEY=ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcd
$ export AWS_ACCESS_KEY_ID=ABCDEFGHIJKLMNOPQRST
$ aws iam get-user
{
"User": {
"UserName": "emr",
"Path": "/",
"CreateDate": "2016-03-11T14:32:08Z",
"UserId": "AIDAID746LKJUJI5SGLOC",
"Arn": "arn:aws:iam::548698731369:user/emr"
$ aws iam create-access-key --user-name emr
{
"AccessKey": {
"UserName": "emr",
"Status": "Active",
"CreateDate": "2016-03-11T14:37:03.144Z",
"SecretAccessKey": "ABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890abcd",
"AccessKeyId": "ABCDEFGHIJKLMNOPQRST"
}
}
$ cat iam-get-user.json
{
"Version": "2012-10-17",
"Statement": [
{
"Action": [
"iam:GetUser"
],
"Effect": "Allow",
"Resource": "arn:aws:iam::548698731369:user/emr"