Skip to content

Instantly share code, notes, and snippets.

@pokgak
pokgak / convert.py
Created July 14, 2021 21:19
Convert .xlsx files to CSV
import os
import pandas as pd
for file in os.listdir():
if not file.endswith(".xlsx"):
continue
try:
f_xls = pd.read_excel(file, engine="openpyxl")
f_xls.to_csv(f"{file.split('.')[0]}.csv", encoding="utf-8", index=False)
except Exception:
@pokgak
pokgak / gist:7edfc5e73488561c78b78260da51c22d
Created September 28, 2020 16:19
diff of the rebased PR13103 on master(bfb8fc52b)
diff --git a/sys/xtimer/xtimer_core.c b/sys/xtimer/xtimer_core.c
index 59d22560c..4465e1373 100644
--- a/sys/xtimer/xtimer_core.c
+++ b/sys/xtimer/xtimer_core.c
@@ -43,13 +43,11 @@ static volatile int _in_handler = 0;
volatile uint64_t _xtimer_current_time = 0;
static xtimer_t *timer_list_head = NULL;
-static xtimer_t *long_list_head = NULL;
static bool _lltimer_ongoing = false;
This file has been truncated, but you can view the full file.
<html>
<head><meta charset="utf-8" /></head>
<body>
<div>
<script type="text/javascript">window.PlotlyConfig = {MathJaxConfig: 'local'};</script>
<script type="text/javascript">/**
* plotly.js v1.54.5
* Copyright 2012-2020, Plotly, Inc.
* All rights reserved.
@pokgak
pokgak / saclay-iotlab-m3-dtls-echo-modified.log
Created July 2, 2020 23:42
dtls-echo + rpl + ping6 enabled
1593732840.895972;m3-12;�main(): This is RIOT! (Version: 2018.10-devel-11412-g2ed76)
1593732840.896714;m3-12;RIOT (Tiny)DTLS testing implementation
1593732840.896895;m3-12;All up, running the shell now
1593732840.897113;m3-11;�main(): This is RIOT! (Version: 2018.10-devel-11412-g2ed76)
1593732840.897246;m3-11;RIOT (Tiny)DTLS testing implementation
1593732840.898931;m3-11;All up, running the shell now
m3-11;ifconfig 5 add 2001:db8::1
1593732858.522488;m3-11;> ifconfig 5 add 2001:db8::1
1593732858.522779;m3-11;success: added 2001:db8::1/64 to interface 5
m3-12;ifconfig 5 add 2001:db8::2
diff --git a/pkg/tinydtls/contrib/sock_dtls.c b/pkg/tinydtls/contrib/sock_dtls.c
index f688cdcf3..4a8d45945 100644
--- a/pkg/tinydtls/contrib/sock_dtls.c
+++ b/pkg/tinydtls/contrib/sock_dtls.c
@@ -82,6 +82,7 @@ static int _read(struct dtls_context_t *ctx, session_t *session, uint8_t *buf,
DEBUG("sock_dtls: decrypted message arrived\n");
sock->buf = buf;
sock->buflen = len;
+ sock->buf_session = session;
#ifdef SOCK_HAS_ASYNC
@pokgak
pokgak / scrape_issues.py
Created June 10, 2020 12:42
Get all timer issues/PR for RIOT-OS
#!/bin/env python3
import requests
import csv
issues = []
print(f"count: {len(issues)}")
params = {
"labels": "Area: timers",
diff --git a/examples/dtls-echo/dtls-client.c b/examples/dtls-echo/dtls-client.c
index baa5d9291..4f38df2ac 100644
--- a/examples/dtls-echo/dtls-client.c
+++ b/examples/dtls-echo/dtls-client.c
@@ -59,6 +59,9 @@ static int _events_handler(struct dtls_context_t *ctx,
(void) ctx;
(void) session;
(void) level;
+ if (code == DTLS_EVENT_CONNECT) {
+ puts("EVENT CONNECT");
@pokgak
pokgak / sock_dtls_async_v2.patch
Last active April 19, 2020 16:09
sock_dtls + sock_async v2
diff --git a/examples/dtls-sock/Makefile b/examples/dtls-sock/Makefile
index 4f22d50df..fb1c55608 100644
--- a/examples/dtls-sock/Makefile
+++ b/examples/dtls-sock/Makefile
@@ -16,7 +16,10 @@ USEMODULE += gnrc_netdev_default
USEMODULE += auto_init_gnrc_netif
# Specify the mandatory networking modules for IPv6 and UDP
USEMODULE += gnrc_ipv6_default
+USEMODULE += gnrc_sock_async
USEMODULE += gnrc_sock_udp
@pokgak
pokgak / client debug log
Last active December 18, 2019 16:36
Tinydtls debug log for renegotiation test. I added some newlines between the initial handshake and `client:renegotiate` command on the client and result on the server for clarity. See issue eclipse/tinydtls#23.
pokgak:[tests] $ ./dtls-client -v6 ::1
Dec 18 17:25:26 DEBG dtls_new_peer: [::1]:20220
Dec 18 17:25:26 DEBG DTLSv12: initialize HASH_SHA256
Dec 18 17:25:26 DEBG send handshake packet of type: client_hello (1)
Dec 18 17:25:26 DEBG send header: (13 bytes):
00000000 16 FE FF 00 00 00 00 00 00 00 00 00 54
Dec 18 17:25:26 DEBG send unencrypted: (12 bytes):
00000000 01 00 00 48 00 00 00 00 00 00 00 48
Dec 18 17:25:26 DEBG send unencrypted: (72 bytes):
00000000 FE FD 00 00 00 00 7B 45 3D 4E F1 CB AF 97 18 38
@pokgak
pokgak / test-handshake-failure.py
Last active October 18, 2019 12:36
Python pexpect script to test handling handshake_failure alert between two native RIOT instances
#!/usr/bin/env python3
import sys
import os
import pexpect
import time
import signal
serverIP = "<SERVER_IP>"