View docker-cleanup-resources.md

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
View RxJava.md

View Click

Instead of the verbose setOnClickListener:

RxView.clicks(submitButton).subscribe(o -> log("submit button clicked!"));

Filter even numbers

Observable
    .just(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)
View gist:1609781
ActiveRecord::ConnectionAdapters::ConnectionPool.class_eval do
def current_connection_id
# Thread.current.object_id
Thread.main.object_id
end
end
View 0001-add-HID-support-to-android-gadget.patch
From c5a7d1115318bd02145a4b41109464d564b37af9 Mon Sep 17 00:00:00 2001
From: David Weinstein <dweinst@insitusec.com>
Date: Mon, 14 Jan 2013 12:21:37 -0500
Subject: [PATCH] add HID support to android gadget.
---
drivers/usb/gadget/android.c | 189 ++++++++++++++++++++++++++++++++++++++++++
drivers/usb/gadget/f_hid.c | 8 +-
2 files changed, 194 insertions(+), 3 deletions(-)
View terraformer.go
package terraformer
import (
"bytes"
"errors"
"path"
"path/filepath"
"...runtime"
"...store"
View importtaxonomy.cql
//Import Google Product Taxonomy
//WITH IDENTIFIERS
//downloaded from https://support.google.com/merchants/answer/1705911
create index on :Cat1(name);
create index on :Cat2(name);
create index on :Cat3(name);
create index on :Cat4(name);
create index on :Cat5(name);
create index on :Cat6(name);
View Petya_ransomware.txt
#petya #petrWrap
Win32/Diskcoder.Petya.C
Ransomware attack.
Got new info? Email at isox@vulners.com
"it appeared to encrypt a selection of files (PDF and RTF) on two test machines prior to rebooting and encrypting parts of the MFT." - waiting for the details and PoC
*********** KILLSWITCH // PARTIAL? GOT PROOF - EMAIL!
View Makefile
SHELL = /bin/bash
WORKDIR = /vagrant
PSQL = sudo -u postgres psql
DBNAME = changeme
DBUSER = changeme_user
DBPASS = secret
db/console:
$(PSQL) $(DBNAME)
View customizer-image-sanitization.php
<?php
/**
* Sanitizes Image Upload.
*
* @param string $input potentially dangerous data.
*/
function themepatio_sanitize_image( $input ) {
$filetype = wp_check_filetype( $input );
if ( $filetype['ext'] && wp_ext2type( $filetype['ext'] ) === 'image' ) {
return esc_url( $input );
View pg-pong.py
""" Trains an agent with (stochastic) Policy Gradients on Pong. Uses OpenAI Gym. """
import numpy as np
import cPickle as pickle
import gym
# hyperparameters
H = 200 # number of hidden layer neurons
batch_size = 10 # every how many episodes to do a param update?
learning_rate = 1e-4
gamma = 0.99 # discount factor for reward