Skip to content

Instantly share code, notes, and snippets.

Avatar
👾
Invading Space

Emmaly emmaly

👾
Invading Space
View GitHub Profile
@lizthegrey
lizthegrey / attributes.rb
Last active June 1, 2023 20:05
Hardening SSH with 2fa
View attributes.rb
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam'
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes'
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no'
@mattifestation
mattifestation / NiftyETWProviders.json
Created December 21, 2018 19:27
ETW providers you never knew existed...
View NiftyETWProviders.json
[
{
"ProviderGUID": "72d164bf-fd64-4b2b-87a0-62dbcec9ae2a",
"ProviderName": "AccEventTool",
"ProviderGroupGUID": "4f50731a-89cf-4782-b3e0-dce8c90476ba",
"AssociatedFilenames": [
"accevent.exe",
"inspect.exe",
"narrator.exe",
"srh.dll"
@bwright86
bwright86 / ActiveWindowMonitor.ps1
Last active October 6, 2022 19:33
Powershell - Event Driven ActiveWindow Monitor
View ActiveWindowMonitor.ps1
Add-Type -TypeDefinition @"
using System;
using System.Runtime.InteropServices;
using System.Diagnostics;
using System.ComponentModel;
namespace System.Diagnostics
{
View gist:106143d1bb5d4162689b9e1d89a2d0fb
@font-face {
font-family: SegoeUI;
src:
local("Segoe UI Light"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff2) format("woff2"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.woff) format("woff"),
url(//c.s-microsoft.com/static/fonts/segoe-ui/west-european/light/latest.ttf) format("truetype");
font-weight: 100;
}
@tkrajina
tkrajina / unmarshal_interface.go
Last active April 20, 2023 00:21
Unmarshal JSON to specific interface implementation
View unmarshal_interface.go
package main
import (
"encoding/json"
"fmt"
"reflect"
)
type Something interface{}
@marmarek
marmarek / dom0.sls
Last active October 28, 2016 21:23
Martus salt configuration for Qubes OS
View dom0.sls
include:
- qvm.template-debian-8
- qvm.sys-whonix
debian-8-martus:
qvm.clone:
- source: debian-8
- label: black
@troyk
troyk / jwt.go
Created April 7, 2016 04:21
golang jwt example
View jwt.go
package cmd
import (
"encoding/json"
"flag"
"fmt"
"os"
"regexp"
"strings"
@yurydelendik
yurydelendik / gist:f2b846dae7cb29c86d23
Last active May 16, 2023 01:58
PDF.js get/show hightlight
View gist:f2b846dae7cb29c86d23
function getHightlightCoords() {
var pageIndex = PDFViewerApplication.pdfViewer.currentPageNumber - 1;
var page = PDFViewerApplication.pdfViewer.getPageView(pageIndex);
var pageRect = page.canvas.getClientRects()[0];
var selectionRects = window.getSelection().getRangeAt(0).getClientRects();
var viewport = page.viewport;
var selected = selectionRects.map(function (r) {
return viewport.convertToPdfPoint(r.left - pageRect.x, r.top - pageRect.y).concat(
viewport.convertToPdfPoint(r.right - pageRect.x, r.bottom - pageRect.y));
});
@andrewroberts
andrewroberts / createPDF.gs
Last active May 10, 2023 03:57
Google Apps Script that merges the values from a Google Spreadsheet into a Google Doc template (does a mail merge) to create a GDoc or PDF. More details can be found at www.andrewroberts.net/2014/10/google-apps-script-create-pdf/. Go to https://tinyurl.com/yd8v2do2 if you would like me to set it up for you.
View createPDF.gs
//
// Create a PDF by merging values from a Google spreadsheet into a Google Doc
// ==========================================================================
//
// Demo GSheet & script - http://bit.ly/createPDF
// Demo GDoc template - 1QnWfeGrZ-86zY_Z7gPwbLoEx-m9YreFb7fc9XPWkwDw
//
// Config
// ======
@bryfry
bryfry / gzip.go
Last active April 16, 2023 03:02
Idiomatic golang net/http gzip transparent compression (works with Alice)
View gzip.go
package main
import (
"compress/gzip"
"io"
"net/http"
"strings"
)
// Gzip Compression