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 Data.Array | |
import Data.Array.ST | |
import qualified Data.ByteString.Char8 as B | |
import Control.Monad | |
import Control.Monad.ST | |
import Data.Maybe | |
import Control.Applicative | |
import Debug.Trace | |
type Vertex = 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
%matplotlib inline | |
from keras.models import Sequential | |
from keras.layers import Dense, Dropout, Activation | |
from keras.optimizers import Adam | |
import numpy as np | |
import pandas as pd | |
import matplotlib.pyplot as plt | |
#Generate data | |
num_data=10000 |
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
img |
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
#!/usr/bin/perl | |
# | |
# 21 Apr 2020 | |
# Chul-Woong Yang | |
# | |
# Client (C) Proxy (P1) Proxy (P2) | |
# 10.10.1.1/24 10.10.2.1/24 10.10.3.1/24 | |
# veth0 veth0 veth0 | |
# | | | | |
# veth pair veth pair veth pair |
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 socket | |
import ssl | |
def set_keepalive_linux(sock, after_idle_sec=1, interval_sec=3, max_fails=5): | |
"""Set TCP keepalive on an open socket. | |
It activates after 1 second (after_idle_sec) of idleness, | |
then sends a keepalive ping once every 3 seconds (interval_sec), | |
and closes the connection after 5 failed ping (max_fails), or 15 seconds | |
""" |
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
#!/usr/bin/env python3 | |
import os | |
import time | |
import fnmatch | |
from vpp_papi import VPPApiClient | |
def init_vpp(vpp_json_dir='/usr/share/vpp/api/core/'): | |
jsonfiles = [] |
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 os | |
import socket | |
import struct | |
# These constants map to constants in the Linux kernel. This is a crappy | |
# way to get at them, but it'll do for now. | |
RTMGRP_LINK = 1 | |
NLMSG_NOOP = 1 | |
NLMSG_ERROR = 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
import socket, ssl, sys | |
if len(sys.argv) == 1: | |
hostname = 'www.naver.com' | |
else: | |
hostname = sys.argv[1] | |
ctx = ssl.create_default_context() | |
ctx.check_hostname = False | |
ctx.verify_mode = ssl.CERT_NONE |
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 sys | |
import logging | |
from os_ken.ofproto import ether, inet | |
from os_ken.lib.packet import ethernet | |
from os_ken.lib.packet import ipv4, ipv6 | |
from os_ken.lib.packet import tcp, udp | |
from os_ken.lib.packet import packet, packet_utils | |
from os_ken.lib import addrconv |
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
# -*- mode: ruby -*- | |
# vi: set ft=ruby : | |
Vagrant.configure(2) do |config| | |
config.vm.box = "bento/ubuntu-22.04" | |
config.vm.box_check_update = false | |
vmcpu=(ENV['VPP_VAGRANT_VMCPU'] || 8) | |
vmram=(ENV['VPP_VAGRANT_VMRAM'] || 12192) |
OlderNewer