Skip to content

Instantly share code, notes, and snippets.

View ScriptAutomate's full-sized avatar
:shipit:
Automating All The Things

Derek Ardolf ScriptAutomate

:shipit:
Automating All The Things
View GitHub Profile
@ScriptAutomate
ScriptAutomate / Install-WSLAndUbuntu.ps1
Last active January 18, 2024 11:56
Enable WSL and Install Ubuntu 22.04 (or 20.04)
<#
- BIOS of host machine also needs to be configured to allow hardware virtualization
- Windows 10 Pro or otherwise is needed; Windows 10 Home Edition CANNOT get WSL
- This gist WSLv2, but can use WSLv1 instead. I needed v1 as I run Windows 10 in a VM in Virtualbox.
- WSLv2 has been giving me problems in Virtualbox 6.1, but WSLv1 works properly.
- vbox has issues with the GUI settings when it comes to nested virtualization on certain systems,
so run the following if needing to give a VM this enabled setting:
VBoxManage modifyvm <vm-name> --nested-hw-virt on
#>
@ScriptAutomate
ScriptAutomate / Install-ChocoStarterPackages.ps1
Last active January 3, 2024 15:27
Install Chocolatey on Windows 10 or 11 via PowerShell w/ Some Starter Packages
<#
Simple, nice bootstrap to get Windows 10 up-and-running with nice setup!
- Installs chocolatey (choco)
- Installs common software
I highly recommend Windows Subsystem for Linux (WSL), also, which is covered in
a separate gist. It also has a choco command for installing Docker Desktop after:
- https://gist.github.com/ScriptAutomate/f94cd44dacd0f420fae65414e717212d
#>
@ScriptAutomate
ScriptAutomate / WMI-CIM-CodeExamples.ps1
Created September 10, 2015 15:43
Examples of Using WMI/CIM Cmdlets
break #To prevent accidental execution of all commands
# WMI cmdlets: Work against anything, where DCOM RPC dynamic port range is available
# CIM cmdlets: Exist in PowerShell v3 and up, can use DCOM or WSMAN. Can have CimSessions. Microsoft going forward.
$Creds = Get-Credential
Get-WmiObject -Class win32_computersystem
Get-WmiObject -Class win32_computersystem -ComputerName server1 -Credential $Creds
Get-CimInstance -Class win32_computersystem -ComputerName server1 -Credential $Creds
$Session = New-CimSession -ComputerName server1 -Credential $Creds
Get-CimInstance -Class win32_computersystem -CimSession $Session
Get-CimSession
@ScriptAutomate
ScriptAutomate / output-example.log
Last active March 23, 2023 21:45
Test OpenAPI Whisper: Record and Transcribe via Terminal
[00:00.000 --> 00:17.320] I'm currently testing Whisper on my desktop as a way to eventually share with the linking
[00:17.320 --> 00:20.080] your thinking community.
[00:20.080 --> 00:28.720] This is just a way to show different timestamps and general display ability and seeing how
[00:28.720 --> 00:34.000] this could look as an easy note taking solution.
[00:34.000 --> 00:38.240] I for one think this is a rather cool piece of software that I could simply run from my
[00:38.240 --> 00:40.960] terminal of my Linux desktop.
@ScriptAutomate
ScriptAutomate / dendron.yml
Last active November 23, 2022 06:58
Preferred way of working with multi-vault, self contained vault workflows. Inlcudes explanation of multi-vault layout with self contained vaults.
dev:
enablePreviewV2: true
# Ensure selfcontainedvaults enabled
enableSelfContainedVaults: true
enableExportPodV2: true
commands:
lookup:
note:
# Enables vaultSelectionModeOnCreate
# https://wiki.dendron.so/notes/F9LWJEjscrGkxnYi2JNby/#confirmvaultoncreate
@ScriptAutomate
ScriptAutomate / markdown.json
Last active June 13, 2022 15:05
Dendron Snippet: Insert Timestamp (good for interstitial journaling)
{
"g.time": {
"prefix": "-t",
"body": [
"- $CURRENT_YEAR-$CURRENT_MONTH-$CURRENT_DATE $CURRENT_HOUR:$CURRENT_MINUTE: "
],
"description": "Insert timestamp. Good for interstitial journaling."
}
}
@ScriptAutomate
ScriptAutomate / git-cheat-codes.md
Last active June 7, 2022 08:55
GitHub, GitLab, and git: Cheat codes

GitHub, GitLab, and git: Cheat codes

GitHub: Reviewing PRs with tons of modified files and Load diff buttons

For those doomed to try reviewing a major amount of diffs in GitHub for a single PR:

  • Scroll down the entire list of changes so that GitHub loads all of the collapsible boxes associated with all of the changes
  • Open up the inspector/console in the browser devtools. This is probably accessed easily with ctrl+i. We want to be in the Console, which in Firefox is ctrl+shift+k.
  • Type in the following to expand all diffs, in order to avoid needing to click on hundreds of Load diff buttons:
@ScriptAutomate
ScriptAutomate / wiki-to-dendron.py
Last active March 22, 2022 19:33
Basic Python script for downloading a Wiki article and converting to a Dendron note
from datetime import datetime
# Requires third-party Python packages
# pip install mediawiki
# pip install shortuuid
from mediawiki import MediaWiki
import shortuuid
@ScriptAutomate
ScriptAutomate / pyenv.sls
Last active March 5, 2022 11:45
Configure pyenv with salt state
# This is tested/verified on Pop!_OS 20.04 and 20.10
# Older versions tested on Parrot OS 4.1.0
# This example state requires common:lookup:user value in a pillar file
{% set user_name = salt['pillar.get']('common:lookup:user') %}
# Prereqs recommended for building Python
## ref: https://github.com/pyenv/pyenv/wiki#suggested-build-environment
## Ubuntu/Debian/Mint (includes Pop!_OS, Kali, etc.)
pyenv-prereq-pkgs:
pkg.installed:
@ScriptAutomate
ScriptAutomate / dropdown.md
Created February 17, 2022 17:28 — forked from citrusui/dropdown.md
"Dropdowns" in Markdown
How do I dropdown?
This is how you dropdown.

<details>
<summary>How do I dropdown?</summary>
<br>
This is how you dropdown.