Skip to content

Instantly share code, notes, and snippets.

Avatar

Nan Xiao NanXiao

View GitHub Profile
View collision.awk
#!/usr/bin/awk -f
BEGIN {
FS = ",";
}
function update_array(server_name, ticket)
{
if (length(ticket) != 0)
{
View collision.awk
#!/usr/bin/awk -f
BEGIN {
FS = ",";
}
function update_array(server_name, ticket, full_array, partial_bytes_array)
{
if (length(ticket) != 0)
{
View collision.awk
#!/usr/bin/awk -f
BEGIN {
FS = ",";
}
function update_array(ticket, full_array, partial_bytes_array)
{
if (length(ticket) != 0)
{
View histogram.awk
#!/usr/bin/awk -f
BEGIN {
FS = ",";
session_id_ticket = 0
}
function update_array(len, array)
{
if (len != 0)
View statistics.awk
#!/usr/bin/awk -f
function max_value(new_value, old_value)
{
if (new_value > old_value)
{
return new_value;
}
else
{
View statistics.awk
#!/usr/bin/awk -f
BEGIN {
FS = ",";
records_have_session_id = 0;
session_resumption_use_id = 0;
records_have_session_ticket = 0;
session_resumption_use_ticket = 0;
}
View statistics.awk
#!/usr/bin/awk -f
function max_value(new_value, old_value)
{
if (new_value > old_value)
{
return new_value;
}
else
{
View generate_session_id_ticket.awk
#!/usr/bin/awk -f
function remove_quotes(s) {
return substr(s, 2, length(s) - 2)
}
BEGIN {FS = ","}
{printf "%s,%s,%s,%s\n", remove_quotes($4), remove_quotes($5), remove_quotes($6), remove_quotes($7)}
View how-to-install-dpdk-on-ubuntu.sh
# If you're looking into the C10M problem (10 million concurrent connections)
# you might want to play with DPDK (Originally proprietry Intel, now open source)
#
# C10M: http://c10m.robertgraham.com/
# DPDK: http://dpdk.org/
#
# This is a quick summary how to install dpdk on ubuntu
# running inside virtualbox on a mac
# On my Mac:
@NanXiao
NanXiao / parse_mem_info.cpp
Created Jun 4, 2019
Parse /proc/meminfo file
View parse_mem_info.cpp
#include <fstream>
#include <iostream>
#include <sstream>
#include <string>
int main()
{
const std::string meminfo_file("/proc/meminfo");
std::ifstream ifs(meminfo_file);
You can’t perform that action at this time.