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 / 0dedict.py
Last active April 15, 2022 04:37 — forked from josephg/0dedict.py
Apple dictionaries
#!/usr/bin/env python3
# -*- coding: ascii -*-
# Thanks to commenters for providing the base of this much nicer implementation!
# Save and run with $ python 0dedict.py
# You may need to hunt down the dictionary files yourself and change the awful path string below.
# This works for me on MacOS 10.14 Mohave
# /System/Library/AssetsV2/com_apple_MobileAsset_DictionaryServices_dictionaryOSX/0cab8989af7642f18332cfdc038d97017d28586a.asset/AssetData/Spanish - English.dictionary/Contents/Resources/Body.data
import sys
@glowinthedark
glowinthedark / get_gists.py
Last active November 13, 2024 15:32 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
#!/usr/bin/env python3
#
# download all gists for a user, pass github user as first arg
# if the gists have already been downloaded before then update them
import json
import os
import re
import requests
<!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 / adb.sh
Created August 17, 2020 13:39 — forked from sofaking/adb.sh
Get battery level via adb
adb shell dumpsys battery | grep level
@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 / 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 / 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:
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
import os
# function to take care of downloading file
def enable_download_headless(browser,download_dir):
browser.command_executor._commands["send_command"] = ("POST", '/session/$sessionId/chromium/send_command')
params = {'cmd':'Page.setDownloadBehavior', 'params': {'behavior': 'allow', 'downloadPath': download_dir}}
browser.execute("send_command", params)
@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 / install_go_pi.sh
Last active June 25, 2023 13:58 — forked from pcgeek86/install_go_pi.sh
Install Go Lang on Raspberry Pi
cd /tmp
fileName='go1.20.5.linux-armv6l.tar.gz'
wget -c https://go.dev/dl/$fileName && sudo rm -rfv /usr/local/go && sudo tar -C /usr/local -xvf $fileName
grep -q 'GOPATH=' ~/.bashrc || cat >> ~/.bashrc << 'EOF'
export GOPATH=$HOME/go
export PATH=/usr/local/go/bin:$PATH:$GOPATH/bin
EOF
source ~/.bashrc