Skip to content

Instantly share code, notes, and snippets.

View cloudcap10's full-sized avatar
🇸🇬
Automating

CloudCap10 cloudcap10

🇸🇬
Automating
View GitHub Profile
@cloudcap10
cloudcap10 / disable EventID 4703
Created May 17, 2020 01:24
Event ID 4703 - Authorization Policy Change
Authorization Policy Change
auditpol.exe /set /subcategory:"Authorization Policy Change" /success:disable /failure:disable
@cloudcap10
cloudcap10 / ajaxspreadsheet.js
Created May 10, 2020 10:11 — forked from mgamini/ajaxspreadsheet.js
How to receive ajax data and store it in a Google spreadsheet
// Follow the instructions here: http://mashe.hawksey.info/2014/07/google-sheets-as-a-database-insert-with-apps-script-using-postget-methods-with-ajax-example/
//
// That'll get you 80% of the way there. Unfortunately, you'll run into CORS and MIMETYPE errors, so make the following changes.
// ============================================================
// Your clientside script should actually look like this (jquery example):
// ============================================================
var data = {email: "[email protected]"}
@cloudcap10
cloudcap10 / create-pfx
Last active April 20, 2020 09:08 — forked from jamielaundon/create-pfx
Create IIS .pfx from Let's Encrypt fullchain and priv key
sudo openssl pkcs12 -export -in /etc/letsencrypt/live/domain.com/fullchain.pem -inkey /etc/letsencrypt/live/domain.com/key.pem -out domain.com.pfx
@cloudcap10
cloudcap10 / git-feature-workflow.md
Created April 19, 2020 06:41 — forked from blackfalcon/git-feature-workflow.md
Git basics - a general workflow

Git-workflow or feature branching

When working with Git, there are two prevailing workflows are [Gitflow][gitflow] and [feature branches][feature]. IMHO, being more of a subscriber to continuous integration, I feel that the feature branch workflow is better suited, and the focus of this article.

If you are new to Git and Git-workflows, I suggest reading the [atlassian.com Git Workflow][article] article in addition to this as there is more detail there than presented here.

I admit, using Bash in the command line with the standard configuration leaves a bit to be desired when it comes to awareness of state. A tool that I suggest using follows these instructions on [setting up GIT Bash autocompletion][git-auto]. This tool will assist you to better visualize the state of a branch in regards to changes and being in sync with the remote repo.

Basic branching

@cloudcap10
cloudcap10 / AD_Computers.ps1
Created April 19, 2020 01:13 — forked from cactaceae21/AD_Computers.ps1
Powershell #powershell
#Get OS of all domain joined computers and group by OS with count
# 1.
Get-ADComputer -Filter * -Properties OperatingSystem | Sort-Object -Property OperatingSystem | Group-Object -Property OperatingSystem -NoElement | ft -AutoSize
# 2.
$ADComputers = @()
$ADComputers = Get-ADComputer -Filter * -Properties OperatingSystem,lastLogonTimestamp
$ADComputers | Sort-Object -Property OperatingSystem | Group-Object -Property OperatingSystem -NoElement | ft -AutoSize
##Create date object for queries below
@cloudcap10
cloudcap10 / gist:6ce49da5c1872a4e14f5c5646ef15ef7
Created April 19, 2020 00:18 — forked from jwebcat/gist:5122366
Properly download from github using wget and curl
wget --no-check-certificate --content-disposition https://github.com/joyent/node/tarball/v0.7.1
# --no-check-cerftificate was necessary for me to have wget not puke about https
curl -LJO https://github.com/joyent/node/tarball/v0.7.1
@cloudcap10
cloudcap10 / Sync gh-pages + master branches
Created April 16, 2020 05:57 — forked from mandiwise/Sync gh-pages + master branches
Keep gh-pages up to date with a master branch
// Reference: http://lea.verou.me/2011/10/easily-keep-gh-pages-in-sync-with-master/
$ git add .
$ git status // to see what changes are going to be commited
$ git commit -m 'Some descriptive commit message'
$ git push origin master
$ git checkout gh-pages // go to the gh-pages branch
$ git rebase master // bring gh-pages up to date with master
$ git push origin gh-pages // commit the changes
@cloudcap10
cloudcap10 / export-google-docs-to-restructured-text.js
Created April 5, 2020 10:19 — forked from simonw/export-google-docs-to-restructured-text.js
Google Apps script to convert a Google Docs document into reStructuredText
function onOpen() {
var ui = DocumentApp.getUi();
ui.createMenu('Convert to .RST')
.addItem('Convert to .RST and email me the result', 'ConvertToRestructuredText')
.addToUi();
}
// Adopted from https://github.com/mangini/gdocs2md by Renato Mangini
// License: Apache License Version 2.0
String.prototype.repeat = String.prototype.repeat || function(num) {
@cloudcap10
cloudcap10 / letsencrypt_esxi.sh
Created April 1, 2020 03:50 — forked from shr00mie/letsencrypt_esxi.sh
Let's Encrypt SSL for ESXi
#!/bin/bash
#
## -------------------------------=[ Info ]=--------------------------------- ##
#
# Generate letsencrypt cert on local server and scp to esxi target.
# Designed and tested on Ubuntu 16.04LTS.
# Assumes you have upnp control over local network. Tested with Ubiquiti USG.
#
# Dependencies:
# miniupnpc (sudo apt install miniupnpc)
@cloudcap10
cloudcap10 / PS-BGInfo.ps1
Last active May 10, 2020 01:53 — forked from dieseltravis/PS-BGInfo.ps1
update wallpaper background image with powershell via GPO
# PS-BGInfo
# Powershell script that updates the background image with a random image from a folder and writes out system info text to it.
# run as a lower priority task
[System.Threading.Thread]::CurrentThread.Priority = 'BelowNormal'
# Configuration:
# Font Family name
$font="Input"