Skip to content

Instantly share code, notes, and snippets.

bastman /
Created Mar 31, 2016
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:

$ docker volume rm $(docker volume ls -qf dangling=true)
$ docker volume ls -qf dangling=true | xargs -r docker volume rm
pvdb / process_rss.rb
Last active Mar 10, 2021
Get real memory (resident set) used by current Ruby process
View process_rss.rb
# This first version should work on Mac OS X and Linux, but it spawns a process
# the real memory (resident set) size of the process (in 1_024 byte units).
def Process.rss() `ps -o rss= -p #{}`.chomp.to_i ; end
jimothyGator / sidekiq.rake
Last active Aug 9, 2016
Strano init.d script and Rake task. Runs Strano with Puma. Adapted from init.d script for Gitlab.
View sidekiq.rake
# place in lib/tasks/
namespace :sidekiq do
desc "Strano | Stop sidekiq"
task :stop do
system "bundle exec sidekiqctl stop #{pidfile}"
desc "Strano | Start sidekiq"
task :start do
View gjs-io-sample.js
const GLib =;
const Gio =;
let [res, out, err, status] = GLib.spawn_command_line_sync('ls -la');
let [res, out] = GLib.spawn_command_line_sync('ls -la');
let [res, out] = GLib.spawn_sync(null, ['/bin/ls', '-la'], null, 0, null);
huyng /
Created Feb 7, 2011
A simple echo server to inspect http web requests
#!/usr/bin/env python
# Reflects the requests from HTTP methods GET, POST, PUT, and DELETE
# Written by Nathan Hamiel (2010)
from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
from optparse import OptionParser
class RequestHandler(BaseHTTPRequestHandler):
def do_GET(self):
henrik / hash_deep_diff.rb
Created Jul 14, 2009
Recursively diff two Ruby hashes.
View hash_deep_diff.rb
# Recursively diff two hashes, showing only the differing values.
# By Henrik Nyh <> 2009-07-14 under the MIT license.
# Example:
# a = {
# "same" => "same",
# "diff" => "a",
# "only a" => "a",
# "nest" => {