Philip Thrasher
Web hacker at a private cyber security company.
| #! /bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: supervisord | |
| # Required-Start: $remote_fs | |
| # Required-Stop: $remote_fs | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: Example initscript | |
| # Description: This file should be used to construct scripts to be | |
| # placed in /etc/init.d. |
| #!/bin/sh | |
| ### BEGIN INIT INFO | |
| # Provides: gunicorn | |
| # Required-Start: $all | |
| # Required-Stop: $all | |
| # Default-Start: 2 3 4 5 | |
| # Default-Stop: 0 1 6 | |
| # Short-Description: starts the gunicorn server | |
| # Description: starts gunicorn using start-stop-daemon |
| param( [ScriptBlock] $scriptBlock ) | |
| <# | |
| .SYNOPSIS | |
| Impersonates a user and executes a script block as that user. This is an interactive script | |
| and a window will open in order to securely capture credentials. | |
| .EXAMPLE | |
| Use-Impersonation.ps1 {Get-ChildItem 'C:\' | Foreach { Write-Host $_.Name }} | |
| This writes the contents of 'C:\' impersonating the user that is entered. | |
| #> | |
| import time | |
| import datetime | |
| class rate_limited(object): | |
| def __init__(self, max_calls, time_interval): | |
| assert max_calls > 0 | |
| assert time_interval > 0 | |
| self.__last_reset = None | |
| self.__max_calls = max_calls | |
| self.__time_interval = time_interval # seconds |
| # -*- coding: utf-8 | |
| """\ | |
| A simple demo of logging configuration with YAML (Python 2.7) | |
| ============================================================= | |
| Requires PyYAML -> "easy_install PyYAML" | |
| See the recipes for configuring logging with dicts and YAML | |
| - http://docs.python.org/2.7/howto/logging-cookbook.html | |
| - http://stackoverflow.com/questions/10519392/python2-7-logging-configuration-with-yaml |
| sudo find /private/var/folders/ -name com.apple.dock.iconcache -exec rm {} \; |
| #!/bin/bash | |
| ## Email Variables | |
| EMAILDATE=`date --date="today" +%y-%m-%d` | |
| EMAIL="[email protected]" | |
| SUBJECT="[servername] Backup Script Started! - "$EMAILDATE | |
| EMAILMESSAGE="/tmp/emailmessage1.txt" | |
| echo "Just to let you know that the backup script has started."> $EMAILMESSAGE | |
| /bin/mail -s "$SUBJECT" "$EMAIL" < $EMAILMESSAGE |
| packages: | |
| yum: | |
| gcc-c++: [] | |
| make: [] | |
| sources: | |
| /home/ec2-user: http://download.redis.io/releases/redis-2.8.4.tar.gz | |
| commands: | |
| redis_build: | |
| command: make | |
| cwd: /home/ec2-user/redis-2.8.4 |