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
| AWSTemplateFormatVersion: 2010-09-09 | |
| Description: Cloudfront redirect lambda demo | |
| Parameters: | |
| FromDomain: | |
| Type: String | |
| Default: darin.dev-code.org | |
| Description: The domain you wish to redirect traffic from | |
| ToDomain: | |
| Type: String |
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
| AWSTemplateFormatVersion: 2010-09-09 | |
| Description: Cloudfront redirect lambda demo | |
| Parameters: | |
| FromDomain: | |
| Type: String | |
| Default: darin.dev-code.org | |
| Description: The domain you wish to redirect traffic from | |
| ToDomain: | |
| Type: String |
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
| # http://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/using-cfn-updating-stacks-changesets.html | |
| # create it | |
| aws cloudformation create-change-set \ | |
| --stack-name arn:aws:cloudformation:us-east-1:123456789012:stack/SampleStack/1a2345b6-0000-00a0-a123-00abc0abc000 | |
| --change-set-name SampleChangeSet \ | |
| --use-previous-template \ | |
| --parameters ParameterKey="InstanceType",UsePreviousValue=true ParameterKey="KeyPairName",UsePreviousValue=true ParameterKey="Purpose",ParameterValue="production" | |
| # view it |
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
| function getEndTime(DateTime $startDate, int $hoursRemaining) { | |
| $endDate = $startDate; | |
| # Can we finish it today? | |
| $hoursLeftInWorkday = $this->getHoursLeftInWorkday($startDate); | |
| if ($hoursRemaining < $hoursLeftInWorkday) { | |
| $endDate->modify('+' . $hoursRemaining . ' hours'); | |
| return $endDate; |
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
| # Ok, so this is cheating and actually checks for the most | |
| # recent time the Event Log service started, but 99% of | |
| # the time this'll do. | |
| $xml=@' | |
| <QueryList> | |
| <Query Id="0" Path="System"> | |
| <Select Path="System">*[System[(EventID=6005)]]</Select> | |
| </Query> | |
| </QueryList> |
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
| # download the bofh excuse list from http://pages.cs.wisc.edu/~ballard/bofh/excuses | |
| # save the list to ./bofh/bofh.txt with each excuse on a new line | |
| @botcmd | |
| def why(self, mess, arg): | |
| try: | |
| excuses = open('bofh/bofh.txt') | |
| self.send_simple_reply(mess, random.choice(excuses.readlines()).rstrip('\r\n')) | |
| except Exception, e: | |
| self.send_simple_reply(mess, "Sorry I can't think of a good excuse, or bofh/bofh.txt is missing.") |
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 json | |
| import os | |
| import glob | |
| from datetime import datetime | |
| appdata = os.getenv('APPDATA') | |
| fi = open(glob.glob(appdata + '/Mozilla/Firefox/Profiles/*.default/sessionstore-backups/recovery.js')[0], "r") | |
| jdata = json.loads(fi.read()) | |
| fi.close() |
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
| @echo off | |
| setlocal | |
| echo #################################################### | |
| echo # # | |
| echo # VIPRE Business Removal Tool v0.1 # | |
| echo # # | |
| echo # Last update: Nov. 17, 2014 # | |
| echo # Source Instructions: http://bit.ly/1qeyRtH # | |
| echo # # |
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
| @echo off | |
| REM Usage | |
| REM | |
| REM hostswap.bat <ip address> <hostname> | |
| REM This will add the given information to the hosts file, | |
| REM and save the original file to hosts.bak. | |
| REM | |
| REM hostswap.bat -revert | |
| REM This will swap hosts and hosts.bak. |