I hereby claim:
- I am artschwagerb on github.
- I am artschwagerb (https://keybase.io/artschwagerb) on keybase.
- I have a public key ASAkoWhW5kPQRIhRGS1m6bKMSolDCk13wC_Bh9Ss9hKk3Qo
To claim this, I am signing this object:
I hereby claim:
To claim this, I am signing this object:
# Use shortcode to find latest TechNet download site | |
$confirmationPage = 'http://www.microsoft.com/en-us/download/' + $((invoke-webrequest 'http://aka.ms/wmf5latest' -UseBasicParsing).links | ? Class -eq 'mscom-link download-button dl' | % href) | |
# Parse confirmation page and look for URL to file | |
$directURL = (invoke-webrequest $confirmationPage -UseBasicParsing).Links | ? Class -eq 'mscom-link' | ? href -match 'Win8.1AndW2K12R2-KB3134758-x64.msu' | % href | select -first 1 | |
# Download file to local | |
$download = invoke-webrequest $directURL -OutFile $env:Temp\wmf5latest.msu | |
# Install quietly with no reboot | |
if (test-path $env:Temp\wmf5latest.msu) { | |
start -wait $env:Temp\wmf5latest.msu -argumentlist '/quiet /norestart' | |
} |
import logging | |
# Standard instance of a logger with __name__ | |
logger = logging.getLogger(__name__) | |
# choose your own adventure | |
logger.info('message goes here') | |
logger.debug('message goes here') | |
logger.warning('message goes here') | |
logger.exception('message goes here') |
from logging.handlers import SysLogHandler | |
LOGGING = { | |
'version': 1, | |
'disable_existing_loggers': True, | |
'formatters': { | |
'standard': { | |
'format' : "[YOUR PROJECT NAME] [%(asctime)s] %(levelname)s [%(name)s:%(lineno)s] %(message)s", | |
'datefmt' : "%d/%b/%Y %H:%M:%S" | |
}, | |
'verbose': { |
<!DOCTYPE html> | |
<html> | |
<head> | |
<meta charset=utf-8 /> | |
<title>JS Bin</title> | |
</head> | |
<body> | |
<form> | |
Enter URL to load: <input type="text" id="url" /> | |
<input type="button" value="Load URL" onclick="loadUrl()" /> |
from django.shortcuts import render_to_response, get_object_or_404, render | |
from django.template import RequestContext, loader, Template | |
from myapp.models import Model_name | |
# Template from app directory (lumber), passing in "data" | |
doc_template = loader.get_template('lumber/%s/result.txt' % ("my_label")) | |
doc_context = RequestContext(request, { | |
'data': result['source'], | |
}) | |
doc_html = doc_template.render(doc_context) |
--- | |
- hosts: django_app_servers | |
serial: 1 | |
remote_user: admin | |
sudo: yes | |
tasks: | |
- name: Send Maintenance Mode Command to HaProxy | |
shell: curl --data "s={{inventory_hostname}}&b=#12&action=drain" http://user:[email protected]:8080/haproxy?stats |
### USAGE | |
### | |
### ./ElasticSearch.sh 1.5.0 will install Elasticsearch 1.5.0 | |
### ./ElasticSearch.sh 1.4.4 will install Elasticsearch 1.4.4 | |
### ./ElasticSearch.sh will fail because no version was specified (exit code 1) | |
### | |
### CLI options Contributed by @janpieper | |
### Check http://www.elasticsearch.org/download/ for latest version of ElasticSearch | |
### ElasticSearch version |
$cred = Get-Credential #Read credentials | |
$username = $cred.username | |
$password = $cred.GetNetworkCredential().password | |
# Get current domain using logged-on user's credentials | |
$CurrentDomain = "LDAP://hillsborough.k12.nj.us" | |
$domain = New-Object System.DirectoryServices.DirectoryEntry($CurrentDomain,$UserName,$Password) | |
if ($domain.name -eq $null) | |
{ |