Skip to content

Instantly share code, notes, and snippets.

View antigenius0910's full-sized avatar

Yen antigenius0910

  • Austin
View GitHub Profile
@antigenius0910
antigenius0910 / PyTorStemPrivoxy.md
Created July 14, 2016 05:18 — forked from KhepryQuixote/PyTorStemPrivoxy.md
Python script to connect to Tor via Stem and Privoxy, requesting a new connection (hence a new IP as well) as desired.

Crawling Anonymously with Tor in Python

adapted from the article "Crawling anonymously with Tor in Python" by S. Acharya, Nov 2, 2013.

The most common use-case is to be able to hide one's identity using TOR or being able to change identities programmatically, for example when you are crawling a website like Google and you don’t want to be rate-limited or blocked via IP address.

Tor

Install Tor.

@antigenius0910
antigenius0910 / Buffer Overflow Tutorial in Kali.md
Created April 5, 2017 01:36 — forked from apolloclark/Buffer Overflow Tutorial in Kali.md
Buffer overflow demonstration in Kali Linux, based on the Computerphile video
@antigenius0910
antigenius0910 / test_multi_gpu.py
Created November 28, 2018 04:03 — forked from j-min/test_multi_gpu.py
TensorFlow multi GPU example
from __future__ import print_function
'''
Basic Multi GPU computation example using TensorFlow library.
Author: Aymeric Damien
Project: https://github.com/aymericdamien/TensorFlow-Examples/
'''
'''
This tutorial requires your machine to have 2 GPUs
"/cpu:0": The CPU of your machine.
@antigenius0910
antigenius0910 / zabbix-docker-compose.yml
Created March 4, 2021 06:03 — forked from balvinder294/zabbix-docker-compose.yml
Zabbix running in Docker Compose with Postgres, Graffana, Adminer
version: '3.1'
services:
postgres-server: # The Postgres Database Service
image: postgres:latest
restart: always
environment: # Username, password and database name variables
POSTGRES_USER: zabbix
POSTGRES_PASSWORD: zabbix
POSTGRES_DB: zabbix
PG_DATA: /var/lib/postgresql/data/pgdata #data storage
@antigenius0910
antigenius0910 / troubleshooting-memory.md
Created June 19, 2021 07:39 — forked from carlessanagustin/troubleshooting-memory.md
Troubleshooting linux MEMORY usage

Troubleshooting linux MEMORY usage

This entry will hopefully show you how to troubleshoot memory used by Linux and application.

Linux System Memory usage

Display amount of free and used memory in the system (-m = in megas)

$ free -m

total used free shared buffers cached

@antigenius0910
antigenius0910 / latency.txt
Created June 21, 2021 10:45 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers (~2012)
----------------------------------
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns 14x L1 cache
Mutex lock/unlock 25 ns
Main memory reference 100 ns 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us
Send 1K bytes over 1 Gbps network 10,000 ns 10 us
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD
@antigenius0910
antigenius0910 / branch-fu.md
Created August 19, 2021 22:38 — forked from unbracketed/branch-fu.md
Moving commits between branches

Example: Moving up to a few commits to another branch

Branch A has commits (X,Y) that also need to be in Branch B. The cherry-pick operations should be done in the same chronological order that the commits appear in Branch A.

cherry-pick does support a range of commits, but if you have merge commits in that range, it gets really complicated

git checkout branch-B
git cherry-pick X
git cherry-pick Y
@antigenius0910
antigenius0910 / README.md
Created September 21, 2021 20:33 — forked from captn3m0/README.md
Grant Security Alert Permission on GitHub Org Script
  1. Set your Cookie header value in Line 3 of give-access.sh
  2. Set the team IDs that will have access on Line 24. You can add multiple teams.
  3. Edit the repos.txt file with one repository per line
  4. Make sure jq curl and pup are installed. (pup is available at https://github.com/EricChiang/pup)
  5. Run the script (./give-access.sh). A response code of 302 indicates the change was made successfully for that repo. Anything else is failure.

The only 3 cookies that you need to set are: __Host-user_session_same_site, user_session, _gh_sess

The values for user_session and _gh_sess are the same.

@antigenius0910
antigenius0910 / parse.py
Last active October 15, 2021 12:36
Capture single resource from terraform config file (*.tf) by heading and balanced pairs of braces
def parse_segments(source, resource_heading, single_or_all):
"""
extract any substring enclosed in parenthesis
source should be a string
"""
unmatched_count = 0
start_pos = 0
opened = False
open_pos = 0
cur_pos = 0
@antigenius0910
antigenius0910 / constraint.yaml
Created November 23, 2021 03:26
Gatekeeper policy
apiVersion: constraints.gatekeeper.sh/v1beta1
kind: K8sNsAuth
metadata:
name: block-deployment-prohibit-namespaces
spec:
match:
kinds:
- apiGroups: [""]
kinds: ["*"]
parameters: