Skip to content

Instantly share code, notes, and snippets.

View glowinthedark's full-sized avatar

glowinthedark glowinthedark

  • URLError: <urlopen error [Errno 8] nodename nor servname provided, or not known>
  • HTTPError: HTTP Error 403: Forbidden
View GitHub Profile
@glowinthedark
glowinthedark / disable.sh
Created September 30, 2019 09:39
Disable bunch of #$!@ in Catalina (It's back!)
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
@glowinthedark
glowinthedark / bopomofo.py
Created January 6, 2020 18:33 — forked from ttempe/bopomofo.py
Convert a pinyin string to bopomofo (Zhuyin)
# -*- coding: utf-8 -*-
#
# Copyright © 2012 Thomas TEMPÉ, <thomas.tempe@alysse.org>
# Copyright © 2014 Alex Griffin, <alex@alexjgriffin.com>
#
# DWTFYW license.
# Do what the fuck you want with this file.
import string
<div id="swipezone">
Swipe me
</div>
// credit: http://www.javascriptkit.com/javatutors/touchevents2.shtml
function swipedetect(el, callback){
var touchsurface = el,
swipedir,
startX,
@glowinthedark
glowinthedark / install_go_pi.sh
Last active April 11, 2020 21:35 — forked from pcgeek86/install_go_pi.sh
Install Go Lang on Raspberry Pi
cd $HOME
file='go1.14.2.linux-armv6l.tar.gz'
wget "https://dl.google.com/go/$file"
sudo tar -C /usr/local -xvf "$file"
cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc
@glowinthedark
glowinthedark / AesCrypt_python3.py
Last active August 2, 2020 11:57 — forked from pfote/AesCrypt.py
AES256 with PKCS5 padding
#!/usr/bin/env python3
# -*- coding: utf-8 -*-
from Crypto.Cipher import AES
import base64
import re
class AesCbc:
@glowinthedark
glowinthedark / exmp3.py
Created August 2, 2020 16:38 — forked from RavuAlHemio/exmp3.py
find and extract MP3 files from a binary file
#!/usr/bin/env python3
from math import floor
import struct
mp3_bit_rates = {
0b0001: 32000,
0b0010: 40000,
0b0011: 48000,
0b0100: 56000,
0b0101: 64000,
@glowinthedark
glowinthedark / gist:8d3b72a3e2a3657d5b4dde63dba6faf0
Created August 3, 2020 11:14 — forked from sgergely/gist:3793166
Midnight Commander Keyboard Shortcuts for Mac OSX
----- Esc -----
Quick change directory: Esc + c
Quick change directory history: Esc + c and then Esc + h
Quick change directory previous entry: Esc + c and then Esc + p
Command line history: Esc + h
Command line previous command: Esc + p
View change: Esc + t (each time you do this shortcut a new directory view will appear)
Print current working directory in command line: Esc + a
Switch between background command line and MC: Ctrl + o
Search/Go to directory in active panel: Esc + s / Ctrl + s then start typing directory name
@glowinthedark
glowinthedark / adb.sh
Created August 17, 2020 13:39 — forked from sofaking/adb.sh
Get battery level via adb
adb shell dumpsys battery | grep level
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>ACE Editor: submit, beautify and minify</title>
<style type="text/css" media="screen">
#ace_js, #ace_css {
width: 95%;
height: 15em;
border: 1px solid silver;
@glowinthedark
glowinthedark / http_multithreaded.py
Created April 3, 2020 21:35 — forked from gnilchee/http_multithreaded.py
Multi-threaded Python3 HTTP Server
#!/usr/bin/env python3
import sys, os, socket
from socketserver import ThreadingMixIn
from http.server import SimpleHTTPRequestHandler, HTTPServer
HOST = socket.gethostname()
class ThreadingSimpleServer(ThreadingMixIn, HTTPServer):
pass