Skip to content

Instantly share code, notes, and snippets.

View SimonTheCoder's full-sized avatar

Simon Shi SimonTheCoder

  • Liaoning, China
View GitHub Profile
@RamonWill
RamonWill / TkinterExcel.py
Last active April 4, 2024 13:49
The code from my video on how to view an excel file or Pandas Dataframe inside Tkinter (with comments)
# Youtube Link: https://www.youtube.com/watch?v=PgLjwl6Br0k
import tkinter as tk
from tkinter import filedialog, messagebox, ttk
import pandas as pd
# initalise the tkinter GUI
root = tk.Tk()
@tiandiduwuxiaoxiao
tiandiduwuxiaoxiao / jupyter.md
Last active October 25, 2023 18:26
install & uninstall jupyter

Install and uninstall jupyter

  1. Install jupyter
pip install jupyter
  • Launch jupyter
jupyter notebook
  1. Uninstall jupyter
@karpathy
karpathy / pg-pong.py
Created May 30, 2016 22:50
Training a Neural Network ATARI Pong agent with Policy Gradients from raw pixels
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward

radare2

load without any analysis (file header at offset 0x0): r2 -n /path/to/file

  • analyze all: aa
  • show sections: iS
  • list functions: afl
  • list imports: ii
  • list entrypoints: ie
  • seek to function: s sym.main
@zonque
zonque / xymodem-mini.c
Last active February 27, 2024 06:31
simple xmodem/ymodem implementation in C
/*
* Minimalistic implementation of the XModem/YModem protocol suite, including
* a compact version of an CRC16 algorithm. The code is just enough to upload
* an image to an MCU that bootstraps itself over an UART.
*
* Copyright (c) 2014 Daniel Mack <github@zonque.org>
*
* License: MIT
*/
@glacjay
glacjay / tun-ping-win.py
Created September 19, 2010 16:24
Reading/Writing OpenVPN's TUN/TAP Device under Windows using Python.
import _winreg as reg
import win32file
adapter_key = r'SYSTEM\CurrentControlSet\Control\Class\{4D36E972-E325-11CE-BFC1-08002BE10318}'
def get_device_guid():
with reg.OpenKey(reg.HKEY_LOCAL_MACHINE, adapter_key) as adapters:
try: