Skip to content

Instantly share code, notes, and snippets.

@heltonmarx
heltonmarx / rs485.cpp
Last active May 9, 2023 23:25
rs485 forcing set rst and dtr
#include <stdlib.h>
#include <time.h>
#include <string.h>
#include <assert.h>
#include "esp_mac.h"
#include "esp_log.h"
#include "config.h"
#include "rs485.h"
@heltonmarx
heltonmarx / netstat command
Last active June 27, 2022 18:11
Transport TIME_WAIT load test
netstat -n | grep -i 8080 | grep -i time_wait | wc -l
version: '3'
services:
datascience-notebook:
image: jupyter/datascience-notebook
container_name: datascience-notebook-container
volumes:
- .:/home/jupyter/work
ports:
- 8888:8888
@heltonmarx
heltonmarx / backtrace.c
Created August 20, 2018 13:05 — forked from crimsonwoods/backtrace.c
A sample code for ARM processor to handle the abnormal termination and display backtrace.
#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <ctype.h>
#include <unistd.h>
#include <signal.h>
#include <sys/ptrace.h>
#include <sys/wait.h>
#include <endian.h>
package pprof
import (
"fmt"
"net"
"net/http"
"net/http/pprof"
"runtime"
rpprof "runtime/pprof"
"runtime/trace"
@heltonmarx
heltonmarx / xubuntu-18.04-install.md
Created July 7, 2018 10:18 — forked from curtismckee/xubuntu-18.04-install.md
This is my install reference for new xubuntu 18.04 LTS. Will try and keep updated.

A fresh xUbuntu 18.04 LTS installation

The newest Ubuntu LTS version code named Bionic Beaver was released a few months ago and I thought it was finally time to upgrade. I also thought I would take this opportunity to write down the steps taken for my reference and anyone else who might find it useful.


Making sure all your software is up to date and all per-requisites are installed.

First things first, we want to make sure we are fully up-to-date on our fresh system. This will allow us to install the newest versions of all packages currently installed on the system from the sources file at /etc/apt/sources.list.

sudo apt-get upgrade
@heltonmarx
heltonmarx / qemu_osx_rpi_raspbian_jessie.sh
Created January 24, 2018 17:03 — forked from hfreire/qemu_osx_rpi_raspbian_jessie.sh
How to emulate a Raspberry Pi (Raspbian Jessie) on Mac OSX (El Capitan)
# Install QEMU OSX port with ARM support
sudo port install qemu +target_arm
export QEMU=$(which qemu-system-arm)
# Dowload kernel and export location
curl -OL \
https://github.com/dhruvvyas90/qemu-rpi-kernel/blob/master/kernel-qemu-4.1.7-jessie
export RPI_KERNEL=./kernel-qemu-4.1.7-jessie
# Download filesystem and export location
@heltonmarx
heltonmarx / goseq_post.go
Created April 21, 2017 12:13
gosep help gist
package goseq
import (
"bytes"
"encoding/json"
"fmt"
)
const (
endpoint = "/api/events/raw"

1. Clone your fork:

git clone git@github.com:YOUR-USERNAME/YOUR-FORKED-REPO.git

2. Add remote from original repository in your forked repository:

cd into/cloned/fork-repo
git remote add upstream git://github.com/ORIGINAL-DEV-USERNAME/REPO-YOU-FORKED-FROM.git
git fetch upstream
@heltonmarx
heltonmarx / sniffer.c
Created February 24, 2016 03:05
Sniffer tcp packages on port 7000 using libpcap
#include <pcap.h>
#include <string.h>
#include <stdlib.h>
#include <ctype.h>
#include <stdio.h>
#define MAXBYTES2CAPTURE 2048
/* processPacket(): Callback function called by pcap_loop() everytime a packet */
/* arrives to the network card. This function prints the captured raw data in */