Skip to content

Instantly share code, notes, and snippets.

View cdrnet's full-sized avatar

Christoph Ruegg cdrnet

View GitHub Profile
@xbb
xbb / README
Last active April 17, 2024 20:21
IDRAC6 Virtual Console Launcher
Use this as an example on how to start the virtual console without the need of Java Web Start or accessing it from the web interface.
You can use the user and password that you use for the web interface.
You need an old JRE... I used 1.7.0_80 from the Server JRE package, also I have tested successfully 1.7.0_79 with MacOS.
You don't need to install it, just extract it or copy the files in "jre" folder.
Open the viewer.jnlp file that you get by launching the virtual console from the web interface with a text editor.
Note the urls to the jar files. Download the main jar file avctKVM.jar and the libs for your operating system and architecture.
Extract the dlls (.so Linux, .jnilib MacOS) from the jar libs.
@davidfowl
davidfowl / Example1.cs
Last active March 28, 2024 20:36
How .NET Standard relates to .NET Platforms
namespace Analogy
{
/// <summary>
/// This example shows that a library that needs access to target .NET Standard 1.3
/// can only access APIs available in that .NET Standard. Even though similar the APIs exist on .NET
/// Framework 4.5, it implements a version of .NET Standard that isn't compatible with the library.
/// </summary>INetCoreApp10
class Example1
{
public void Net45Application(INetFramework45 platform)
@alirobe
alirobe / reclaimWindows10.ps1
Last active April 26, 2024 17:59
This Windows 10 Setup Script turns off a bunch of unnecessary Windows 10 telemetery, bloatware, & privacy things. Not guaranteed to catch everything. Review and tweak before running. Reboot after running. Scripts for reversing are included and commented. Fork of https://github.com/Disassembler0/Win10-Initial-Setup-Script (different defaults). N.…
###
###
### UPDATE: For Win 11, I recommend using this tool in place of this script:
### https://christitus.com/windows-tool/
### https://github.com/ChrisTitusTech/winutil
### https://www.youtube.com/watch?v=6UQZ5oQg8XA
### iwr -useb https://christitus.com/win | iex
###
###
@kjnilsson
kjnilsson / handy.fs
Last active April 6, 2018 17:49
my current favourite handy fsharp helpers
//invaluable for all those Choice<'a, exn> flows
let exnf f = Printf.ksprintf (fun s -> exn s) f
//combine paths
let (</>) x y = System.IO.Path.Combine(x, y)
//allows you to pattern match on values in the current scope rather than just literals
let (|Eq|_|) expected value =
if expected = value then Some ()
else None
@AArnott
AArnott / NuGetPackageSources.ps1
Last active December 30, 2023 18:46
PowerShell cmdlets for publishing NuGet packages in a fast directory structure, and upgrading from an old flat directory listing of nupkg's to the faster one.
Function Create-NuPkgSha512File {
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true,Position=1)]
[string]$Path,
[Parameter()]
[string]$Sha512Path="$Path.sha512"
)
$sha512 = [Security.Cryptography.SHA512]::Create()
@TWith2Sugars
TWith2Sugars / build.fsx
Last active January 28, 2016 14:44
Conform all fsproj
#r @"packages/Paket.Core/lib/net45/Paket.Core.dll"
open Paket
open Paket.Xml
open System.Xml
let setProjectAttribute attribute innerText (propertyGroup:Xml.XmlNode) =
let nodes = propertyGroup.ChildNodes |> Seq.cast<XmlNode> |> Seq.filter(fun node -> node.Name = attribute )
nodes |> Seq.iter(propertyGroup.RemoveChild >> ignore)
let attribute = propertyGroup.OwnerDocument.CreateElement(attribute, Constants.ProjectDefaultNameSpace)
@dsyme
dsyme / gist:9b18608b78dccf92ba33
Last active November 1, 2022 18:11
Working self-contained getting-started sample for Suave Web Scripting
//==========================================
// Working fully self-contained getting-started example for Suave Web Server scripting
//
// Note you don't need to have _anything_ installed before starting with this script. Nothing
// but F# Interactive and this script.
//
// This script fetches the Paket.exe component which is referenced later in the script.
// Initially the #r "paket.exe" reference is shown as unresolved. Once it has been
// downloaded by the user (by executing the first part of the script) the reference
// shows as resolved and can be used.
@ctaggart
ctaggart / 3.0 to 3.1.fsi
Created December 27, 2014 02:13
FSharp.Core Surface Area Diff (what is new)
[<AutoOpen>]
module Microsoft.FSharp.Reflection.FSharpReflectionExtensions
/// Creates an instance of a record type.
val MakeRecord : recordType:Type * values:obj [] * ?allowAccessToPrivateRepresentation:bool -> obj
/// Reads all the fields from a record value.
val GetRecordFields : record:obj * ?allowAccessToPrivateRepresentation:bool -> obj []
/// Precompute a function for reading all the fields from a record. The fields are returned in the
// Original code: https://gist.github.com/taumuon/11302896
// This implementation optimized by Jack Pappas (https://github.com/jack-pappas)
open MathNet.Numerics.Distributions
open MathNet.Numerics.Statistics
open MathNet.Numerics.Random
open LanguagePrimitives
let inline callPayoff strike price =
max (price - strike) GenericZero
namespace Tsunami.Server
open System
open System.IO
open System.Linq
open System.Net
open System.Net.Sockets
open System.Text
open System.Threading
open System.Runtime.Serialization