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
# Usage: | |
# fetch git fetch https://git/someuser/somerepo.git somebranch | |
# will execute instead: | |
# git fetch git@git:someuser/somerepo.git somebranch | |
function fetch() { | |
local old_url="$*" | |
new_url=$(sed 's#https://git/#git@git:#g' <<< $old_url) | |
$new_url | sh | |
} |
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
// include Fake lib | |
#r @"FAKE/tools/FakeLib.dll" | |
open Fake | |
open System | |
open System.IO | |
// param names | |
let sourceEnvParam = "sourceEnv" | |
let destinationDirParam = "destinationDir" |
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
namespace Muffin.Pictures.Archiver | |
open System | |
module Picture = | |
type IsOldDefinition = DateTimeOffset -> bool | |
type TimeTakenRetriever = string -> DateTimeOffset | |
type PathExistenceChecker = string -> bool |
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
// multiple param function | |
let multiply x y = | |
x * y | |
// reducing to 1 arg function calls | |
let multiplyBy2 = multiply 2 | |
let result = multiplyBy2 4 |
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
#Requires -version 2.0 | |
Register-WmiEvent -Class win32_VolumeChangeEvent -SourceIdentifier volumeChange | |
write-host (get-date -format s) " Beginning script..." | |
$DrivesCount = (gwmi -Query "Select * from Win32_LogicalDisk").Count | |
$Drives = (gwmi -Query "Select * from Win32_LogicalDisk") | |
do{ | |
$newEvent = Wait-Event -SourceIdentifier volumeChange | |
$eventType = $newEvent.SourceEventArgs.NewEvent.EventType | |
$eventTypeName = switch($eventType) |
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
; watch out this is unencrypted! | |
proxy=http://username:password@proxyurl:proxyport | |
https-proxy=http://username:password@proxyurl:proxyport | |
strict-ssl=false |
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
function Update-AppSettings($resourceGroup, $site, $slot, $inputFile) | |
{ | |
$webApp = Get-AzureRMWebAppSlot -ResourceGroupName $resourceGroup -Name $site -Slot $slot | |
$appSettingList = $webApp.SiteConfig.AppSettings | |
$hash = @{} | |
ForEach ($kvp in $appSettingList) { | |
$hash[$kvp.Name] = $kvp.Value | |
} |
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
env=~/.ssh/agent.env | |
agent_load_env () { test -f "$env" && . "$env" >| /dev/null ; } | |
agent_start () { | |
(umask 077; ssh-agent >| "$env") | |
. "$env" >| /dev/null ; } | |
agent_load_env | |
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
#!/usr/bin/env bash | |
# install docker | |
# https://docs.docker.com/engine/installation/linux/ubuntulinux/ | |
# install docker-compose | |
# https://docs.docker.com/compose/install/ | |
# install letsencrypt | |
# https://www.digitalocean.com/community/tutorials/how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-16-04 |
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
for f in $(find $1 -iname "*.wsp"); do | |
if [ -a $f ]; | |
then /opt/graphite/bin/whisper-set-aggregation-method.py $f max; | |
fi; | |
done |
OlderNewer