Skip to content

Instantly share code, notes, and snippets.

Avatar
🌨️
It's cold in Los Angeles

Nelson Chen nelsonjchen

🌨️
It's cold in Los Angeles
View GitHub Profile
@mnaberez
mnaberez / nec_78k0_flash.md
Last active Jan 17, 2022
NEC 78K0 Flash Vulnerability
View nec_78k0_flash.md

NEC 78K0 Flash Vulnerability

Overview

The microcontroller that I studied was removed from a Volkswagen car radio manufactured by Delco (now Delphi). The chip had only Delco markings on the package. It was decapsulated and the markings "NEC D78F0831Y" were found on the die. I reverse engineered the device definition files for the NEC toolchain (RA78K0) and determined that the uPD78F0831Y is a subset of a documented chip, the uPD78F0833Y. The '833Y adds 3 more timers, extended I2C functionality, and adds registers that allow firmware running on the '833Y to reprogram the flash ("self-programming"). Otherwise, the '831Y and '833Y are the same.

The uPD78F0831Y uses the NEC 78K0 core. Note that NEC (now Renesas) produced a number of incompatible cores with similar names such as 78K0S and 78K

@clrung
clrung / clone_all_repos.sh
Last active Apr 6, 2021
Clones all repos in a GitHub organization
View clone_all_repos.sh
#!/bin/bash
# Usage: clone_all_repos.sh [organization] <output directory>
ORG=$1
PER_PAGE=100
GIT_OUTPUT_DIRECTORY=${2:-"/tmp/${ORG}_repos"}
if [ -z "$GITHUB_TOKEN" ]; then
echo -e "Variable GITHUB_TOKEN isn't set! Please specify your GitHub token.\n\nMore info: https://help.github.com/articles/creating-a-personal-access-token-for-the-command-line/"
exit 1
@abbottdev
abbottdev / app.ts
Created Jun 11, 2019
Typescript example for creating aws cdk resources using a swaggerfile
View app.ts
import * as cdk from '@aws-cdk/cdk';
import * as SwaggerParser from "swagger-parser";
import convertSwaggerToCdkRestApi from "./swaggerHelper";
SwaggerParser
.parse("./swagger.yaml")
.then(swagger => {
const app = new cdk.App();
let apiGateway = new apigateway.RestApi(this, "My Rest API", {
@CoolOppo
CoolOppo / Cargo.toml
Last active Jan 5, 2022
How to compile to a DLL in rust while using it as a normal rust library
View Cargo.toml
[package]
name = "test"
version = "0.1.0"
authors = ["YOU <YOU@users.noreply.github.com>"]
edition = "2018"
[lib]
crate-type = ["cdylib"]
@npearce
npearce / install-docker.md
Last active Jan 19, 2022
Amazon Linux 2 - install docker & docker-compose using 'sudo amazon-linux-extras' command
View install-docker.md

UPDATE (March 2020, thanks @ic): I don't know the exact AMI version but yum install docker now works on the latest Amazon Linux 2. The instructions below may still be relevant depending on the vintage AMI you are using.

Amazon changed the install in Linux 2. One no-longer using 'yum' See: https://aws.amazon.com/amazon-linux-2/release-notes/

Docker CE Install

sudo amazon-linux-extras install docker
sudo service docker start
@moznion
moznion / docker-compose.yml
Last active May 15, 2018
docker-compose file for kibana with oauth2_proxy
View docker-compose.yml
version: '2.1'
services:
kibana:
image: 'docker.elastic.co/kibana/kibana-oss:6.1.0'
elasticsearch:
image: 'docker.elastic.co/elasticsearch/elasticsearch-oss:6.1.0'
oauth2-proxy:
image: 'a5huynh/oauth2_proxy:2.2'
@foklepoint
foklepoint / .gitlab-ci.yml
Created Jul 8, 2017
Build and Push images to GCP Container Registry with Gitlab CI
View .gitlab-ci.yml
image: docker:latest
# When using dind, it's wise to use the overlayfs driver for
# improved performance.
variables:
DOCKER_DRIVER: overlay
GCP_PROJECT_ID: CHANGE-TO-GCP-PROJECT-ID
IMAGE_NAME: image_id
services:
@dghubble
dghubble / kubeception.md
Last active Jan 7, 2022
Running QEMU/KVM and Nested Kubernetes on Bare-Metal Kubernetes
View kubeception.md
@phansch
phansch / yardoc_cheatsheet.md
Last active Jan 16, 2022 — forked from chetan/yardoc_cheatsheet.md
Improved YARD cheatsheet
View yardoc_cheatsheet.md
@Garrett-R
Garrett-R / gzip_str.py
Last active Nov 11, 2021
Demo of how to gzip and gunzip a string in Python 3
View gzip_str.py
"""How to gzip a string.
This works for Python 3.2. For 3.1-, look at the original gist (under "Revisions")
"""
import gzip
def gzip_str(string_: str) -> bytes:
return gzip.compress(string_.encode())