Skip to content

Instantly share code, notes, and snippets.

View cloudcap10's full-sized avatar
🇸🇬
Automating

CloudCap10 cloudcap10

🇸🇬
Automating
View GitHub Profile
@cloudcap10
cloudcap10 / Manage-ADComputers.ps1
Created June 8, 2020 01:22 — forked from 9to5IT/Manage-ADComputers.ps1
PowerShell: Cleanup inactive AD computer objects
Import-Module ActiveDirectory
# Set the number of days since last logon
$DaysInactive = 90
$InactiveDate = (Get-Date).Adddays(-($DaysInactive))
#-------------------------------
# FIND INACTIVE COMPUTERS
#-------------------------------
# Below are three options to find inactive computers. Select the one that is most appropriate for your requirements:
@cloudcap10
cloudcap10 / PowerView-3.0-tricks.ps1
Created June 8, 2020 01:18 — forked from HarmJ0y/PowerView-3.0-tricks.ps1
PowerView-3.0 tips and tricks
# PowerView's last major overhaul is detailed here: http://www.harmj0y.net/blog/powershell/make-powerview-great-again/
# tricks for the 'old' PowerView are at https://gist.github.com/HarmJ0y/3328d954607d71362e3c
# the most up-to-date version of PowerView will always be in the dev branch of PowerSploit:
# https://github.com/PowerShellMafia/PowerSploit/blob/dev/Recon/PowerView.ps1
# New function naming schema:
# Verbs:
# Get : retrieve full raw data sets
# Find : ‘find’ specific data entries in a data set
@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
$DaysToDelete = 1
$temporaryIEDir = "C:\users\*\AppData\Local\Microsoft\Windows\Temporary Internet Files\*" ## Remove all files and folders in user's Temporary Internet Files.
$cachesDir = "C:\Users\*\AppData\Local\Microsoft\Windows\Caches" ## Remove all IE caches.
$cookiesDir = "C:\Documents and Settings\*\Cookies\*" ## Delets all cookies.
$locSetDir = "C:\Documents and Settings\*\Local Settings\Temp\*" ## Delets all local settings temp
$locSetIEDir = "C:\Documents and Settings\*\Local Settings\Temporary Internet Files\*" ## Delets all local settings IE temp
$locSetHisDir = "C:\Documents and Settings\*\Local Settings\History\*" ## Delets all local settings history
Get-ChildItem $temporaryIEDir, $cachesDir, $cookiesDir, $locSetDir, $locSetIEDir, $locSetHisDir -Recurse -Force -Verbose -ErrorAction SilentlyContinue | Where-Object { ($_.CreationTime -lt $(Get-Date).AddDays(-$DaysToDelete)) } | remove-item -force -Verbose -recurse -ErrorAction SilentlyContinue
$Items = @('Archived History',
'Cache\*',
'Cookies',
'History',
'Login Data',
'Top Sites',
'Visited Links',
'Web Data')
$Folder = "$($env:LOCALAPPDATA)\Google\Chrome\User Data\Default"
$Items | % {
@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@address.com"}
@cloudcap10
cloudcap10 / Ubuntu 18.04 to 20.04
Last active April 24, 2020 05:45
Upgrade Ubuntu 18.04 to 20.04 LTS using cli
$ sudo apt update
$ sudo apt list --upgradable
$ sudo apt upgrade
$ sudo reboot
## unused old kernels
$ sudo apt --purge autoremove
## Update Manager
## Git Changing a remote's URL
$ git remote -v
> origin git@github.com:USERNAME/REPOSITORY.git (fetch)
> origin git@github.com:USERNAME/REPOSITORY.git (push)
git remote set-url origin https://github.com/USERNAME/REPOSITORY.git
$ git remote -v
# Verify new remote URL
@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
git checkout --orphan gh-pages
git reset --hard
git commit --allow-empty -m "Initializing gh-pages branch"
git push upstream gh-pages
git checkout master
git worktree add -B gh-pages docs origin/gh-pages
cd public && git add --all && git commit -m "Publishing to gh-pages" && cd ..