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
== Prepare Debian Wheezy for LXC == | |
Install lxc and some utils. | |
apt-get install lxc bridge-utils libvirt-bin debootstrap | |
Add a cgroup filesystem that will be mounted at boot. Edit /etc/fstab and add: | |
cgroup /cgroup cgroup defaults 0 0 |
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
#!/bin/bash | |
# | |
# Modified from here: | |
# http://misc.flogisoft.com/bash/tip_colors_and_formatting | |
# | |
color16() | |
{ | |
#Foreground | |
for clfg in {30..37} {90..97} 39 ; do |
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
#!/usr/bin/env python | |
import requests | |
import json | |
from requests.auth import HTTPBasicAuth | |
import sys | |
import StringIO | |
import csv | |
from getpass import getpass | |
# Set this from the app in github.com |
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
param( | |
[Parameter(Mandatory=$true)] | |
[string] | |
$AdminPassword | |
) | |
Set-StrictMode -Version Latest | |
Set-ExecutionPolicy -executionpolicy remotesigned -force | |
$pstoolsUrl="https://download.sysinternals.com/files/PSTools.zip" | |
echo "Set Password" | |
net user Administrator $AdminPassword |
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
<powershellArguments>-ExecutionPolicy unrestricted</powershellArguments> | |
<powershell> | |
$command = @" | |
winrm quickconfig -quiet; | |
winrm set winrm/config/winrs '@{MaxMemoryPerShellMB="1024"}'; | |
winrm set winrm/config '@{MaxTimeoutms="1800000"}'; | |
winrm set winrm/config/service/auth '@{Basic="true"}'; | |
winrm set winrm/config/service '@{AllowUnencrypted="true"}'; | |
net stop winrm; | |
sc config winrm start= auto; |
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
''' | |
Configure profiler via Apache's SetEvn directive | |
''' | |
class Profiler(object): | |
''' | |
Simple wrapper around werkzeug's ProfilerMiddleware. This allow enabling | |
the profile via apache's SetEnv directive: |
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
#!/usr/bin/python3 | |
# simple_udp_client.py | |
import socket | |
UDP_IP = "127.0.0.1" | |
UDP_PORT = 5005 | |
MESSAGE = "Hello, World!" |
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
#!/usr/bin/env python3 | |
# simple_tcp_client.py | |
import socket | |
TCP_IP = '127.0.0.1' | |
TCP_PORT = 5005 | |
BUFFER_SIZE = 1024 |
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
class TzMapper(object): | |
def __init__(self, u_to_w): | |
self.u_to_w = {(k.lower(),v) for k,v in u_to_w} | |
self.w_to_u = {(v.lower(), k) for k,v in u_to_w} | |
def add(self, k, v): | |
self.u_to_w[k.lower()] = v | |
self.w_to_u[v.lower()] = k | |
def remove(self, k): |
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 Build-M2 { | |
Param( | |
[parameter(Mandatory=$true)] | |
[String] | |
$PythonExe | |
) | |
if ( -not (Get-Command choco -errorAction SilentlyContinue )) { | |
Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) |
OlderNewer