Skip to content

Instantly share code, notes, and snippets.

View iaincollins's full-sized avatar
:shipit:

Iain Collins iaincollins

:shipit:
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

@digitaljhelms
digitaljhelms / gist:4287848
Last active April 26, 2024 10:44
Git/GitHub branching standards & conventions

Branching

Quick Legend

Description, Instructions, Notes
Instance Branch
@Rich-Harris
Rich-Harris / service-workers.md
Last active April 21, 2024 16:24
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 11, 2024 22:21 — 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

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

@jlong
jlong / uri.js
Created April 20, 2012 13:29
URI Parsing with Javascript
var parser = document.createElement('a');
parser.href = "http://example.com:3000/pathname/?search=test#hash";
parser.protocol; // => "http:"
parser.hostname; // => "example.com"
parser.port; // => "3000"
parser.pathname; // => "/pathname/"
parser.search; // => "?search=test"
parser.hash; // => "#hash"
parser.host; // => "example.com:3000"
@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
@mikeabiezzi
mikeabiezzi / Rakefile
Created June 25, 2012 00:44
Patch to Resque that stops workers from picking up a new job when Resque is "paused"
task "resque:pause" => :environment do
Resque.redis.set "resque_paused", true
puts "Resque paused."
end
task "resque:resume" => :environment do
Resque.redis.set "resque_paused", false
puts "Resque resumed."
end
@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
@jpalala
jpalala / how-to-setup-mac-elasticsearch.md
Created September 11, 2015 08:28
setting up elasticsearch on your mac with brew

Install va homebrew

If you don't have homebrew installed - get homebrew here

Then run: brew install elasticsearch

Configuration

Update the elasticsearch configuration file in /usr/local/etc/elasticsearch/elasticsearch.yml.