This file contains 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
pathadd() { | |
# Add a bin to path if it isn't there already | |
if [ -d "$1" ] && [[ ":$PATH:" != *":$1:"* ]]; | |
then | |
if [ "$2" == "pre" ]; | |
then | |
PATH="$1:$PATH"; | |
else | |
PATH="${PATH:+"$PATH:"}$1"; | |
fi |
This file contains 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 | |
:: BatchGotAdmin | |
:------------------------------------- | |
REM --> Check for permissions | |
IF "%PROCESSOR_ARCHITECTURE%" EQU "amd64" ( | |
>nul 2>&1 "%SYSTEMROOT%\SysWOW64\cacls.exe" "%SYSTEMROOT%\SysWOW64\config\system" | |
) ELSE ( | |
>nul 2>&1 "%SYSTEMROOT%\system32\cacls.exe" "%SYSTEMROOT%\system32\config\system" | |
) |
This file contains 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 csv | |
with open('other_list.txt', 'r') as other_list: | |
sublist_something = other_list.readlines() | |
complete_list = {} | |
with open('master_list.txt', 'r') as master_list: | |
for account_id in master_list.readlines(): | |
complet_list[account_id] = {} | |
if account_id in sublist_something: |
This file contains 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
from base64 import b64decode | |
from defusedxml.lxml import fromstring | |
from signxml import xmldsig | |
class SAMLParser(object): | |
def __init__(self, rawresp): | |
self.b64 = rawresp |
This file contains 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
# Why cls_state... cls_state is a portable attrdict | |
class EncoreClsDict(dict): | |
"""This is an attrdict implementation that provides: | |
* property access for dict elements | |
* overrides for properties | |
* | |
* Override getitem, setitem, getattr, and setattr to provide the following behaviors: | |
@property decorators take precidence over dict items... and are always called. | |
@prop.setter decorators take precidence and can call self['key'] to set dict vals. | |
self.cls_properties['key'] to prevent key from being auto saved self['key'] |
This file contains 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
curl -iXPUT -H "X-Auth-Token: <REDACTED - valid customer auth token>" -H "Content-Type: application/json" https://monitoring.api.rackspacecloud.com/v1.0/500694/entities/enbm7RGWHg -d '{"label": "piranha01"}' | |
HTTP/1.1 400 Bad Request | |
Date: Fri, 25 Oct 2013 08:53:45 GMT | |
Content-Type: application/json; charset=UTF-8 | |
X-RateLimit-Limit: 50000 | |
X-RateLimit-Remaining: 49507 | |
X-RateLimit-Window: 24 hours | |
X-RateLimit-Type: global | |
X-Response-Id: .rh-pnCO.h-ord1-maas-prod-api1.r-gKVCgFlG.c-1488591.ts-1382691225421.v-ad1fc41 | |
X-LB: ord1-maas-prod-api1 |