Skip to content

Instantly share code, notes, and snippets.

View up-n-atom's full-sized avatar

up-n-atom

View GitHub Profile
@shadansari
shadansari / howto-view-omci-in-wireshark.md
Last active March 20, 2023 08:41
Howto view omci in wireshark

Howto view omci pkts in Wireshark

Install omci wireshark dissectors

Install omci.lua and BinDecHex.lua dissectors wiki.wireshark.org/Contrib:

Ubuntu

mkdir -p $(HOME)/.local/lib/wireshark/plugins
cd $(HOME)/.local/lib/wireshark/plugins
wget "https://wiki.wireshark.org/Contrib?action=AttachFile&do=get&target=omci.lua"
// Demo Verilog Module that flashes the LED by shifting 4 bits
// from "SUG100-1.2E_Gowin YunYuan Software User Guide"
module demo ( // Declare our demo module.
clk_50M, // Declare 3 pins: clk_50M, rst_n, led.
rst_n, // We will connect these pins to the
led); // actual clock signal, reset signal and LEDs.
input clk_50M; // Declare the clock pin as an Input signal.
input rst_n; // Reset pin is also an Input, triggered by board restart or reset button.
@vdbelt
vdbelt / cloudflare-purge-cache-service-worker.js
Created August 21, 2018 11:43
A CloudFlare service worker that proxies purge cache requests. Example: https://example.com/__purge_cache?zone=XX
addEventListener('fetch', event => {
event.respondWith(purgeCache(event.request))
})
async function purgeCache(request) {
const url = new URL(request.url)
`timescale 1ms/1ms
/// SPI
module simple_spi_m_bit_rw
#(
parameter reg_width = 8
)
(
// System side
input rstn,
@tyzbit
tyzbit / update-adblock.sh
Created February 24, 2018 14:33
Update Adblock on OPNSense v17 (and possibly above)
#!/bin/sh
## Clean up any stale tempfile
echo "Removing old files..."
[ -f /tmp/hosts.working ] && rm -f /tmp/hosts.working
## Awk regex to be inverse-matched as whitelist
# - Project Wonderful does unobtrusive ads on a lot of webcomics
# - SolveMedia is needed for captchas on some websites
#whitelist='/(projectwonderful.com|api.solvemedia.com)/'
@deoren
deoren / Ubuntu_on_Hyper-V.md
Last active May 8, 2023 11:01
Ubuntu on Hyper-V

Enabling full Hyper-V support for Ubuntu

Install packages

Short version: See docs.microsoft.com link below.

Ubuntu 17.04 and later

  1. sudo apt-get update
  2. sudo apt-get install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual
@kontez
kontez / freeotp_backup.md
Created January 4, 2018 14:27 — forked from jleclanche/freeotp_backup.md
A guide to back up and recover 2FA tokens from FreeOTP (Android)

Backing up and recovering 2FA tokens from FreeOTP

Backing up FreeOTP

Using adb, create a backup of the app using the following command:

adb backup -f freeotp-backup.ab -apk org.fedorahosted.freeotp
@berk76
berk76 / c_asm.md
Last active February 12, 2025 16:57
DOS: TASM and C

How to combine Assembly and C in DOS

This gist is showing an example of C program calling routine written in assembly.

Some theory

  • C is case sensitive so it is necessary to use /ml switch in TASM
  • C compiler uses leading underscore (_) character for function names
  • parameters are passed to function in stack and integer return value is passed back in AX register
  • stack cleaning is done by caller
@Ariki
Ariki / start_libopencm3.sh
Created November 12, 2017 20:26
Start a new libopencm3 based project for Blue Pill STM32F103C8 board
#!/usr/bin/sh
# Start a new libopencm3 based project for Blue Pill STM32F103C8 board.
# Takes project name as a parameter.
EXAMPLES_MASTER=\
"https://raw.githubusercontent.com/libopencm3/libopencm3-examples/master"
mkdir "$1"
cd "$1"
#!/usr/bin/env python
import lief
shellx = lief.parse("libshellx-2.10.3.1.so")
# .dynsym
dt_symtab = shellx[lief.ELF.DYNAMIC_TAGS.SYMTAB]
dynsym_section = shellx.get_section(".dynsym")