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
private static HealthState GetHealthState() | |
{ | |
// addresses is-a List<string> | |
var addresses = GetServers().SelectMany(s => s.IPs.Where(ip => ip.Type == "Backend").Select(ip => ip.Value)); | |
var totalAddresses = addresses.Count(); | |
var cancellationTokenSource = new CancellationTokenSource(); |
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
// see PowerShell Remoting on Python at https://www.bloggingforlogging.com/2018/08/14/powershell-remoting-on-python/ | |
// see https://github.com/jborean93/pypsrp | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
// NB you should add reference to C:\Program Files\Reference Assemblies\Microsoft\WindowsPowerShell\v1.0\System.Management.Automation.dll (this is installed by the Windows SDK). |
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
package main | |
import "net" | |
import "fmt" | |
import "reflect" | |
func main() { | |
interfaces, error := net.Interfaces() | |
if error != nil { | |
fmt.Printf("ERROR getting interfaces %s\n", error) |
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
# | |
# Copy this file into the user package directory (eg. to C:\Users\Rui Lopes\AppData\Roaming\Sublime Text 3\Packages\User). | |
# NB you can go into this directory by opening the Preferences | Browse Packages... menu. | |
# | |
# Add a shortcut to run this command by using sublime Preferences | Key Bindings - User: | |
# | |
# [ | |
# { | |
# "keys": ["ctrl+shift+x"], | |
# "command": "tidy_xml_lint" |
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
var http = require("http"); | |
var url = require("url"); | |
var pathHandlers = { | |
"/": function(request, response, uri) { | |
response.writeHead(200, {"Content-Type": "text/html"}); | |
response.write("<ul>\n"); | |
response.write("<li><a href='status?code=404'>status - 404</a></li>\n"); | |
response.write("<li><a href='status?code=500'>status - 500</a></li>\n"); | |
response.write("<li><a href='sleep?duration=5000'>sleep - 5s</a></li>\n"); |
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
using log4net; | |
using System; | |
using System.IO; | |
using System.Timers; | |
using System.Web.Hosting; | |
namespace Util | |
{ | |
public class AssetHelperJanitor | |
{ |
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
# | |
# Copy this file into the user package directory (eg. to C:\Users\Rui Lopes\AppData\Roaming\Sublime Text 3\Packages\User). | |
# NB you can go into this directory by opening the Preferences | Browse Packages... menu. | |
# | |
# Add a shortcut to run this command by using sublime Preferences | Key Bindings - User: | |
# | |
# [ | |
# { | |
# "keys": ["ctrl+shift+j"], | |
# "command": "format_json" |
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
# This lists the layers of a GIMP xcf file. This also exports the visible layers into a png file. | |
# | |
# Execute the commands: | |
# | |
# curl -O https://bitbucket.org/rgl/make_dmg/downloads/background.xcf | |
# gimp -idf --batch-interpreter=python-fu-eval -b - -b 'pdb.gimp_quit(0)' < gimp_xcf_list_layers.py | |
# | |
# See http://www.gimp.org/docs/python/ | |
# See http://gimpbook.com/scripting/ | |
# |
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
using OpenPop.Pop3; // from http://www.nuget.org/packages/OpenPop.NET/ | |
using System; | |
namespace PurgePop3Account | |
{ | |
class Program | |
{ | |
static void Main(string[] args) | |
{ | |
// use the pop3s scheme for SSL connection (recommended). |
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
package CheckJce; | |
import java.security.NoSuchAlgorithmException; | |
import javax.crypto.Cipher; | |
import javax.crypto.KeyGenerator; | |
import javax.crypto.SecretKey; | |
public class CheckJce { | |
public static void main(String[] args) throws Exception { | |
String message = "Java Cryptography Extension (JCE) Unlimited Strength is correctly installed!"; |