Skip to content

Instantly share code, notes, and snippets.

View codsane's full-sized avatar

codsane codsane

View GitHub Profile
@snorrelo
snorrelo / pushoverhttphandler.py
Created March 2, 2018 17:17
Logging handler for python for sending log messages via Pushover.
# Custom logging handler for python for sending log messages via Pushover.
# https://pushover.net/
#
# Extends HTTPHandler https://docs.python.org/3.6/library/logging.handlers.html#httphandler
import logging.handlers
class PushoverHTTPHandler(logging.handlers.HTTPHandler):
_APP_TOKEN = None
@dajo
dajo / quizlet-scraper.js
Last active April 23, 2023 11:01 — forked from nodaguti/quizlet-scraper.js
Quizlet to CSV
/**
* Convert a list on Quizlet into CSV-formatted text.
* Usage:
* i) Copy and paste into your browser's console.
* ii) Run it!
*/
(() => {
const terms = document.getElementsByClassName('term');
const csv = [];

Using the fs-net libtransistor fork

This guide assumes you are already familliar with setting up RetroArch with libtransistor.

Clone the fs-net branch from https://github.com/davidbuchanan314/libtransistor:

git clone https://github.com/davidbuchanan314/libtransistor --recursive -b fs-net

Build libtransistor as usual.

@DusanMadar
DusanMadar / TorPrivoxyPython.md
Last active May 16, 2024 08:35
A step-by-step guide how to use Python with Tor and Privoxy

A step-by-step guide how to use Python with Tor and Privoxy

Latest revision: 2021-12-05.

Tested on Ubuntu 18.04 Docker container. The Dockerfile is a single line FROM ubuntu:18.04. Alternatively, you can simply run docker run -it ubuntu:18.04 bash.

NOTE: stopping services didn't work for me for some reason. That's why there is kill $(pidof <service name>) after each failed service <service name> stop to kill it.

References

@DeflatedPickle
DeflatedPickle / MinecraftEnergyTypes.md
Last active May 5, 2024 12:10
A simple table for Minecraft energy types and a matrix for conversion rates.

Minecraft Energy Types


Energy Name Abbreviation Original Mod Version
Anima AM Anima-Mundi 1.11.2
Blutricity BE (NO) Redpower 1.6.4
Charge RP (NO)/Fz? Factorization 1.7.10
Crystal Flux CF Actually Additions 1.12
@dennislwy
dennislwy / aes.py
Last active June 13, 2023 05:15
Python helper class to perform AES encryption, decryption with CBC Mode & PKCS7 Padding
# AES helper class for pycrypto
# Copyright (c) Dennis Lee
# Date 22 Mar 2017
# Description:
# Python helper class to perform AES encryption, decryption with CBC Mode & PKCS7 Padding
# References:
# https://www.dlitz.net/software/pycrypto/api/2.6/
# http://japrogbits.blogspot.my/2011/02/using-encrypted-data-between-python-and.html
@0xjac
0xjac / private_fork.md
Last active May 17, 2024 16:27
Create a private fork of a public repository

The repository for the assignment is public and Github does not allow the creation of private forks for public repositories.

The correct way of creating a private frok by duplicating the repo is documented here.

For this assignment the commands are:

  1. Create a bare clone of the repository. (This is temporary and will be removed so just do it wherever.)

git clone --bare git@github.com:usi-systems/easytrace.git

@zulhfreelancer
zulhfreelancer / heroku_pg_db_reset.md
Last active January 29, 2024 10:09
How to reset PG Database on Heroku (for Rails app)?

It's important to note that running this reset will drop any existing data you have in the application

How to reset PG Database on Heroku?

  • Step 1: heroku restart
  • Step 2: heroku pg:reset DATABASE (no need to change the DATABASE)
  • Step 3: heroku run rake db:migrate
  • Step 4: heroku run rake db:seed (if you have seed)

One liner

@gbaman
gbaman / HowToOTG.md
Last active May 16, 2024 20:10
Simple guide for setting up OTG modes on the Raspberry Pi Zero

Raspberry Pi Zero OTG Mode

Simple guide for setting up OTG modes on the Raspberry Pi Zero - By Andrew Mulholland (gbaman).

The Raspberry Pi Zero (and model A and A+) support USB On The Go, given the processor is connected directly to the USB port, unlike on the B, B+ or Pi 2 B, which goes via a USB hub.
Because of this, if setup to, the Pi can act as a USB slave instead, providing virtual serial (a terminal), virtual ethernet, virtual mass storage device (pendrive) or even other virtual devices like HID, MIDI, or act as a virtual webcam!
It is important to note that, although the model A and A+ can support being a USB slave, they are missing the ID pin (is tied to ground internally) so are unable to dynamically switch between USB master/slave mode. As such, they default to USB master mode. There is no easy way to change this right now.
It is also important to note, that a USB to UART serial adapter is not needed for any of these guides, as may be documented elsewhere across the int

@yesvods
yesvods / gist:51af798dd1e7058625f4
Created August 15, 2015 11:13
Merge Arrays in one with ES6 Array spread
const arr1 = [1,2,3]
const arr2 = [4,5,6]
const arr3 = [...arr1, ...arr2] //arr3 ==> [1,2,3,4,5,6]