Skip to content

Instantly share code, notes, and snippets.

View mrxinu's full-sized avatar

Steve Klassen mrxinu

View GitHub Profile
@mrxinu
mrxinu / values_pointers.go
Created April 26, 2020 21:36 — forked from josephspurrier/values_pointers.go
Golang - Asterisk and Ampersand Cheatsheet
/*
********************************************************************************
Golang - Asterisk and Ampersand Cheatsheet
********************************************************************************
Also available at: https://play.golang.org/p/lNpnS9j1ma
Allowed:
--------
p := Person{"Steve", 28} stores the value
@mrxinu
mrxinu / import_whd_tickets.rb
Created February 4, 2020 13:38 — forked from cw2908/import_whd_tickets.rb
Import Incidents from WHD export
# frozen_string_literal: true
#################################################################
##
## First install the wrapper & xml parser `gem install samanage nokogiri`
## To run `ruby import_whd_tickets.rb api-token export-file.csv`
##
##
## The CSV input columns were:
##
#
# Installed as a PowerShell script monitor, this will look at a file and
# determine how many times a string has appeared since the last polling
# interval.
#
# The Scripts Arguments line should read:
#
# \\path\to\filename,"string to match"
#
@mrxinu
mrxinu / Windows10-Setup.ps1
Created September 18, 2017 17:09 — forked from NickCraver/Windows10-Setup.ps1
(In Progress) PowerShell Script I use to customize my machines in the same way for privacy, search, UI, etc.
##################
# Privacy Settings
##################
# Privacy: Let apps use my advertising ID: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 0
# To Restore:
#Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AdvertisingInfo -Name Enabled -Type DWord -Value 1
# Privacy: SmartScreen Filter for Store Apps: Disable
Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\AppHost -Name EnableWebContentEvaluation -Type DWord -Value 0
@mrxinu
mrxinu / boxstarter.ps1
Created September 18, 2017 15:17 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt:
@mrxinu
mrxinu / settings.json
Created August 5, 2017 09:59 — forked from campoy/settings.json
My vscode settings
{
"window.zoomLevel": 0,
"go.lintOnSave": "package",
"editor.fontFamily": "'Fira Code', Menlo, Monaco, 'Courier New', monospace",
"editor.fontLigatures": false,
"workbench.iconTheme": "vs-seti",
"go.addTags": {
"tags": "json",
"options": "json=omitempty",
"promptForTags": true,
@mrxinu
mrxinu / set-custom-property.go
Created May 24, 2017 23:40
A rewrote a PowerShell script a colleague had written in Go so he could see how it compares. Of course I used my own package because why reinvent the wheel, right?
package main
import (
"bufio"
"flag"
"fmt"
"log"
"os"
"time"
@mrxinu
mrxinu / recover_source_code.md
Created March 11, 2017 11:38 — forked from simonw/recover_source_code.md
How to recover lost Python source code if it's still resident in-memory

How to recover lost Python source code if it's still resident in-memory

I screwed up using git ("git checkout --" on the wrong file) and managed to delete the code I had just written... but it was still running in a process in a docker container. Here's how I got it back, using https://pypi.python.org/pypi/pyrasite/ and https://pypi.python.org/pypi/uncompyle6

Attach a shell to the docker container

Install GDB (needed by pyrasite)

apt-get update && apt-get install gdb

Keybase proof

I hereby claim:

  • I am mrxinu on github.
  • I am mrxinu (https://keybase.io/mrxinu) on keybase.
  • I have a public key whose fingerprint is B3E0 D3EE 051C EE58 B655 19F9 C879 0635 7734 B1CC

To claim this, I am signing this object: