Skip to content

Instantly share code, notes, and snippets.

View minidfx's full-sized avatar
🏠
Working from home

Burgy Benjamin minidfx

🏠
Working from home
View GitHub Profile
@minidfx
minidfx / mermaid-example.md
Last active May 17, 2024 05:58
Mermaid examples
graph TD;
    A-->B;
    A-->C;
    B-->D;
    C-->D;
@minidfx
minidfx / plexDownloadRequest.ex
Last active December 14, 2017 21:14
Contains modules for downloading medias from a friend plex server.
defmodule Plex.PlexDownloadRequest do
@doc """
Model representing the request which will send to the downloader.
"""
defstruct [:host, :port, :media_id, :plex_token, :callback_server_id]
@type t :: %__MODULE__{host: bitstring, port: integer, media_id: integer, plex_token: bitstring, callback_server_id: pid}
end
## function to retrieve the Windows Product Key from any PC
## by Jakob Bindslet (jakob@bindslet.dk)
function Get-WindowsKey {
param ($targets = ".")
$hklm = 2147483650
$regPath = "Software\Microsoft\Windows NT\CurrentVersion"
$regValue = "DigitalProductId"
Foreach ($target in $targets) {
$productKey = $null
function FxCop
{
$vsCommonTools = @(${Env:VS140COMNTOOLS}, ${Env:VS120COMNTOOLS}, ${Env:VS110COMNTOOLS})
$fxCopPath = $vsCommonTools | Where { $_ -ne $null -and $_ -ne "" } `
| Select @{ Name = "Out"; Expression = { $_ | Split-Path -Parent | Split-path -Parent } } `
| Select -ExpandProperty "Out" `
| Select @{ Name = "Out"; Expression = { Join-path $_ "Team Tools\Static Analysis Tools\FxCop\FxCopCmd.exe" } } `
| Select -ExpandProperty "Out" `
| Where { $_ | Test-Path } `
| Select -first 1
#!/bin/sh
# kFreeBSD do not accept scripts as interpreters, using #!/bin/sh and sourcing.
if [ true != "$INIT_D_SCRIPT_SOURCED" ] ; then
set "$0" "$@"; INIT_D_SCRIPT_SOURCED=true . /lib/init/init-d-script
fi
#!/bin/sh
### BEGIN INIT INFO
# Provides: Terraria TShock Server
@minidfx
minidfx / PlexConnect Startup Script
Last active March 5, 2016 15:28
Script using the old way sysvinit for starting the service.
#!/bin/sh
### BEGIN INIT INFO
# Provides: plexconnect
# Description: Script for executing PlexConnect as daemon
### END INIT INFO
# Author: Burgy Benjamin <minidfx@gmail.com>
PATH=/sbin:/usr/sbin:/bin:/usr/bin
DESC="PlexConnect Daemon"