This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!DOCTYPE html> | |
<html> | |
<head> | |
<title>Map demo</title> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.css" /> | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.js"></script> | |
<link rel="stylesheet" href="https://unpkg.com/[email protected]/dist/leaflet.draw.css" /> | |
<script src="https://unpkg.com/[email protected]/dist/leaflet.draw-src.js"></script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
TMPDIR="$(mktemp -d)" | |
# Capture the default shell options, before we enter POSIX mode | |
set +o | sort > "$TMPDIR/shellopts.old" | |
echo "set -$-" >> "$TMPDIR/shellopts.old" | |
set -o posix | |
# Capture global variables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
# Copyright (C) 2019 Woods Hole Oceanographic Institution | |
# | |
# This file is part of the CGSN Mooring Project ("cgsn-mooring"). | |
# | |
# cgsn-mooring is free software: you can redistribute it and/or modify | |
# it under the terms of the GNU General Public License as published by | |
# the Free Software Foundation, either version 2 of the License, or | |
# (at your option) any later version. | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python | |
import random | |
# Here is our plaintext message | |
message = 'THISISATESTITISONLYATEST' | |
# Insert random spaces into the message | |
while len(message) < 72: | |
i = random.randrange(len(message)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See also: | |
# https://docs.djangoproject.com/en/2.2/intro/tutorial01/ | |
# Install Django | |
python -m pip install django | |
# This creates a blank new Django project in mysite/ | |
django-admin startproject mysite | |
cd mysite/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# See also: | |
# https://docs.djangoproject.com/en/2.2/intro/tutorial01/ | |
# Install Django | |
python -m pip install django | |
# This creates a blank new Django project in mysite/ | |
django-admin startproject mysite | |
cd mysite/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
''' | |
This is a list of opcodes for the TC32 MCU, as disassembled by the objdump | |
binary provided (without source) with the Telink IDE. | |
The format is (value, mask, assembly). | |
See | |
http://sourceware.org/git/gitweb.cgi?p=binutils-gdb.git;a=blob;f=opcodes/arm-dis.c;hb=HEAD#l2508 | |
''' | |
[ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Quickly written script to enumerate an array of structures and dump them | |
# as a Python object for further processing. | |
# | |
# This is NOT a good example of Ghidra scripting; I basically figured out | |
# the API by brute force. Hopefully there is a more elegant way to do this. | |
#@author Ryan Govostes | |
#@category Data | |
#@keybinding | |
#@menupath |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import crcmod | |
from z3 import * | |
# This is a CRC-16 algorithm coded to be able to use Z3's symbolic types | |
def crc16_py(buffer, initial, poly, xorout): | |
crc = initial | |
for b in buffer: | |
crc = crc ^ (b << 8) | |
for i in range(8): | |
crc = If(crc & 0x8000 != 0, (crc << 1) ^ poly, crc << 1) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* doesn't work */ | |
#include <fcntl.h> | |
#include <stdio.h> | |
#include <unistd.h> | |
int main() { | |
close(STDOUT_FILENO); | |
if (open("/dev/null", O_WRONLY) != STDOUT_FILENO) { | |
fprintf(stderr, "Could not open /dev/null as fd %d", STDOUT_FILENO); |