Skip to content

Instantly share code, notes, and snippets.

View a0x's full-sized avatar
:shipit:
happy hacking

AmadeusQ a0x

:shipit:
happy hacking
View GitHub Profile
@seanorama
seanorama / pyspark-on-yarn-self-contained.md
Last active September 8, 2023 07:43
PySpark on YARN in self-contained environments
@koenrh
koenrh / proxify-vmware-fusion-vm.md
Created July 8, 2019 15:41
This is a little guide that helps you to "proxify" a VMware Fusion virtual machine on macOS. This can be useful if you want to isolate and analyse web traffic to/from an application by running it in a VM.

Proxifying a VMware Fusion virtual machine on macOS

This is a little guide that helps you to "proxify" a VMware Fusion virtual machine on macOS. This can be useful if you want to isolate and analyse web traffic to/from an application by running it in a VM.

Prerequisites

  • VMware Fusion 11 Pro
  • Transparent HTTP/HTTPS proxy (e.g. Burp Suite Pro or mitmproxy)
@limboinf
limboinf / thread_pools.py
Created December 23, 2016 05:52
Python线程池
# coding=utf-8
"""
线程池.
:copyright: (c) 2015 by fangpeng.
:license: MIT, see LICENSE for more details.
"""
import sys
import Queue
import threading

FWIW: I (@rondy) am not the creator of the content shared here, which is an excerpt from Edmond Lau's book. I simply copied and pasted it from another location and saved it as a personal note, before it gained popularity on news.ycombinator.com. Unfortunately, I cannot recall the exact origin of the original source, nor was I able to find the author's name, so I am can't provide the appropriate credits.


Effective Engineer - Notes

What's an Effective Engineer?

@keelii
keelii / vimrc
Last active July 21, 2024 07:21
vimrc for window
" ------------------------------
" Name: vimrc for windows
" Author: keelii
" Email: keeliizhou@gmail.com
" ------------------------------
" Startup {{{
filetype indent plugin on
augroup vimrcEx
@terrydang
terrydang / install_nvidia_driver_in_ubuntu1604.md
Last active August 8, 2022 09:31
Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

Ubuntu 16.04 安装英伟达(Nvidia)显卡驱动

配有英伟达显卡的主机,装完 Ubuntu 16.04 后出现闪屏现象,是由于没有安装显卡驱动。

显卡型号
NVIDIA Corporation GM204 [GeForce GTX 970]

@evantoli
evantoli / GitConfigHttpProxy.md
Last active July 20, 2024 03:29
Configure Git to use a proxy

Configure Git to use a proxy

In Brief

You may need to configure a proxy server if you're having trouble cloning or fetching from a remote repository or getting an error like unable to access '...' Couldn't resolve host '...'.

Consider something like:

@schminitz
schminitz / schminitz.zsh-theme
Created September 2, 2015 13:55
Another oh-my-zsh theme with background vim recognize
ZSH_THEME_GIT_PROMPT_PREFIX=" %{$fg[cyan]%}"
ZSH_THEME_GIT_PROMPT_SUFFIX="%{$reset_color%}"
ZSH_THEME_GIT_PROMPT_DIRTY="%{$fg[red]%}✘"
ZSH_THEME_GIT_PROMPT_CLEAN="%{$fg[green]%}✔"
ZSH_THEME_GIT_PROMPT_AHEAD="%{$fg[red]%}➦"
# ZSH_THEME_GIT_PROMPT_ADDED="%{$fg[cyan]%} ✈"
# ZSH_THEME_GIT_PROMPT_MODIFIED="%{$fg[yellow]%} ✭"
# ZSH_THEME_GIT_PROMPT_DELETED="%{$fg[red]%} ✗"
# ZSH_THEME_GIT_PROMPT_RENAMED="%{$fg[blue]%} ➦"
@ilyaigpetrov
ilyaigpetrov / retrieve-.pyc-grammar-from-marshal.c.md
Last active January 26, 2020 14:58
Retrieve .pyc Grammar from Python's Sources | by https://git.io/ilyaigpetrov

Retrieve .pyc Grammar from Python's Sources

About my endeavor to automatically retrieve grammar of CPython .pyc-files bytecode from Python's sources itself (success) and build parser on them (failed).
Most recent version of this article is always on GitHub

The problem story

In 2011 as part of my diploma thesis I came up with an assembler language for .pyc files and wrote a simple proof-of-concept assembler for it based on ANTLR3 parser generator. Back then I stumble upon the issue that CPython bytecode is somewhat not stable and differs from version to version. I.e., as of Python from 3.0 to 3.4 there are 28 incompatible bytecode versions (you may find all bytecode versions with their descriptions in Python34/Lib/importlib/_bootstrap.py).

So, if we aim to devise an assembler or disassembler not for one bytecode version but for many, we face a routine of retrieving out these bytecode differences. This task strikingly

@adamnew123456
adamnew123456 / pyc.py
Last active June 10, 2024 07:12
Using Inline C Code In Python Programs
"""
Inserts C code directly into Python files, which can then be dynamically linked
in and called via ctypes.
"""
import atexit
import ctypes
import os
import shlex
import sys
import tempfile