Skip to content

Instantly share code, notes, and snippets.

View ashelly's full-sized avatar

AShelly ashelly

  • San Francisco, CA
View GitHub Profile
@ashelly
ashelly / tree_encode.c
Created November 4, 2019 17:58
Compact binary tree encoding. Solution to https://codegolf.stackexchange.com/q/339/152
#include <stdio.h>
#include <stdlib.h>
#include <math.h>
typedef struct Node_t
{
int data;
struct Node_t* left;
struct Node_t* right;
@ashelly
ashelly / udpclient.py
Created January 19, 2021 04:52
Python UDP Client
import socket
fd = socket.socket(socket.AF_INET, socket.SOCK_DGRAM )
fd.settimeout(1)
udp_ip = '10.82.2.254'
udp_port = 4001
while(True):
message = input("> ")+"\r"
fd.sendto(message.encode(), (udp_ip, udp_port))
while(True):
try:
@ashelly
ashelly / gdb_tricks.md
Last active July 19, 2023 18:44
gdb debugging setup

redirect output to another terminal

  • In target terminal type tty
  • copy the result (should be something like /dev/pts/0
  • in gdb window type tty <pasted-result>

tui mode

  • enable