Skip to content

Instantly share code, notes, and snippets.

View ITSecMedia's full-sized avatar
🃏
If anything is worth doing, do it with all your heart. --Buddha

Norman Eckstein ITSecMedia

🃏
If anything is worth doing, do it with all your heart. --Buddha
View GitHub Profile
@ITSecMedia
ITSecMedia / gist:f008f2ccb692277dfc12e6853e8da6fb
Last active March 25, 2020 01:26
simple vue.js 2.0 example to add dynamic values in gohugo.io static websites.
=== rest.php ===
some php that creates html output
=== put in your app.js ===
$( document ).ready(function() {
var url_api = 'http://www.domain.com/api/rest.php';
var header = new Vue({
@ITSecMedia
ITSecMedia / outlook_email.py
Last active May 28, 2024 16:59
Python: Create an Email with Outlook
# https://itsec.media/post/python-send-outlook-email/
import win32com.client
from win32com.client import Dispatch, constants
const=win32com.client.constants
olMailItem = 0x0
obj = win32com.client.Dispatch("Outlook.Application")
newMail = obj.CreateItem(olMailItem)
newMail.Subject = "I AM SUBJECT!!"
Import-Module -Name D:\Temp\ACME-posh\ACMEPowerShell.psd1
$domain = "mydomain.com"
$certificiatePassword = "abcd1234"
$email = "[email protected]"
$vault = "D:\Vault\{0}\{1}" -f $domain, [guid]::NewGuid()
mkdir $vault
cd $vault
Initialize-ACMEVault -BaseURI https://acme-v01.api.letsencrypt.org/
New-ACMERegistration -Contacts mailto:$email
@ITSecMedia
ITSecMedia / main.go
Created February 11, 2017 19:54 — forked from dmitshur/main.go
Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers.
// Server for HTTPS protocol. Redirects to canonical hosts, reverse proxies requests to internal backing servers.
package main
import (
"crypto/tls"
"flag"
"log"
"net/http"
"net/http/httputil"
"time"
function copyToClipboard( text ){
var copyDiv = document.createElement('div');
copyDiv.contentEditable = true;
document.body.appendChild(copyDiv);
copyDiv.innerHTML = text;
copyDiv.unselectable = "off";
copyDiv.focus();
document.execCommand('SelectAll');
document.execCommand("Copy", false, null);
document.body.removeChild(copyDiv);
@ITSecMedia
ITSecMedia / google-disavow.txt
Created September 22, 2017 18:20
Google Disavow List for SPAM Domain
### 2017-09-16 == START ###
domain:81.231.146.222
domain:add-pages.com
domain:ads.earth
domain:advertise.academy
domain:advertise.boutique
domain:advertise.capital
domain:advertise.center
domain:advertise.clothing
@ITSecMedia
ITSecMedia / gist:9cb8cf6279471531129a0a90f9556680
Created December 15, 2017 10:04 — forked from msmuenchen/gist:9318327
KeePass v2.x (KDBX v3.x) file format
Convention: Byte array notation as it would appear in a hexeditor.
= Layout=
KDBX files, the keepass database files, are layout as follows:
1) Bytes 0-3: Primary identifier, common across all kdbx versions:
private static $sigByte1=[0x03,0xD9,0xA2,0x9A];
2) Bytes 4-7: Secondary identifier. Byte 4 can be used to identify the file version (0x67 is latest, 0x66 is the KeePass 2 pre-release format and 0x55 is KeePass 1)
@ITSecMedia
ITSecMedia / ConstrainedTypesExamples.fsx
Created May 25, 2019 19:59 — forked from swlaschin/ConstrainedTypesExamples.fsx
Examples of creating constrained types in F#
// General hints on defining types with constraints or invariants
//
// Just as in C#, use a private constructor
// and expose "factory" methods that enforce the constraints
//
// In F#, only classes can have private constructors with public members.
//
// If you want to use the record and DU types, the whole type becomes
// private, which means that you also need to provide:
// * a constructor function ("create").
@ITSecMedia
ITSecMedia / Dapper.Extensions.fs
Created October 4, 2019 16:15 — forked from Dzoukr/Dapper.Extensions.fs
F# extensions for Dapper
module Dapper.Extensions
open System
open System.Data.SqlClient
open Dapper
let extractValue (x:obj) =
match x with
| null -> null
| _ -> match x.GetType().GetProperty("Value") with
@ITSecMedia
ITSecMedia / Lein.bat
Created December 6, 2019 12:32
Leiningen
@echo off
setLocal EnableExtensions EnableDelayedExpansion
set LEIN_VERSION=2.9.1
if "%LEIN_VERSION:~-9%" == "-SNAPSHOT" (
set SNAPSHOT=YES
) else (
set SNAPSHOT=NO