Skip to content

Instantly share code, notes, and snippets.

@Piskvor
Piskvor / extract_cookies.sh
Created November 9, 2022 14:27 — forked from hackerb9/extract_cookies.sh
Extract cookies.sqlite to cookies.txt for use in wget or curl.
#!/bin/bash -e
# extract_cookies.sh:
#
# Convert from Firefox's cookies.sqlite format to Netscape cookies,
# which can then be used by wget and curl. (Why don't wget and curl
# just use libsqlite if it's installed?)
# USAGE:
#
# $ extract_cookies.sh > /tmp/cookies.txt
@Piskvor
Piskvor / nearby-coordinates.sql
Created November 4, 2022 07:39 — forked from statickidz/nearby-coordinates.sql
Ordering with SQL by nearest latitude & longitude coordinates (MySQL & SQLite)
---
METHOD 1
This should roughly sort the items on distance in MySQL, and should work in SQLite.
If you need to sort them preciser, you could try using the Pythagorean theorem (a^2 + b^2 = c^2) to get the exact distance.
---
SELECT *
FROM table
ORDER BY ((lat-$user_lat)*(lat-$user_lat)) + ((lng - $user_lng)*(lng - $user_lng)) ASC
@Piskvor
Piskvor / init.sh
Created October 24, 2022 14:16 — forked from m13253/init.sh
Minimal working initramfs for BusyBox, with login
#!/bin/busybox sh
# 1) Download a prebuilt BusyBox binary here:
# https://busybox.net/downloads/binaries/
#
# 2) Prepare your kernel
# cp /boot/vmlinuz vmlinuz
#
# 3) Copy the files
# install -Dm0755 busybox-x86_64 initramfs/bin/busybox
@Piskvor
Piskvor / blink_ip.pl
Created February 19, 2019 13:36 — forked from chrismeyersfsu/blink_ip.pl
Raspberry Pi Blink Ip Address
@Piskvor
Piskvor / RPi-install-wifi.sh
Created March 6, 2018 23:14 — forked from kmonsoor/RPi-install-wifi.sh
install wifi adapter drivers on Raspberry Pi; origin: http://www.fars-robotics.net/install-wifi
#!/bin/bash
#set -e
# origin-source: http://www.fars-robotics.net/install-wifi
# install-wifi - v9.4 - by MrEngman.
# After downloading this script:
# $ sudo mv ./install-wifi /usr/bin/install-wifi
# $ sudo chmod +x /usr/bin/install-wifi
# $ sudo install-wifi -h
#
@Piskvor
Piskvor / experiments_lines_drag.user.js
Last active December 30, 2016 09:34 — forked from spite/gist:90e3dbf8e117660f6788a5748ae06cad
Go to https://lines.chromeexperiments.com/drag/, start the experience and run this code in the console - or install it as a userscript.
// ==UserScript==
// @name Animate the Lines WebGL experiment automatically
// @namespace https://gist.github.com/spite/90e3dbf8e117660f6788a5748ae06cad
// @version 0.2
// @description Automatically drags the mouse, leading to a pleasant effect
// @author spite, userscripted by Piskvor
// @match https://lines.chromeexperiments.com/drag/
// @grant none
// @updateURL https://gist.github.com/Piskvor/41df1f68b44b43100552126c76e2f609/raw/experiments_lines_drag.user.js
// ==/UserScript==