Skip to content

Instantly share code, notes, and snippets.

View ryanwoodsmall's full-sized avatar
🍞
🍞 bread 🍞 sandwich 🍞

ryan ryanwoodsmall

🍞
🍞 bread 🍞 sandwich 🍞
View GitHub Profile
@afdalwahyu
afdalwahyu / http_proxy.go
Last active February 13, 2025 19:46
golang http proxy server CONNECT method
package main
import (
"bufio"
"encoding/base64"
"flag"
"io"
"io/ioutil"
"log"
"net"
@velitasali
velitasali / bt-agent.service
Last active January 19, 2025 21:13
Bluetooth NAP Network on RPi4 - package: bluez-utils
# /etc/systemd/system/bt-agent.service
[Unit]
Description=Bluetooth Auth Agent
[Service]
ExecStart=/usr/bin/bt-agent -c NoInputNoOutput
Type=simple
[Install]
#!/bin/bash
#
# A script that takes a Twitter data archive, which is produced as a
# set of JavaScript files (different from the regular archive, which
# is CSV and HTML), and converts the `tweet.js` file, which contains
# all of the tweets, into tractable JSON, one tweet per line. It then
# inserts /that/ into a SQLite3 database, and extracts a simple
# relational table of tweets from the JSON. Finally, it runs datasette
# on the resulting database to allow you to explore.
@zoilomora
zoilomora / README.md
Last active April 20, 2025 20:46
How to disable systemd-resolved in Ubuntu

How to disable systemd-resolved in Ubuntu

Stages

  • Disable and stop the systemd-resolved service:

      sudo systemctl disable systemd-resolved.service
      sudo systemctl stop systemd-resolved
    
  • Then put the following line in the [main] section of your /etc/NetworkManager/NetworkManager.conf:

@ryanwoodsmall
ryanwoodsmall / esp8266_wifi.py
Last active February 8, 2021 19:53
esp8266 esp32 micropython main.py wifi setup
#!/usr/bin/env python
#
# erase the esp8266 flash
# sudo $(which esptool.py) --port /dev/ttyUSB0 erase_flash
# write the micropython firmware
# sudo $(which esptool.py) --port /dev/ttyUSB0 --baud 460800 write_flash --flash_size=detect -fm dio 0 /tmp/esp8266-20190125-v1.10.bin
# save this file to esp8266_wifi.py
# add your wireless network/password to the wifi.connect() line
# run:
# echo "f=open('/main.py','w')"
@cb372
cb372 / riscv.md
Last active April 9, 2025 19:53
Writing an OS in Rust to run on RISC-V

(This is a translation of the original article in Japanese by moratorium08.)

(UPDATE (22/3/2019): Added some corrections provided by the original author.)

Writing your own OS to run on a handmade CPU is a pretty ambitious project, but I've managed to get it working pretty well so I'm going to write some notes about how I did it.

@aallan
aallan / throttled.sh
Last active March 17, 2024 04:42
Script to parse the output of the 'vcgencmd get_throttled' command on a Raspberry Pi
#!/bin/bash
# https://retropie.org.uk/forum/topic/2295/runcommand-warning-if-voltage-temperature-throttling
#Flag Bits
UNDERVOLTED=0x1
CAPPED=0x2
THROTTLED=0x4
HAS_UNDERVOLTED=0x10000
HAS_CAPPED=0x20000
@stephane-martin
stephane-martin / inetd.go
Created November 21, 2018 23:03
Make a net.Listener to listen on stdin for inetd enables services
package main
import (
"errors"
"net"
"os"
"sync"
)
type StdinListener struct {
@mattr-
mattr- / get-api-token-of-user-jenkins-groovy.md
Last active June 7, 2021 14:23 — forked from imranity/get-api-token-of-user-jenkins-groovy.md
jenkins groovy get API token of a user

This is pretty simple snippet to get API Token of a user , lets say "MYUser" in jenkins.
its pretty useful when you are working with 'jenkins-job-builder' to update jobs in jenkins, and you need to get the api token which JJB needs inorder to update jobs to ..
run this code in either jenkins script console , or as i prefer, in form of init.groovy.
so when jenkins master starts, i create a user for JJb.
after that i get the token right away and pass it to my JJB jobs folder to file 'jenkins_jobs.ini' :)_ .

import jenkins.security.*       
User u = User.get("Myuser") 
@robey
robey / apple1-rom.txt
Last active May 22, 2023 03:49
apple 1 ROM disassembly
;
; the "monitor ROM" of an apple 1 fit in one page (256 bytes).
;
; this is my attempt to take the disassembled code, give names to the
; variables and routines, and try to document how it worked.
;
;
; an apple 1 had 8KB of RAM (more, if you hacked on the motherboard), and a
; peripheral chip that drove the keyboard and video. the video was run by a
; side processor that could treat the display as an append-only terminal that