Skip to content

Instantly share code, notes, and snippets.

View cloudcap10's full-sized avatar
🇸🇬
Automating

CloudCap10 cloudcap10

🇸🇬
Automating
View GitHub Profile
@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 / 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 / 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

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 ..
@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 / 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
@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"
@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"}
$Items = @('Archived History',
'Cache\*',
'Cookies',
'History',
'Login Data',
'Top Sites',
'Visited Links',
'Web Data')
$Folder = "$($env:LOCALAPPDATA)\Google\Chrome\User Data\Default"
$Items | % {
$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