Skip to content

Instantly share code, notes, and snippets.

View hyhilman's full-sized avatar
🏠
Working from home

Hilman Nihri hyhilman

🏠
Working from home
View GitHub Profile
@hyhilman
hyhilman / simpleforward.mn
Last active September 13, 2017 12:24
simple forwarding switch with pyretic
{
"application": {
"dpctl": "",
"ipBase": "10.0.0.0/8",
"netflow": {
"nflowAddId": "0",
"nflowTarget": "",
"nflowTimeout": "600"
},
"openFlowVersions": {
@hyhilman
hyhilman / loadbalancer.py
Last active September 13, 2017 12:26
Load Balancer Swtich with Round Robin or Weighted RR or Simple Least Connection algorithm with Pyretic
from pyretic.lib.corelib import *
from pyretic.lib.std import *
from pyretic.lib.query import *
from pyretic.modules.mac_learner import *
from sys import maxint
################################################
# Translate from
# client -> public address : client -> servers
# server -> client : public address -> client
################################################
@hyhilman
hyhilman / readme.md
Last active June 20, 2017 00:04
Multimedia Networking - Darwin Streaming Server

Darwing Streaming Server

Pull docker images

$ docker pull gaiterjones/darwin-streaming

Running docker

$ docker run -it -p 1220:1220 -p 8000:8000 -p 7070:7070 -p 8001:8001 -p 554:554 gaiterjones/darwin-streaming

Change admin password (when default admin/password user can't be used)

Note : run this command inside docker container

@hyhilman
hyhilman / CaisarCipher_CaisarCipher.py
Last active September 11, 2017 16:43
Caisar Cipher Python
class CaisarCipher:
def __init__(self, plain):
self.plain = plain
def encode(self, key):
cipher = ''
for c in self.plain:
decimalstring = self.hexToDecimal(self.charToHex (c))
decimalstring = ( decimalstring + key ) % 256
cipher = cipher + self.hexToChar(self.decimalToHex(decimalstring))
@hyhilman
hyhilman / CaisarCipher.m
Last active September 13, 2017 12:20
Caisar Cipher Text Matlab
alfabet = "abcdefghijklmnopqrstuvwxyz"
alfabet = [alfabet, upper(alfabet), ' ']
plain = 'Aku makan es krim'
plainafterdecode = ''
key = 33
cipher = ''
modulus = length(alfabet)
for plainsequence = 1:length(plain)
for alfabetsequence = 1:length(alfabet)
@hyhilman
hyhilman / readme.md
Last active May 7, 2021 14:38
gdal-bin centos 7

How to install ogr2ogr from source on CentOS (RHEL)

Install the following packages:

yum install gcc-c++
yum install gcc
yum install libpng
yum install libtiff

Build latest proj4

@hyhilman
hyhilman / classicalcryptography.m
Last active October 2, 2017 15:41
Classical Cryptography
a
@hyhilman
hyhilman / tugas2_aodv.cc
Last active December 15, 2017 22:22
Aodv routing with randomwalk mobility, CBR data sending, netflowmonitoring, and routing table export
/* -*- Mode:C++; c-file-style:"gnu"; indent-tabs-mode:nil; -*- */
/*
* Copyright (c) 2009 IITP RAS
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License version 2 as
* published by the Free Software Foundation;
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
@hyhilman
hyhilman / coap.js
Created May 7, 2018 13:46
simple coap handling when server is down(timeout)
var sensorLib = require("node-dht-sensor");
var temp = {
read: function() {
var a = sensorLib.read(11,4);
return a.temperature.toFixed(1);
}
};
var hum = {
read: function() {
var b = sensorLib.read(11,4);
@hyhilman
hyhilman / json2csv.py
Last active August 13, 2018 07:24
convert traffik from json files which generates from pcap to csv
import json
import pandas as pd
import sys
import glob, os
def jsonToDataframe(file):
classify = file.replace(".json","")
print("Reading", file)
with open(file, 'r') as f:
json_buff = json.load(f)