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
#!/bin/sh | |
# This is probably better implemented in a real scripting language like powershell script or javascript but | |
# as a shell script to take minimal dependencies | |
###### Inputs - change these per your use case | |
# Go get Zone ID and account ID, log into the CF dashboard -> domain -> overview -> left column, bottom part | |
zone_identifier=000000000000000000000000000000 | |
# The record we want to update | |
dns_name=example.com |
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
#!/bin/sh | |
echo "Temperature ....: $(vcgencmd measure_temp | sed 's/.*=//')" | |
echo "Memory .........: $(free -h | grep Mem | awk '{print $4 " free out of " $2}')" | |
echo "Storage ........: $(df -H | grep "/$" | awk '{print $4 " free out of " $2}')" | |
echo "Uptime .........: $(uptime -p)" | |
echo "CPU Frequency ..: $(($(vcgencmd measure_clock arm | sed 's/^.*=//')/1000000)) MHz" |
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
#r "Newtonsoft.Json" | |
using System.Configuration; | |
using System.Net.Mail; | |
using System.Net.Mime; | |
using Newtonsoft.Json.Linq; | |
using Newtonsoft.Json; | |
private const string AppInsightsApi = "https://api.applicationinsights.io/beta/apps"; |
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
// Copyright (c) Microsoft Corporation. All rights reserved. | |
// | |
// Originally from CLR Security licensed by Microsoft under MIT License | |
// Modified by Crypteron under MIT License | |
// | |
// changelog | |
// - Make decrypt symmetrical with encrypt by keeping tag at the end | |
// of ciphertext. This oddity requires some buffer management | |
// but better to do internally here than expect all users to | |
// perform tricky buffer management themselves. |
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
------------------------------------------------ | |
-- Settings Start: Change these as needed | |
global gDest | |
set gDest to "/Volumes/MacPhotos/Pictures/ExportAlbums/" as POSIX file as text -- the destination folder (use a valid path) | |
global gLogFile | |
set gLogFile to gDest & "ExportAlbumToFolders.log" | |
global gKeywordOnSuccess | |
set gKeywordOnSuccess to "exported" |
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
Param( | |
[Version] $Version ="1.2.5678.6432" | |
) | |
# Usage as 'Get-BuildDateFromVersion.ps1 -Version 1.2.3.4' | |
# Intentionally written in verbose mode, line by line | |
# From https://msdn.microsoft.com/en-us/library/system.reflection.assemblyversionattribute.aspx and | |
# http://stackoverflow.com/questions/13943456/what-is-the-formula-in-net-for-wildcard-version-numbers | |
# Build = DateTime.Today.Subtract(new DateTime(2000, 1, 1)).Days; |
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
<# | |
.SYNOPSIS | |
Downloads a file | |
.DESCRIPTION | |
Downloads a file | |
.PARAMETER Url | |
URL to file/resource to download | |
.PARAMETER Filename | |
file to save it as locally | |
.EXAMPLE |
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
# Call this from inside a startup task/batch file as shown in the next two lines (minus the '# ') | |
# PowerShell -ExecutionPolicy Unrestricted .\HardenSsl.ps1 >> log-HardenSsl.txt 2>&1 | |
# EXIT /B 0 | |
# Credits: | |
# http://azure.microsoft.com/blog/2014/10/19/how-to-disable-ssl-3-0-in-azure-websites-roles-and-virtual-machines/ | |
# http://lukieb.blogspot.com/2014/11/tightening-up-your-azure-cloud-service.html | |
$nl = [Environment]::NewLine | |
$regkeys = @( |
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
public class Entropy | |
{ | |
private const long Prime = 179426549; | |
private const long Prime2 = 46633; // another prime | |
public static long GetEntropySeed() | |
{ | |
return Ticks ^ ProcessInfoKey() ^ MemorySizeKey() ^ EnvironmentKey(); | |
} |
NewerOlder