Skip to content

Instantly share code, notes, and snippets.

View darvell's full-sized avatar

Darvell darvell

View GitHub Profile
@darvell
darvell / firstvoices_api.py
Created August 23, 2020 18:57
Starting point for a scraper for use with FirstVoices. For archival purposes only.
#/usr/bin/python3
try:
import requests
except:
raise Exception("Requests library not installed. Please run 'easy_install requests' or 'pip3 install requests")
import os
import csv
import json
modify_mp3 = False
from ctypes import *
from datetime import datetime
import struct
import os
import sys
MAX_LOG_LINE_LENGTH = 512
MAX_LINES = 2048
MAGIC = 0xBADBABE
POTENTIAL_WG_PATHS = [os.path.expandvars(os.path.join("%PROGRAMDATA%","WireGuard","log.bin")),os.path.expandvars(os.path.join("%WINDIR%","System32","config","systemprofile","AppData","Local","WireGuard","log.bin"))]
@darvell
darvell / add_node_exceptions.ps1
Created October 23, 2017 00:20
Adds useful exceptions to Windows Defender for node.js developers.
If (-NOT ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator"))
{
Write-Warning "You do not have Administrator rights to run this script!`nPlease re-run this script as an Administrator!"
Break
}
Write-Host "Excluding appdata NPM folder and Node.JS install folder from Windows Defender."
Add-MpPreference -ExclusionPath ([System.Environment]::ExpandEnvironmentVariables("%APPDATA%\npm\"))
Add-MpPreference -ExclusionPath (Get-ItemProperty "HKLM:SOFTWARE\Node.js" | Select-Object -Property InstallPath)
#!/usr/bin/env python
import os
import sys
import CloudFlare
import tldextract
import boto3
CLOUDFLARE_KEY = os.environ["CLOUDFLARE_KEY"]
CLOUDFLARE_EMAIL = os.environ["CLOUDFLARE_EMAIL"]
@darvell
darvell / s3-deploy.cmd
Created April 30, 2017 16:08
Command to deploy to folder to an S3 bucket and hook up that bucket to a CNAME on cloudflare.
@goto py2cmd
#!/usr/bin/env python
import os
import sys
import CloudFlare
import tldextract
import boto3
import mimetypes
mimetypes.init()

Keybase proof

I hereby claim:

  • I am darvell on github.
  • I am darvell (https://keybase.io/darvell) on keybase.
  • I have a public key whose fingerprint is AFC0 1B0B 3057 C778 96B8 C46D 7E2A 8184 5633 59A1

To claim this, I am signing this object:

@darvell
darvell / gist:2156265
Created March 22, 2012 05:12
GH Downloader
# I am totally aware BeautifulSoup is slow.
# Please do not inform me, this is just for fun.
import urllib2
import BeautifulSoup
import re
import os
import sys
from threading import Thread
@darvell
darvell / gist:1965833
Created March 3, 2012 12:10
Pug dog obfusication
import re
def encrypt(string):
finalstring = str()
for word in string:
for char in word:
finalstring += 'pug' + (ord(char)* ' ')
return finalstring
def decrypt(string):
@darvell
darvell / gist:1469818
Created December 13, 2011 00:29
Huffman find and ruin
def CorruptHuffman(filename,chance,maxlen):
with open(filename,"r+b") as f:
filesize = os.path.getsize(filename)
huffmanStart = 0
huffmanEnd = 0
found = 0
for i in range(0,filesize):
if found == 2:
break