Skip to content

Instantly share code, notes, and snippets.

View iaincollins's full-sized avatar
🌶️

Iain Collins iaincollins

🌶️
View GitHub Profile
@bastman
bastman / docker-cleanup-resources.md
Created March 31, 2016 05:55
docker cleanup guide: containers, images, volumes, networks

Docker - How to cleanup (unused) resources

Once in a while, you may need to cleanup resources (containers, volumes, images, networks) ...

delete volumes

// see: https://github.com/chadoe/docker-cleanup-volumes

$ docker volume rm $(docker volume ls -qf dangling=true)

$ docker volume ls -qf dangling=true | xargs -r docker volume rm

@Rich-Harris
Rich-Harris / service-workers.md
Last active May 3, 2025 12:49
Stuff I wish I'd known sooner about service workers

Stuff I wish I'd known sooner about service workers

I recently had several days of extremely frustrating experiences with service workers. Here are a few things I've since learned which would have made my life much easier but which isn't particularly obvious from most of the blog posts and videos I've seen.

I'll add to this list over time – suggested additions welcome in the comments or via twitter.com/rich_harris.

Use Canary for development instead of Chrome stable

Chrome 51 has some pretty wild behaviour related to console.log in service workers. Canary doesn't, and it has a load of really good service worker related stuff in devtools.

@justjanne
justjanne / Price Breakdown.md
Last active April 5, 2025 08:10 — forked from kylemanna/price.txt
Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Server Price Breakdown: DigitalOcean, Amazon AWS LightSail, Vultr, Linode, OVH, Hetzner, Scaleway/Online.net:

Permalink: git.io/vps

$5/mo

Provider Type RAM Cores Storage Transfer Network Price
@toebbel
toebbel / install.sh
Created December 20, 2016 12:04
Install zeromq (zmq) library on fresh Amazon Linux (tested with amzn-ami-hvm-2016.03.3.x86_64-gp2)
# compilers
sudo yum install -y gcc gcc-c++
# libsodium: download, compile, install, remove intermediate files
curl https://download.libsodium.org/libsodium/releases/libsodium-1.0.10.tar.gz | tar -xz
cd libsodium-1.0.11
./configure && make && sudo make install
cd ../ && rm -rf libsodium-1.0.11
# zmq 4.2.0

WannaCry|WannaDecrypt0r NSA-Cyberweapon-Powered Ransomware Worm

  • Virus Name: WannaCrypt, WannaCry, WanaCrypt0r, WCrypt, WCRY
  • Vector: All Windows versions before Windows 10 are vulnerable if not patched for MS-17-010. It uses EternalBlue MS17-010 to propagate.
  • Ransom: between $300 to $600. There is code to 'rm' (delete) files in the virus. Seems to reset if the virus crashes.
  • Backdooring: The worm loops through every RDP session on a system to run the ransomware as that user. It also installs the DOUBLEPULSAR backdoor. It corrupts shadow volumes to make recovery harder. (source: malwarebytes)
  • Kill switch: If the website www.iuqerfsodp9ifjaposdfjhgosurijfaewrwergwea.com is up the virus exits instead of infecting the host. (source: malwarebytes). This domain has been sinkholed, stopping the spread of the worm. Will not work if proxied (source).

update: A minor variant of the viru

@hex13
hex13 / serializeSymbols.js
Created August 28, 2017 20:27
how to serialize symbols in JavaScript
const reserializer = (mapping) => {
const map = new Map();
Object.keys(mapping).forEach(k => map.set(mapping[k], k));
return {
serialize: value => map.get(value),
deserialize: value => mapping[value],
}
}
// application
@s-kris
s-kris / fauna-adapter.js
Last active September 14, 2024 01:22
faunadb adapter for next-auth for next.js
// followed from next-auth repo: https://github.com/nextauthjs/next-auth
// create faunadb server key
// create collections: users, accounts, sessions, verificationRequests
// create required indexes
import faunadb, { query as q } from 'faunadb';
import { v4 as uuidv4 } from 'uuid';
import { createHash, randomBytes } from 'crypto';
@iaincollins
iaincollins / Unity Cloud Save - How to find players using Queries.md
Last active September 24, 2024 19:33
Unity Cloud Save - How to find players using Queries

How to use Cloud Save to find players using Queries

This is an example of how to do you can find a player using data stored in Unity Cloud Save by using Indexes and Queries.

This is supported in Cloud Save SDK for Unity and the C# and JavaScript SDK for Unity Cloud Code.

1. Create Indexes for the keys you want to query on

Before saving data, first define an Index for the keys you want to query on (e.g. in the Unity Cloud Dashboard or using the Unity CLI) so that you can query on these keys in the next step.