From b1132a24a51f8a30f953c38cbb812af30da1633b Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Fri, 3 Apr 2020 13:29:13 -0500 Subject: [PATCH 01/16] Need me some PowerShell 6. --- bootstrap.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap.ps1 b/bootstrap.ps1 index 985e7ad..d909e1a 100644 --- a/bootstrap.ps1 +++ b/bootstrap.ps1 @@ -62,4 +62,8 @@ if($doBootStrap) { # ArchiMate for enterprise modeling if($false) { choco install archi +} + +if($false) { + choco install powershell-core } \ No newline at end of file -- 2.47.3 From eba361892badcc91275537dfe58f77f2c4a4ded6 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Mon, 13 Apr 2020 14:10:57 -0500 Subject: [PATCH 02/16] GPG --- bootstrap.ps1 | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap.ps1 b/bootstrap.ps1 index d909e1a..216cbc5 100644 --- a/bootstrap.ps1 +++ b/bootstrap.ps1 @@ -23,6 +23,10 @@ if($false) { choco install docker-desktop } +if($false) { + choco install gnupg + gpg --full-generate-key +} # Install Python3 and Pip # Install Stub PowerShell Profile that sources the one from DotFiles -- 2.47.3 From 42ff2406543af3995cc81c0a763e7aabf4078f8f Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Fri, 5 Jun 2020 13:50:16 -0500 Subject: [PATCH 03/16] Added a command we need go get a token now, apparently. --- Microsoft.PowerShell_profile.ps1 | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index d2fd450..a72d539 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -1,4 +1,11 @@ +# Courtesty of MKletz +# Get-ChildItem -Path 'C:\Repos' -Filter "*.psd1" -Recurse | ForEach-Object -Process { +# $Path = Split-Path -Path $_.Directory -Parent +# $env:PSModulePath = $env:PSModulePath + ";$($Path)" +#} +$env:PSModulePath = $env:PSModulePath.Replace("\\ad.uillinois.edu\techsvc\home\$($ENV:USERNAME)\Documents\PowerShell\Modules;",'') + # Kali linux env $ENV:PATH +=":/home/delaport/development/flutter/bin" # Flutter in Kali under WSL @@ -24,6 +31,7 @@ function New-DockerRStudio() { } function Start-DockerRStudio() { docker start rpython + jupyter notebook list Write-Host "R Studio is running at http://localhost:8787/" Write-Host "Jupyter is running at http://localhost:8888/" } @@ -51,6 +59,11 @@ function Start-DockerJuiceShop() { Write-Host "Vulnerable Juice Shop running on 3000" } +function Start-DockerGrafana() { + docker run --rm -d --name=grafana -p 3001:3001 -user $ID --volume "C:\src\data:/var/lib/grafana" grafana/grafana + Write-Host "Grafana running on 3001" +} + # Import some home grown PowerShell modules, if they are installed. $modPaths = @("C:\src\dotfiles\ToyBox\toybox.psm1") $modPaths | ForEach-Object { -- 2.47.3 From 4b206dad6f5d5eeb902cd2ab700161fbb9f96058 Mon Sep 17 00:00:00 2001 From: EdTheDev Date: Wed, 1 Jul 2020 17:41:31 -0500 Subject: [PATCH 04/16] VScode window color --- this.code-workspace | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 this.code-workspace diff --git a/this.code-workspace b/this.code-workspace new file mode 100644 index 0000000..d6801ba --- /dev/null +++ b/this.code-workspace @@ -0,0 +1,31 @@ +{ + "folders": [ + { + "path": "." + }, + { + "path": ".." + } + ], + "settings": { + "workbench.colorCustomizations": { + "activityBar.activeBackground": "#65c89b", + "activityBar.activeBorder": "#945bc4", + "activityBar.background": "#65c89b", + "activityBar.foreground": "#15202b", + "activityBar.inactiveForeground": "#15202b99", + "activityBarBadge.background": "#945bc4", + "activityBarBadge.foreground": "#e7e7e7", + "statusBar.background": "#42b883", + "statusBar.border": "#42b883", + "statusBar.foreground": "#15202b", + "statusBarItem.hoverBackground": "#359268", + "titleBar.activeBackground": "#42b883", + "titleBar.activeForeground": "#15202b", + "titleBar.border": "#42b883", + "titleBar.inactiveBackground": "#42b88399", + "titleBar.inactiveForeground": "#15202b99" + }, + "peacock.color": "#42b883" + } +} \ No newline at end of file -- 2.47.3 From cee446f6f0ae3c609c14ace1d386990c08613d93 Mon Sep 17 00:00:00 2001 From: EdTheDev Date: Wed, 1 Jul 2020 18:03:58 -0500 Subject: [PATCH 05/16] Retropi joystick setup --- install/retropi.ps1 | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 install/retropi.ps1 diff --git a/install/retropi.ps1 b/install/retropi.ps1 new file mode 100644 index 0000000..d0b9518 --- /dev/null +++ b/install/retropi.ps1 @@ -0,0 +1,7 @@ + +## TODO: Would be clever to make this a DSC module: https://docs.microsoft.com/en-us/powershell/scripting/dsc/quickstarts/website-quickstart?view=powershell-7 +Write-Host "Adding ability to switch Joystick" +# https://github.com/meleu/RetroPie-joystick-selection +Write-Host "Enable SSH first via Raspi-Config" +ssh pi@retropi -C 'wget -O- "https://raw.githubusercontent.com/meleu/RetroPie-joystick-selection/master/install.sh" | sudo bash' +Write-Host "Now launch the script via RetroPi Setup - Configuration Tools - Joystick selection" \ No newline at end of file -- 2.47.3 From ed004c8f51af226cd27b2b2d58be0ed00167ccf4 Mon Sep 17 00:00:00 2001 From: EdTheDev Date: Wed, 1 Jul 2020 18:04:11 -0500 Subject: [PATCH 06/16] dockery ansible --- install/ansible.ps1 | 1 + 1 file changed, 1 insertion(+) create mode 100644 install/ansible.ps1 diff --git a/install/ansible.ps1 b/install/ansible.ps1 new file mode 100644 index 0000000..965952f --- /dev/null +++ b/install/ansible.ps1 @@ -0,0 +1 @@ +docker up ansible/ansible \ No newline at end of file -- 2.47.3 From a02b2eb5ad1cb911977283cf359d105f831db3fb Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Wed, 8 Jul 2020 11:33:29 -0500 Subject: [PATCH 07/16] attempted airflow run --- Microsoft.PowerShell_profile.ps1 | 9 +++++++++ docker-airflow.yml | 11 +++++++++++ 2 files changed, 20 insertions(+) create mode 100644 docker-airflow.yml diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index a72d539..8ae1eb4 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -84,4 +84,13 @@ function Start-DockerPython2Bash { function Stop-Docker { docker stop $(docker ps -a -q) +} + +function New-DockerAirflow { + docker run -v ./:/etc/myscripts apache/airflow /bin/bash /etc/myscripts/airflow.sh + +} + +function Start-DockerAirflow { + docker run airflow -f webserver } \ No newline at end of file diff --git a/docker-airflow.yml b/docker-airflow.yml new file mode 100644 index 0000000..a977d5a --- /dev/null +++ b/docker-airflow.yml @@ -0,0 +1,11 @@ +airflow initdb +webapp: + environment: + - AIRFLOW_HOME = /opt/data + image: examples/web + ports: + - "8000:8000" + volumes: + - type: bind + source: ./data + target: /opt/data \ No newline at end of file -- 2.47.3 From 48116abebff8a387217761d418c5b005e36924e3 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Wed, 8 Jul 2020 12:53:49 -0500 Subject: [PATCH 08/16] Posh Git --- Microsoft.PowerShell_profile.ps1 | 7 +++++++ bootstrap.ps1 | 4 ++++ 2 files changed, 11 insertions(+) diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 8ae1eb4..80e3453 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -1,4 +1,5 @@ +Import-Module posh-git # Courtesty of MKletz # Get-ChildItem -Path 'C:\Repos' -Filter "*.psd1" -Recurse | ForEach-Object -Process { # $Path = Split-Path -Path $_.Directory -Parent @@ -93,4 +94,10 @@ function New-DockerAirflow { function Start-DockerAirflow { docker run airflow -f webserver +} + +function Start-DockerFindSecrets { + # docker run -v "$((Get-Item .).FullName)":/etc/src dxa4481/trufflehog /bin/bash + # Write-Host "Current folder mounted as /etc/src" + docker run -v /c/src:/etc/src dxa4481/trufflehog /etc/src/SecOps-Tools } \ No newline at end of file diff --git a/bootstrap.ps1 b/bootstrap.ps1 index 216cbc5..b297d75 100644 --- a/bootstrap.ps1 +++ b/bootstrap.ps1 @@ -19,6 +19,10 @@ if(! $profileContents -contains $sourceMeLine) { # TODO Install Chocolatey +# PoshGit +PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force + + if($false) { choco install docker-desktop } -- 2.47.3 From 221d984195390c9dc955082c1694e8e00db0c4fd Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Wed, 15 Jul 2020 13:07:14 -0500 Subject: [PATCH 09/16] ASCII helper. --- Microsoft.PowerShell_profile.ps1 | 55 ++++++++++++++++++++++++++++++++ 1 file changed, 55 insertions(+) diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 80e3453..5f667a0 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -100,4 +100,59 @@ function Start-DockerFindSecrets { # docker run -v "$((Get-Item .).FullName)":/etc/src dxa4481/trufflehog /bin/bash # Write-Host "Current folder mounted as /etc/src" docker run -v /c/src:/etc/src dxa4481/trufflehog /etc/src/SecOps-Tools +} + + +#requires -version 5.1 +#ConvertTo-ASCIIArt.ps1 + +<# +font list at https://artii.herokuapp.com/fonts_list +font names are case-sensitive + +invoke-restmethod https://artii.herokuapp.com/fonts_list + +#> + +<# +.SYNOPSIS +Output strings as ASCII art fonts. + +.EXAMPLE +cart "Testing"-Font cursive + +.NOTES +From https://jdhitsolutions.com/blog/powershell/7278/friday-fun-powershell-ascii-art/ +#> +Function ConvertTo-ASCIIArt { + [cmdletbinding()] + [alias("cart")] + [outputtype([System.String])] + Param( + [Parameter(Position = 0, Mandatory, HelpMessage = "Enter a short string of text to convert", ValueFromPipeline)] + [ValidateNotNullOrEmpty()] + [string]$Text, + [Parameter(Position = 1,HelpMessage = "Specify a font from https://artii.herokuapp.com/fonts_list. Font names are case-sensitive")] + [ValidateNotNullOrEmpty()] + [string]$Font = "big" + ) + + Begin { + Write-Verbose "[$((Get-Date).TimeofDay) BEGIN] Starting $($myinvocation.mycommand)" + } #begin + + Process { + Write-Verbose "[$((Get-Date).TimeofDay) PROCESS] Processing $text with font $Font" + $testEncode = [uri]::EscapeDataString($Text) + $url = "http://artii.herokuapp.com/make?text=$testEncode&font=$Font" + Try { + Invoke-Restmethod -Uri $url -DisableKeepAlive -ErrorAction Stop + } + Catch { + Throw $_ + } + } #process + End { + Write-Verbose "[$((Get-Date).TimeofDay) END ] Ending $($myinvocation.mycommand)" + } #end } \ No newline at end of file -- 2.47.3 From 2a120f0ebc2f4e638ebbb297e959b3da63531685 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Wed, 12 Aug 2020 13:45:06 -0500 Subject: [PATCH 10/16] Add support tool --- Microsoft.PowerShell_profile.ps1 | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 5f667a0..8cb7324 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -1,4 +1,11 @@ + +## Setup reminder: +# code $profile +# Set-ExecutionPolicy RemoteSigned +# . C:\src\dotfiles\Microsoft.PowerShell_profile.ps1 + + Import-Module posh-git # Courtesty of MKletz # Get-ChildItem -Path 'C:\Repos' -Filter "*.psd1" -Recurse | ForEach-Object -Process { @@ -155,4 +162,15 @@ Function ConvertTo-ASCIIArt { End { Write-Verbose "[$((Get-Date).TimeofDay) END ] Ending $($myinvocation.mycommand)" } #end -} \ No newline at end of file +} + + +#### User Configuraable Variables #### +## https://github.com/techservicesillinois/Powershell-SupportApp + +# Customize the title bar of your console. +[string]$SA_title="PowerShell Support App for U of I" +# Path to a text editor +[string]$SA_TextEditor="C:\Program Files (x86)\Notepad++\notepad++.exe" +$SA_Config_base=$true +import-module .\PowerShellSupportAppV2\PowerShellSupportAppV2.psm1 \ No newline at end of file -- 2.47.3 From 1b815a3ed1ebd06c7ccd2727245dbeca5adcb672 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Sun, 30 Aug 2020 18:06:26 -0500 Subject: [PATCH 11/16] Pi script --- bootstrap.sh | 3 --- bootstrap_pi.sh | 51 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 51 insertions(+), 3 deletions(-) create mode 100755 bootstrap_pi.sh diff --git a/bootstrap.sh b/bootstrap.sh index acd0ba8..c99f8ee 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -8,9 +8,6 @@ # You can scp just this file to the destination host, # and then run it. -# sudo apt-get install zsh -# TODO: CURL me... - ## Setup Git and Vim if [ ! -d ~/dotfiles ]; then sudo apt-get install git install vim diff --git a/bootstrap_pi.sh b/bootstrap_pi.sh new file mode 100755 index 0000000..b2d0bbb --- /dev/null +++ b/bootstrap_pi.sh @@ -0,0 +1,51 @@ +# Reminder to future self: +# Step 0: git clone https://github.com/edthedev/dotfiles +# Step 1: Run this bootstrap script. + +echo "Git, vi are already installed." + +## Setup Git and Vim +if [ ! -d ~/dotfiles ]; then + sudo apt-get install git vim-nox + cd ~; git clone git@github.com:edthedev/dotfiles.git +fi + +# sudo apt-get install vim-nox + +if [ ! -f ~/.vimrc ]; then + git config --global user.email "edward@delaporte.us" + git config --global user.name "Edward Delaporte" + git config --global core.editor /usr/bin/vim + ln -s ~/dotfiles/vimrc ~/.vimrc +fi + +## Setup PowerShell +if [ ! -f ~/.config/powershell/Microsoft.PowerShell_profile.ps1 ]; then + sudo apt-get install powershell + chsh --shell /usr/bin/pwsh + mkdir -p ~/.config/powershell/ + ln -s ~/dotfiles/Microsoft.PowerShell_profile.ps1 ~/.config/powershell/Microsoft.PowerShell_profile.ps1 +fi + +## Create SSH Keys +if [ ! -f ~/.ssh/id_rsa ]; then + ssh-keygen +fi + +## Setup Remote Access +# if [ ! -f ~/id_rsa.pub ]; then +# cp ~/dotfiles/id_rsa.pub ~/id_rsa.pub +# chmod go+r ~/id_rsa.pub +# fi + +## Setup Screen +if [ ! -f ~/.screenrc ]; then + sudo apt-get install screen + ln -s ~/dotfiles/screenrc ~/.screenrc +fi + +## Setup Vundle for Vim +if [ ! -d ~/.vim/bundle ]; then + git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim + vim +BundleInstall +qall +fi -- 2.47.3 From 015bc7c4811f258d5e88f3d8de9da982204360b9 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Sun, 30 Aug 2020 18:10:25 -0500 Subject: [PATCH 12/16] Add i3 --- bootstrap_pi.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap_pi.sh b/bootstrap_pi.sh index b2d0bbb..0c27dbe 100755 --- a/bootstrap_pi.sh +++ b/bootstrap_pi.sh @@ -19,6 +19,10 @@ if [ ! -f ~/.vimrc ]; then ln -s ~/dotfiles/vimrc ~/.vimrc fi +if [ ! -f ~/.i3 ]; then + sudo apt-get install i3 +fi + ## Setup PowerShell if [ ! -f ~/.config/powershell/Microsoft.PowerShell_profile.ps1 ]; then sudo apt-get install powershell -- 2.47.3 From 52fef367c9cffb9000e796b0c90b4f8704e0936b Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Sun, 30 Aug 2020 18:16:15 -0500 Subject: [PATCH 13/16] Ease of use tweaks.' --- bootstrap_pi.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/bootstrap_pi.sh b/bootstrap_pi.sh index 0c27dbe..be0fa4e 100755 --- a/bootstrap_pi.sh +++ b/bootstrap_pi.sh @@ -53,3 +53,7 @@ if [ ! -d ~/.vim/bundle ]; then git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim vim +BundleInstall +qall fi + +echo "https://github.com/settings/keys" +echo "vim .git/config -- add: url = git@github.com:edthedev/dotfiles.git" +cat ~/.ssh/id_rsa.pub -- 2.47.3 From 8e0a7668c64e05326e2e8bfe0e6253b0420ff5ec Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Sun, 30 Aug 2020 18:34:45 -0500 Subject: [PATCH 14/16] @ --- bootstrap_pi.sh | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/bootstrap_pi.sh b/bootstrap_pi.sh index be0fa4e..d192d9d 100755 --- a/bootstrap_pi.sh +++ b/bootstrap_pi.sh @@ -4,6 +4,8 @@ echo "Git, vi are already installed." +mkdir -p ~/.installed + ## Setup Git and Vim if [ ! -d ~/dotfiles ]; then sudo apt-get install git vim-nox @@ -19,8 +21,9 @@ if [ ! -f ~/.vimrc ]; then ln -s ~/dotfiles/vimrc ~/.vimrc fi -if [ ! -f ~/.i3 ]; then +if [ ! -f ~/.installed/i3 ]; then sudo apt-get install i3 + touch ~/.installed/i3 fi ## Setup PowerShell @@ -54,6 +57,16 @@ if [ ! -d ~/.vim/bundle ]; then vim +BundleInstall +qall fi +if [ ! -d ~/.installed/code ]; then + # sudo apt install snapd + # sudo snap install --classic code + wget https://packagecloud.io/headmelted/codebuilds/gpgkey -O - | sudo apt-key add - + curl -L https://raw.githubusercontent.com/headmelted/codebuilds/master/docs/installers/apt.sh | sudo bash + touch ~/.installed/code +fi + echo "https://github.com/settings/keys" echo "vim .git/config -- add: url = git@github.com:edthedev/dotfiles.git" cat ~/.ssh/id_rsa.pub + +ls -al ~/.installed -- 2.47.3 From 6648004eef29da26913c8fb37f0a3e6e66bf1c93 Mon Sep 17 00:00:00 2001 From: Edward Delaporte Date: Sun, 30 Aug 2020 22:24:33 -0500 Subject: [PATCH 15/16] gimp installer --- install_art.sh | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100755 install_art.sh diff --git a/install_art.sh b/install_art.sh new file mode 100755 index 0000000..caa2c83 --- /dev/null +++ b/install_art.sh @@ -0,0 +1,8 @@ +mkdir -p ~/.installed + +if [ ! -f ~/.installed/gimp ]; then + sudo apt-get install gimp + touch ~/.installed/gimp +fi + +ls -al ~/.installeear -- 2.47.3 From e2461d0ea44718bf82bc37cd2eab811fc4508a7b Mon Sep 17 00:00:00 2001 From: EdTheDev Date: Sat, 12 Sep 2020 12:17:44 -0500 Subject: [PATCH 16/16] Shortcut to find large files. --- Microsoft.PowerShell_profile.ps1 | 4 ++++ this.code-workspace | 2 -- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index 8cb7324..02abc31 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -28,6 +28,10 @@ $ENV:PATH+=";C:\Program Files\nodejs" # KataKoda wants to add tools via npm $ENV:PATH+=";C:\PENGUIN" # Flag to ensure my profile kicked in. +function Find-LargeFiles() { + Get-ChildItem c:\ -r| sort -descending -property length | select -first 10 name, Length, Location +} + function Start-Vault() { consul agent -dev # Run in Dev Mode diff --git a/this.code-workspace b/this.code-workspace index d6801ba..a63f297 100644 --- a/this.code-workspace +++ b/this.code-workspace @@ -17,12 +17,10 @@ "activityBarBadge.background": "#945bc4", "activityBarBadge.foreground": "#e7e7e7", "statusBar.background": "#42b883", - "statusBar.border": "#42b883", "statusBar.foreground": "#15202b", "statusBarItem.hoverBackground": "#359268", "titleBar.activeBackground": "#42b883", "titleBar.activeForeground": "#15202b", - "titleBar.border": "#42b883", "titleBar.inactiveBackground": "#42b88399", "titleBar.inactiveForeground": "#15202b99" }, -- 2.47.3