Skip to content

Instantly share code, notes, and snippets.

@patrickhuber
patrickhuber / Person.java
Last active August 29, 2015 14:05
Java Property Class
package com.props.tests;
import java.util.Date;
import com.props.*;
public class Person {
public final Property<Integer> id = new Property<Integer>();
public final Property<String> firstName = new Property<String>();
public final Property<String> lastName = new Property<String>();
public final Property<Date> dateOfBirth = new Property<Date>();
}
@patrickhuber
patrickhuber / Clear-Tfscache.ps1
Created November 18, 2015 14:48 — forked from anonymous/Clear-Tfscache.ps1
clears the tfs cache for visual studio
$ErrorActionPreference = "Stop"
$directory = [io.path]::combine($env:LOCALAPPDATA, "microsoft", "team foundation")
foreach($versionDirectory in get-childitem $directory)
{
$cacheDirectory = Join-Path $versionDirectory.FullName "Cache"
$items = Get-ChildItem $cacheDirectory
foreach($item in $items)
{
Remove-Item -Recurse -Force $item.FullName
}
$variables =
[Environment]::GetEnvironmentVariable("Path", [System.EnvironmentVariableTarget]::Machine) -split ';' |
foreach { $_.Trim().TrimEnd('\\') } |
group |
select -ExpandProperty Name |
where { -not [string]::IsNullOrWhitespace($_) }
$path = $variables -join ';'
[Environment]::SetEnvironmentVariable("PATH", $path, [System.EnvironmentVariableTarget]::Machine)
@patrickhuber
patrickhuber / Configure DCOS 1.8 for Centos 7.3
Last active January 18, 2017 15:27
configure dcos 1.8 for centos 7.3
@patrickhuber
patrickhuber / Configure DCOS 1.8 for RHEL 7.2
Created January 24, 2017 22:45
Installing DCOS 1.8 on RHEL 7
for title
@patrickhuber
patrickhuber / etcd.md
Last active April 4, 2017 20:23
installing kubernetes centos 7

Running By Hand

etcd --name infra0 \
  --initial-advertise-peer-urls http://192.168.1.101:2380 \
  --listen-peer-urls http://192.168.1.101:2380 \
  --listen-client-urls http://192.168.1.101:2379,http://127.0.0.1:2379 \
  --advertise-client-urls http://192.168.1.101:2379 \
  --initial-cluster-token huber-cluster \
  --initial-cluster infra0=http://192.168.1.101:2380,infra1=http://192.168.1.102:2380,infra2=http://192.168.1.103:2380 \

Install Consule 0.8.0 on centos 7

update yum and install wget,unzip,dig

yum update -y
yum install wget uzip bind-utils -y

create directories

# setup
Set-ExecutionPolicy AllSigned
# install chocolatey
iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
# install packages
choco install firefox -y
choco install filezilla -y
choco install javaruntime -y
@patrickhuber
patrickhuber / gll_shift.py
Created November 16, 2017 17:33 — forked from cheery/gll_shift.py
GLL Recognizer
class Cell(object):
def __init__(self, L):
self.L = L
self.edges = set()
self.redus = set()
class Chart(object):
def __init__(self):
self.cont = []
self.visit = set()
@patrickhuber
patrickhuber / download-file.ps1
Created June 26, 2018 15:31
download file powershell
$ErrorActionPreference = "Stop"
function Invoke-DownloadFileCore{
param(
[string]$url,
[string]$output,
[bool]$skipTlsValidation,
[X509Certificate]$certificate)
$code = @'
using System;