Skip to content

Instantly share code, notes, and snippets.

View xkdcc's full-sized avatar

geekcoding101 xkdcc

View GitHub Profile
@xkdcc
xkdcc / linkedlist.py
Created July 6, 2018 21:08 — forked from addie/linkedlist.py
Python linked list
class Node(object):
def __init__(self, data=None):
self.data = data
self.next = None
def __repr__(self):
return str(self.data)
class SinglyLinkedList(object):
def __init__(self, iterable=[]):
# -*- coding: utf-8 -*-
"""
Based on:
https://gist.github.com/meeuw/c3bc9dd07945c87c89e6#file-findfiles-py
https://bitbucket.org/nosklo/pysmbclient/wiki/Home
"""
import os
import pexpect
import re
@xkdcc
xkdcc / docker-prune.sh
Created January 25, 2022 08:13 — forked from sethbergman/docker-prune.sh
Prune stale Docker containers, images & volumes (Bash) (versions < 1.13.0)
#!/usr/bin/env bash
stale_images=`docker images --no-trunc --quiet --filter "dangling=true"`
stale_containers=`docker ps --no-trunc --quiet --filter "status=exited"`
stale_volumes=`docker volume ls --quiet --filter "dangling=true"`
stale_images_count=`echo "$stale_images" | sed '/^\s*$/d' | wc -l | xargs`
stale_containers_count=`echo "$stale_containers" | sed '/^\s*$/d' | wc -l | xargs`
stale_volumes_count=`echo "$stale_volumes" | sed '/^\s*$/d' | wc -l | xargs`
echo "Removing stale containers..."