Skip to content

Instantly share code, notes, and snippets.

View featherbear's full-sized avatar
🙏
I might use nano, but does YOUR code work?

Andrew Wong featherbear

🙏
I might use nano, but does YOUR code work?
View GitHub Profile
@featherbear
featherbear / CS1.6 Log Parser
Last active September 6, 2016 08:39
[Python 2.7] Counter-Strike 1.6 Server Log Kills & Deaths Extractor - For STHS SRC SCL Winter MCS 2016
#!/usr/bin/env python
# -*- coding: utf-8 -*-
import sys
if len(sys.argv) < 2: print("Please supply a log(s) as an argument!"); sys.exit()
import re
for fileLog in sys.argv[1:]:
if fileLog[-4:].lower() == ".dat": print("Skipping " + fileLog + " for protection..."); continue
logsArr = []
lineParser = re.compile(r'L (\d{2}\/\d{2}\/\d{4}) - (\d{2}:\d{2}:\d{2}): (.*)')
nameParser = re.compile(r'"(?:(.+?)<\d+?><(.+?)><(.+?)>)"')
@featherbear
featherbear / install_ntfs3g.sh
Last active October 12, 2017 15:31
Install ntfs-3g driver on Mac
#!/bin/bash
echo Installing ntfs-3g driver! Notice, computer will restart twice during installation
if [ $EUID -ne 0 ]; then
echo Requesting sudo!
exec sudo $0
fi
echo Disabling system integrity protection
csrutil disable
@featherbear
featherbear / darkmode.css
Created December 17, 2019 00:14
Franz Messenger.com darkmode.css
/*
https://github.com/auscompgeek/fb-messenger-dark
*/
/* ==UserStyle==
@name Facebook Messenger - the dark side
@namespace vovo.id.au
@version 2019.11.14
@license CC-BY-SA-4.0
==/UserStyle== */
@featherbear
featherbear / Dockerfile
Created February 29, 2020 00:34
Crater Dockerfile
##### STAGE 1 #####
FROM composer as composer
# Copy composer files from project root into composer container's working dir
COPY composer.* /app/
# Copy database directory for autoloader optimization
COPY database /app/database
@featherbear
featherbear / nginx.conf
Created February 29, 2020 00:35
Crater nginx.conf
worker_processes 8;
error_log stderr warn;
pid /run/nginx.pid;
events {
worker_connections 4096;
}
http {
@featherbear
featherbear / monomix.bat
Created September 3, 2020 10:22
Windows FFmpeg | Downmix stereo to mono audio in a video file
@echo off
:: Drag the video file onto this file to downmix
rem Extract stereo stream
ffmpeg -i "%~1" -vn -acodec copy "%~1.stereo.aac" -y
rem Downmix stereo to mono
ffmpeg -i "%~1.stereo.aac" -ac 1 "%~1.mono.aac" -y
@featherbear
featherbear / download.sh
Created October 26, 2020 13:22
Download Hugo version X
#!/bin/bash
pushd /tmp/ > /dev/null
curl -sL https://github.com/gohugoio/hugo/releases/download/v$1/hugo_$1_Linux-64bit.tar.gz | tar -zxf -
chmod +x hugo
mv hugo "hugo-$1"
popd > /dev/null
life360_username="---"
life360_password="---"
import requests
urlPrefix = "https://api.life360.com/v3/"
print("Authorising...")
auth = requests.post(urlPrefix + "oauth2/token.json",headers=dict(Authorization="Basic cFJFcXVnYWJSZXRyZTRFc3RldGhlcnVmcmVQdW1hbUV4dWNyRUh1YzptM2ZydXBSZXRSZXN3ZXJFQ2hBUHJFOTZxYWtFZHI0Vg=="), data=dict(grant_type="password",username=life360_username,password=life360_password))
assert auth.status_code ==200
@featherbear
featherbear / ydl.bat
Created February 17, 2021 12:16
youtube-dl script
@echo off
title youtube-dl %*
cd /d %USERPROFILE%\Downloads
youtube-dl --embed-thumbnail --extract-audio --audio-format mp3 -o "%%(title)s.%%(ext)s" %*
@featherbear
featherbear / gist:737cf59ba9f6fbbba0e0fb224a412dc2
Last active May 9, 2021 10:25
AliExpress GST Modifier (Australia)
// ==UserScript==
// @name GST in Australia
// @namespace http://tampermonkey.net/aliexpress-gst
// @version 0.1
// @description try to take over the world!
// @author You
// @match https://www.aliexpress.com/*
// @icon https://www.google.com/s2/favicons?domain=aliexpress.com
// @grant none
// ==/UserScript==