This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import inspect, sys | |
| from django.contrib import admin | |
| def register_all_models(module): | |
| for name, obj in inspect.getmembers(sys.modules[module]): | |
| if inspect.isclass(obj) and obj.__name__ is not "User": | |
| if hasattr(obj, "_meta") and not obj._meta.abstract: | |
| admin.site.register(obj) | |
| register_all_models("<appname_here>.models") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Great for when Ubuntu Server decides to lock you out because /boot is full of old kernels | |
| # Credit: Somebody on Stackoverflow | |
| #!/usr/bin/env python2 | |
| # See: http://askubuntu.com/questions/345588/what-is-the-safest-way-to-clean-up-boot-partition#answer-430944 | |
| import re | |
| import sys | |
| import subprocess |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Not my original work -- all thanks to the Stackoverflow Gods | |
| #!/bin/bash | |
| # remove stopped containers | |
| docker rm $(docker ps -a -q) | |
| # remove dangling images | |
| docker rmi $(docker images -q --filter "dangling=true") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| sudo osascript -e 'repeat 2 times | |
| repeat 16 times | |
| tell application "System Events" | |
| key code 107 | |
| delay 0.1 | |
| end | |
| end repeat | |
| delay 0.5 | |
| repeat 16 times | |
| tell application "System Events" |
NewerOlder