Skip to content

Instantly share code, notes, and snippets.

View tankbusta's full-sized avatar

Christopher Schmitt tankbusta

  • Colorado
  • 14:16 (UTC -06:00)
View GitHub Profile
@tankbusta
tankbusta / docker-cleanup-resources.md
Created September 20, 2017 05:38 — forked from bastman/docker-cleanup-resources.md
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

==3109== Memcheck, a memory error detector
==3109== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al.
==3109== Using Valgrind-3.10.1 and LibVEX; rerun with -h for copyright info
==3109== Command: ./hashcat --status --status-timer=1 --attack-mode=0 --opencl-device-types=2 --opencl-devices=3,4 --rules-file=<RULE FILE WITH 145 RULES> --hash-type=13100 <2 UNIQUE 13100 HASHES.txt> <800 MB dict>
==3109== Parent PID: 2669
==3109==
==3109== Warning: noted but unhandled ioctl 0x30000001 with no size/direction hints.
==3109== This could cause spurious value errors to appear.
==3109== See README_MISSING_SYSCALL_OR_IOCTL for guidance on writing a proper wrapper.
==3109== Warning: noted but unhandled ioctl 0x27 with no size/direction hints.

Keybase proof

I hereby claim:

  • I am tankbusta on github.
  • I am tankbusta (https://keybase.io/tankbusta) on keybase.
  • I have a public key whose fingerprint is 26F3 7665 0EB0 4792 8E44 3696 69F9 6DF0 1A75 C250

To claim this, I am signing this object:

>>> def addthings(a: int, b: int) -> int:
... return a+b
...
>>> addthings(2, 2)
4
>>> addthings('mindblown', 2)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "<stdin>", line 2, in addthings
TypeError: Can't convert 'int' object to str implicitly
>>> for blah in ('apples', 'oranges', 'grapes'):
... print(blah)
... else: #should be finally in my opinion
... print('done iterating')
...
apples
oranges
grapes
done iterating
>>>
class SuperCoolObject(object):
def __init__(self, *args, **kwargs):
self.me = self
self.herro = 'world'
class testing(SuperCoolObject):
def __init__(Self, *args, **kwargs):
super(testing, self).__init__(*args, **kwargs)
self.hello = 'world'
print(self.me) # >> <SuperCoolObject @13337>
import ctypes
from ctypes.util import find_library
libc = ctypes.cdll.LoadLibrary(find_library("c"))
CTL_KERN = 1
KERN_PROC = 14
KERN_PROC_ALL = 0
class proc(ctypes.Structure):
PUT /test/
{
"mappings": {
"test": {
"properties": {
"test_dynmap": {
"type": "object",
"dynamic_templates": [
{
"nested_src_id": {

socket._fileobject schenanigans

Let's say you're uploading a file with a length of 113914 bytes at a default chunk size of 8192. On the last .read() it'll block on data = self._sock.recv(left) inside socket.py because 113914 - 106496 equals 7418 which is less than the block size of 8192. It'll only release when the additional 774 bytes come in. (Hint™ they wont be coming)

The .read() method inside socket.py should, in my opinion operate like the working example shown below where left is calculated by .tell() (total content length of the socket) minus the size left in the buffer. If that is less than the size specified in .read() use that as left.

Related

#!/usr/bin/ruby
require 'rubygems'
require 'active_record'
require './lib/kernel_logger'
require './models/indicator'
require 'ffi-rzmq'
require 'bson'
ctx = ZMQ::Context.new