Skip to content

Instantly share code, notes, and snippets.

@dcloud
dcloud / how_to_use_wireshark_with_nodejs.md
Last active March 14, 2024 15:40 — forked from dfrankland/how_to_use_wireshark_with_nodejs.md
How to use Wireshark with Node.js (especially with HTTPS / TLS / SSL)

How to use Wireshark with Node.js (especially with HTTPS / TLS / SSL)

It can be difficult to trace network traffic from a Node.js application. Typically, folks will just instrument some logging to check that everything is working as it is supposed to. Unfortunately, sometimes there are too many abstractions or possible race conditions to accurately get a good trace. To get the most objective possible trace of network traffic Wireshark can be used.

Wireshark is a network protocol analyzer that makes it extremely simple to capture and trace network activity from any source on your computer. It also has

@dcloud
dcloud / pi-hints.md
Last active July 19, 2019 01:01
Collecting some things I should remember when configuring Raspberry Pis

Pi Hints

Can't connect to archive.raspberrypi.org or similar?

Are you using ipv6? If so, you might need to force apt to use ipv4, e.g. sudo apt-get -o Acquire::ForceIPv4=true update. The -o Acquire::ForceIPv4=true config will force ipv4.

You can configure apt to do this without the need to add the option each time. Simply place that option in a config file: echo 'Acquire::ForceIPv4 "true";' | sudo tee /etc/apt/apt.conf.d/99force-ipv4. That will create a conf file to change Apt settings.

I think I used https://www.ostechnix.com/how-to-force-apt-package-manager-to-use-ipv4-in-ubuntu-16-04/ as inspiration.

@dcloud
dcloud / show_time.py
Created December 17, 2018 00:21
Messing with writing some numeric chars to unicorn hat hd
#!/usr/bin/env python3
from datetime import datetime
import time
import unicornhathd as uhd
# https://xantorohara.github.io/led-matrix-editor/#
NUMBERS = (
(

Keybase proof

I hereby claim:

  • I am dcloud on github.
  • I am danielcloud (https://keybase.io/danielcloud) on keybase.
  • I have a public key ASC9bcnHkszqGuxzDy5VZUhwe8Bu8eTzAGAvVyeAOvrqJAo

To claim this, I am signing this object:

@dcloud
dcloud / merge_ogr.py
Created March 31, 2016 22:16
Quick and dirty KML to shape file conversion, with problems :(
import os
import ogr
import osr
import argparse
fileEndsWith = '.shp'
driverName = 'ESRI Shapefile'
def main():
@dcloud
dcloud / interactive_list.md
Last active January 12, 2016 02:51
News Interactives worth sharing
@dcloud
dcloud / unicode_reg
Last active September 4, 2020 17:55
That is so cool
# Curly/Educated marks are \u2018-\u201F in Unicode
# python
re.findall(u'[\u2018-\u201F]', apage)
# bash
for i in $(seq 0x2018 0x201F); do
echo "char: \u$(( [##16]i ))"
done
@dcloud
dcloud / segment2segment_distance.py
Created July 30, 2014 15:25
Line segment distance algorithm
import numpy as np
def segment2segment_distance(a, b):
"""
Adapted from http://geomalgorithms.com/a07-_distance.html
"""
SMALL_NUM = 0.00000001
S1P0 = np.array(a[:2])
S1P1 = np.array(a[2:])
S2P0 = np.array(b[:2])
@dcloud
dcloud / elec_shopping_ch1.markdown
Last active August 14, 2023 14:29
Make Electronics Shopping List

Chapter 1 Parts List

Tools

###Small pliers

RadioShack 4.5-inch mini long-nose pliers, part number 64-0062, or Xcelite 4-inch mini long-nose pliers, model L4G. Or similar. The brand is unimportant. After you use them for a while, you'll develop your own preferences. In particular, you have to decide whether you like spring-loaded handles. If you decide you don't, you'll need a second pair of pliers to pull the springs out of the first.

I have small pliers, probably okay.

@dcloud
dcloud / 990-p2.html
Created February 23, 2014 15:52
hOCR output for a single page using tesseract on images extracted from pdfs using poppler
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
<title></title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name='ocr-system' content='tesseract 3.02.02' />
<meta name='ocr-capabilities' content='ocr_page ocr_carea ocr_par ocr_line ocrx_word'/>
</head>