From: Edward Delaporte Date: Mon, 8 Nov 2021 16:31:32 +0000 (-0600) Subject: Merge branch 'main' of github.com:edthedev/dotfiles into main X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/commitdiff_plain/dc64bcd953b738e3e3ab81aec50fdef1da989fe1?hp=d9fc5b536dde552518ff59561bb76e4cda1ca65d Merge branch 'main' of github.com:edthedev/dotfiles into main --- diff --git a/.vscode/settings.json b/.vscode/settings.json index bf73da0..59ae6e7 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -13,7 +13,13 @@ "titleBar.activeBackground": "#215732", "titleBar.activeForeground": "#e7e7e7", "titleBar.inactiveBackground": "#21573299", - "titleBar.inactiveForeground": "#e7e7e799" + "titleBar.inactiveForeground": "#e7e7e799", + "editorGroup.border": "#2f7c47", + "panel.border": "#2f7c47", + "sash.hoverBorder": "#2f7c47", + "sideBar.border": "#2f7c47", + "statusBarItem.remoteBackground": "#215732", + "statusBarItem.remoteForeground": "#e7e7e7" }, "peacock.color": "#215732", "python.pythonPath": "/usr/bin/python3" diff --git a/GitHubKey.md b/GitHubKey.md new file mode 100644 index 0000000..2e0732e --- /dev/null +++ b/GitHubKey.md @@ -0,0 +1,17 @@ +# Setup GitHub Key + ++ Visit +https://github.com/settings/keys + +```sh +vim .git/config +``` + +``` +url = git@github.com:edthedev/dotfiles.git" +``` + +```sh +cat ~/.ssh/id_rsa.pub +``` + diff --git a/Makefile b/Makefile deleted file mode 100644 index 1a7ad58..0000000 --- a/Makefile +++ /dev/null @@ -1,7 +0,0 @@ -BASEDIR=$(CURDIR) - -hello: - echo "Hello!" - -world: - echo "$(BASEDIR)" \ No newline at end of file diff --git a/README.md b/README.md index 3d376e6..a15c9b8 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,13 @@ # dotfiles -EdTheDev's Linux and Windows dot files. These are shared so that I can easily share a link to a tip or trick. +EdTheDev's Linux and Windows dot files. +These are shared so that I can easily share a link to a tip or trick. -## Bare Minimum +## Getting Started -+ `install.sh` - Script I use to install packages on Linux, most typically a Raspberry Pi. -+ `setup.sh` - Script I use to get to bare minimum (by my definition) setup on Linux - typically a Raspberry Pi. -+ `bootstrap.ps1` - Script I use to setup on Windows. Mostly relies on the `Chocolatey` package manager for Windows, of course. ++ [Windows](/start_windows.md) ++ [Raspberry Pi](/start_pi.md) -## Installations +## Further Reading -See the `\install` folder for scripts to install various handy utilities. Most of these rely on `Apt` on Linux, or `Chocolatey` on Windows. - -## Setups - -See the `\setup` folder for configurations. -These are, obviously, just my preferred configurations. - -In general, these work by setting up symlinks on Linux, and on Windows by copying a stub file that sources the versioned file. - -Most of these are cross platform `.ps1` files that run under PowerShell. +See [pi/i3.md](/pi/i3.md) for info on setting up the I3 window manager on Raspberry Pi. diff --git a/bootstrap.ps1 b/bootstrap.ps1 deleted file mode 100644 index 13ce10f..0000000 --- a/bootstrap.ps1 +++ /dev/null @@ -1,69 +0,0 @@ -<# -.SYNOPSIS - -Setup my Windows PowerShell environment. - -.DESCRIPTION - -.NOTES - -Relies heavily on the Chocolatey package manager. - -#> - -param( - # [Parameter(Mandatory=$true, HelpMessage="Install Development Tools")] - [switch]$dev_tools, - # [Parameter(Mandatory=$true, HelpMessage="Install Modeling Tools")] - [switch]$archi, - # [Parameter(Mandatory=$true, HelpMessage="Install Vim")] - [switch]$vim, - # [Parameter(Mandatory=$true, HelpMessage="Setup PowerShell Profile")] - [switch]$profile, - [switch]$fav_ps_modules -) - -## Install SSH client -Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0 - -## Always Install Chocolatey if missing -$testchoco = powershell choco -v -if(-not($testchoco)){ - Write-Output "Seems Chocolatey is not installed, installing now..." - Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) -} - -# OWASP ZAP for web application security scanning -if($false) { - choco install zap -} - -## TODO: Can I set this via command line: chrome://flags/#enable-force-dark - -if($doBootStrap) { - # DONE! - New-Item -ItemType File -Path $doneFlagFile -} - -# ArchiMate for enterprise modeling -if($archi) { - choco install archi -} - -# Install dev tools -if($dev_tools){ - ./install/dev.ps1 -} - -if($vim){ - ./install/vim.ps1 -} - -if($profile){ - ./install/profile.ps1 -} - -if($fav_ps_modules) { - Write-Host "Reminder: Need to install these modules with admin escalation." - ./install/admin/favorite-ps-modules.ps1 -} diff --git a/install/art.sh b/install/art.sh deleted file mode 100644 index 905dfd8..0000000 --- a/install/art.sh +++ /dev/null @@ -1,8 +0,0 @@ -mkdir -p ~/.installed - -if [ ! -f ~/.installed/gimp ]; then - sudo apt-get install gimp - touch ~/.installed/gimp -fi - -ls -al ~/.installed diff --git a/install/code.sh b/install/code.sh deleted file mode 100644 index 93a0e58..0000000 --- a/install/code.sh +++ /dev/null @@ -1,8 +0,0 @@ -if [ ! -d ~/.installed/code ]; then - echo "************** Install Visual Studio Code" - # 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 diff --git a/install/i3.sh b/install/i3.sh deleted file mode 100644 index 84df46c..0000000 --- a/install/i3.sh +++ /dev/null @@ -1,5 +0,0 @@ -if [ ! -f ~/.installed/i3 ]; then - echo "************** Install i3 Window Manager" - sudo apt-get install i3 - touch ~/.installed/i3 -fi diff --git a/install/nodered.ps1 b/install/nodered.ps1 deleted file mode 100644 index 8b13789..0000000 --- a/install/nodered.ps1 +++ /dev/null @@ -1 +0,0 @@ - diff --git a/install/vscode-journal.sh b/install/vscode-journal.sh deleted file mode 100644 index e358f8e..0000000 --- a/install/vscode-journal.sh +++ /dev/null @@ -1,18 +0,0 @@ -#/bin/bash - -code-oss --install-extension ban.spellright -code-oss --install-extension benjpas.close-all -code-oss --install-extension fabiospampinato.vscode-markdown-todo -code-oss --install-extension geeklearningio.graphviz-markdown-preview -code-oss --install-extension Gruntfuggly.todo-tree -code-oss --install-extension janisdd.vscode-edit-csv -code-oss --install-extension johnpapa.vscode-peacock -code-oss --install-extension mechatroner.rainbow-csv -code-oss --install-extension ms-python.python -code-oss --install-extension ms-toolsai.jupyter -code-oss --install-extension oderwat.indent-rainbow -code-oss --install-extension pajoma.vscode-journal -code-oss --install-extension telesoho.vscode-oss-markdown-paste-image -code-oss --install-extension vscodevim.vim -code-oss --install-extension yzane.markdown-pdf -code-oss --install-extension yzhang.markdown-all-in-one diff --git a/install.sh b/install_cli_basics.sh similarity index 88% rename from install.sh rename to install_cli_basics.sh index 97e94a8..e2f27d4 100755 --- a/install.sh +++ b/install_cli_basics.sh @@ -24,7 +24,5 @@ if [ ! -f ~/.screenrc ]; then sudo apt-get install -y screen fi -echo "Installed:" -ls -al ~/.installed -echo "Setup Options:" -ls -al ~/setup +echo "************** Install Midnight Commander" +sudo apt-get install mc diff --git a/pi/docker_pirate.md b/pi/docker_pirate.md new file mode 100644 index 0000000..709ee44 --- /dev/null +++ b/pi/docker_pirate.md @@ -0,0 +1,46 @@ +# Docker Pirate + +## On Building the Image + +A Raspberry Pi network connected Docker host. + ++ https://blog.hypriot.com/faq/ ++ https://github.com/hypriot/image-builder-rpi/releases + +See existing volumes. +``` +lsblk +``` + +Use the `dd` command from the tutorial. + +``` +sudo dd if=hypriotos-rpi-v1.12.3.img of=/dev/ bs=1M +``` + +## On Finding the Image + +No wireless support in the image. +Plug into the network directly. + +``` +sudo apt install nmap +hostname -I +nmap -sP .0/24 +``` + +## Updates + +Remember to change the default username and password. + +``` +sudo raspi-config +``` + +To update the hostname: + +```sh +ssh pirate@black-pearl.lan +sudo vi /boot/user-data +sudo reboot now +``` diff --git a/pi/i3.md b/pi/i3.md new file mode 100644 index 0000000..c5f623b --- /dev/null +++ b/pi/i3.md @@ -0,0 +1,32 @@ +# Setting up I3 on Raspbian + +Start with Raspbian Lite. + +## Install basic surival packages. + +```bash +sudo apt-get install lightdm i3 tilix chromium +``` + +## Boot into i3 + +```bash +sudo raspi-config +``` + ++ System? ++ Boot Options ++ Desktop / CLI ++ Choose boot to user. ++ Reboot + +## Configuring i3wm + +``` +vim ~/.config/i3/config +``` + +## Notes + +- lightdm - allows booting directly to desktop +- tilix is literally any terminal other than the blinding default. It has a dark more theme. diff --git a/pi/install/art.sh b/pi/install/art.sh new file mode 100644 index 0000000..4c47a37 --- /dev/null +++ b/pi/install/art.sh @@ -0,0 +1 @@ +sudo apt-get install gimp diff --git a/pi/install/code.sh b/pi/install/code.sh new file mode 100644 index 0000000..52f62ad --- /dev/null +++ b/pi/install/code.sh @@ -0,0 +1 @@ +apt install code diff --git a/install/exfat_pi.sh b/pi/install/exfat_pi.sh similarity index 100% rename from install/exfat_pi.sh rename to pi/install/exfat_pi.sh diff --git a/install/geek-life_pi.sh b/pi/install/geek-life_pi.sh old mode 100755 new mode 100644 similarity index 100% rename from install/geek-life_pi.sh rename to pi/install/geek-life_pi.sh diff --git a/pi/install/i3.sh b/pi/install/i3.sh new file mode 100644 index 0000000..3c9dd72 --- /dev/null +++ b/pi/install/i3.sh @@ -0,0 +1,6 @@ +echo "************** Install i3 Window Manager" +sudo apt-get install i3 lightdm +echo "************** Install Chromium" +sudo apt-get install chromium +echo "************** Install Tilix Terminal" +sudo apt-get install tilix diff --git a/pi/install/i3_basics.sh b/pi/install/i3_basics.sh new file mode 100644 index 0000000..2f1a1d6 --- /dev/null +++ b/pi/install/i3_basics.sh @@ -0,0 +1,3 @@ +./install/i3.sh +sudo apt-get install chromium + diff --git a/install/powershell7_pi.sh b/pi/install/powershell7_pi.sh old mode 100755 new mode 100644 similarity index 100% rename from install/powershell7_pi.sh rename to pi/install/powershell7_pi.sh diff --git a/pi/install/rdp.sh b/pi/install/rdp.sh new file mode 100644 index 0000000..ca235b9 --- /dev/null +++ b/pi/install/rdp.sh @@ -0,0 +1 @@ +sudo apt install xrdp remmina diff --git a/pi/install/website.sh b/pi/install/website.sh new file mode 100644 index 0000000..fd6a2f3 --- /dev/null +++ b/pi/install/website.sh @@ -0,0 +1 @@ +apt install npm diff --git a/install/wtfutil_pi.sh b/pi/install/wtfutil_pi.sh old mode 100755 new mode 100644 similarity index 100% rename from install/wtfutil_pi.sh rename to pi/install/wtfutil_pi.sh diff --git a/pi/install/x16_deps.sh b/pi/install/x16_deps.sh new file mode 100644 index 0000000..631fc46 --- /dev/null +++ b/pi/install/x16_deps.sh @@ -0,0 +1,3 @@ +# Deps +apt install make cc65 +apt install libsdl2-dev diff --git a/install/retropi.ps1 b/pi/setup/retropi_joystick_selection.ps1 similarity index 98% rename from install/retropi.ps1 rename to pi/setup/retropi_joystick_selection.ps1 index d0b9518..114d048 100644 --- a/install/retropi.ps1 +++ b/pi/setup/retropi_joystick_selection.ps1 @@ -1,7 +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' + +## 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 diff --git a/install/vice_pi.sh b/pi/setup/vice_pi.sh old mode 100755 new mode 100644 similarity index 100% rename from install/vice_pi.sh rename to pi/setup/vice_pi.sh diff --git a/pi/setup/x16.sh b/pi/setup/x16.sh new file mode 100644 index 0000000..a7ec6ea --- /dev/null +++ b/pi/setup/x16.sh @@ -0,0 +1,13 @@ +mkdir -p ~/x16 + +cd ~/x16 +git clone https://github.com/commanderx16/x16-rom.git +cd x16-rom +make + +cd ~/x16 +git clone https://github.com/commanderx16/x16-emulator.git +cd x16-emulator +make + +cp ~/x16/x16-rom/build/x16/rom.bin ~/x16/x16-emulator/ diff --git a/pi/start_pi.md b/pi/start_pi.md new file mode 100644 index 0000000..c17f950 --- /dev/null +++ b/pi/start_pi.md @@ -0,0 +1,44 @@ +## Getting Started - Raspberyy Pi + +### Get Online + +```sh +rasppi-config +``` + ++ Set up wireless ++ Set keyboard location + +### Clone this repository + +```sh +sudo apt-get install git +git clone https://github.com/edthedev/dotfiles.git +``` + +### Create a new user + +```sh +sudo useradd bob -m -G sudo +sudo passwd bob +sudo passwd pi +``` + +### Boostrap CLI + +``` +sudo ./install_cli_basics.sh +``` + +## Installations + +See the `\install` folder for scripts to install various handy utilities. Most of these rely on `Apt` on Linux, or `Chocolatey` on Windows. + +## Setups + +See the `\setup` folder for configurations. +These are, obviously, just my preferred configurations. + +In general, these work by setting up symlinks on Linux, and on Windows by copying a stub file that sources the versioned file. + +Most of these are cross platform `.ps1` files that run under PowerShell. diff --git a/setup/code-plugins.ps1 b/setup/code-plugins.ps1 new file mode 100644 index 0000000..9cd7a55 --- /dev/null +++ b/setup/code-plugins.ps1 @@ -0,0 +1,7 @@ +code --install-extension benjpas.close-all +code --install-extension johnpapa.vscode-peacock +code --install-extension mechatroner.rainbow-csv +code --install-extension oderwat.indent-rainbow +code --install-extension pajoma.vscode-journal +code --install-extension telesoho.vscode-oss-markdown-paste-image +code --install-extension vscodevim.vim diff --git a/setup/code-plugins.sh b/setup/code-plugins.sh new file mode 100755 index 0000000..9cd7a55 --- /dev/null +++ b/setup/code-plugins.sh @@ -0,0 +1,7 @@ +code --install-extension benjpas.close-all +code --install-extension johnpapa.vscode-peacock +code --install-extension mechatroner.rainbow-csv +code --install-extension oderwat.indent-rainbow +code --install-extension pajoma.vscode-journal +code --install-extension telesoho.vscode-oss-markdown-paste-image +code --install-extension vscodevim.vim diff --git a/setup/vim.ps1 b/setup/vim_windows.ps1 similarity index 100% rename from setup/vim.ps1 rename to setup/vim_windows.ps1 diff --git a/setup/website.ps1 b/setup/website.ps1 new file mode 100644 index 0000000..62330bd --- /dev/null +++ b/setup/website.ps1 @@ -0,0 +1,4 @@ +if(-Not(Test-Path -Path ~/edthedev.github.io)) { + cd ~ + git clone git@github.com:edthedev/edthedev.github.io.git +} diff --git a/setup.sh b/setup_cli_basics.sh similarity index 87% rename from setup.sh rename to setup_cli_basics.sh index ff7b64c..b137b47 100755 --- a/setup.sh +++ b/setup_cli_basics.sh @@ -30,6 +30,5 @@ if [ -f ~/.gitconfig ]; then fi echo "************** Reminder to setup GitHub key" -echo "https://github.com/settings/keys" -echo "vim .git/config -- add: url = git@github.com:edthedev/dotfiles.git" +cat GitHubKey.md cat ~/.ssh/id_rsa.pub diff --git a/vimrc b/vimrc index 712d0c0..601a676 100644 --- a/vimrc +++ b/vimrc @@ -21,6 +21,15 @@ set omnifunc=syntaxcomplete#Complete filetype off " required +" ================= +" Install vim-plug if missing +" ================= +let data_dir = has('nvim') ? stdpath('data') . '/site' : '~/.vim' +if empty(glob(data_dir . '/autoload/plug.vim')) + silent execute '!curl -fLo '.data_dir.'/autoload/plug.vim --create-dirs https://raw.githubusercontent.com/junegunn/vim-plug/master/plug.vim' + autocmd VimEnter * PlugInstall --sync | source $MYVIMRC +endif + " ================= " Here be Plugins! " ================= diff --git a/install/ansible.ps1 b/win/install/ansible.ps1 similarity index 100% rename from install/ansible.ps1 rename to win/install/ansible.ps1 diff --git a/install/dev.ps1 b/win/install/dev.ps1 similarity index 100% rename from install/dev.ps1 rename to win/install/dev.ps1 diff --git a/install/vim.ps1 b/win/install/vim.ps1 similarity index 90% rename from install/vim.ps1 rename to win/install/vim.ps1 index fc17397..3f48cda 100644 --- a/install/vim.ps1 +++ b/win/install/vim.ps1 @@ -1,12 +1,12 @@ -<# -.SYNOPSIS - -Install Vim for Windows - -.NOTES - -Requires Chocolatey package manager. - -#> - +<# +.SYNOPSIS + +Install Vim for Windows + +.NOTES + +Requires Chocolatey package manager. + +#> + choco install vim \ No newline at end of file diff --git a/win/more.md b/win/more.md new file mode 100644 index 0000000..bb9f7ba --- /dev/null +++ b/win/more.md @@ -0,0 +1,6 @@ + +Archimate +`choco install archi` + +OWASP Zap +`choco install zap` \ No newline at end of file diff --git a/win/rdp.md b/win/rdp.md new file mode 100644 index 0000000..f0c3d08 --- /dev/null +++ b/win/rdp.md @@ -0,0 +1,9 @@ + +Enable incoming RDP. +```powershell +Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server'-name "fDenyTSConnections" -Value 0 +Enable-NetFirewallRule -DisplayGroup "Remote Desktop" +Set-ItemProperty -Path 'HKLM:\System\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp' -name "UserAuthentication" -Value 1 +``` + +Now reboot. \ No newline at end of file diff --git a/win/setup/load_dlls.ps1 b/win/setup/load_dlls.ps1 new file mode 100644 index 0000000..c291f88 --- /dev/null +++ b/win/setup/load_dlls.ps1 @@ -0,0 +1,2 @@ + +HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\SafeDllSearchMode \ No newline at end of file diff --git a/install/minion.ps1 b/win/setup/minion.ps1 similarity index 98% rename from install/minion.ps1 rename to win/setup/minion.ps1 index 1898187..089f380 100644 --- a/install/minion.ps1 +++ b/win/setup/minion.ps1 @@ -1,2 +1,2 @@ -cd c:\src +cd c:\src git clone https://github.com/edthedev/minion.git \ No newline at end of file diff --git a/win/show-file-extensions.ps1 b/win/show-file-extensions.ps1 new file mode 100644 index 0000000..ec11a0e --- /dev/null +++ b/win/show-file-extensions.ps1 @@ -0,0 +1,11 @@ +function ShowFileExtensions() +{ + # http://superuser.com/questions/666891/script-to-set-hide-file-extensions + Push-Location + Set-Location HKCU:\Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced + Set-ItemProperty . HideFileExt "0" + Pop-Location + Stop-Process -processName: Explorer -force # This will restart the Explorer service to make this work. +} + +ShowFileExtensions \ No newline at end of file diff --git a/win/start_windows.md b/win/start_windows.md new file mode 100644 index 0000000..539194e --- /dev/null +++ b/win/start_windows.md @@ -0,0 +1,58 @@ + +## Getting Started - Windows + +> Note: Bookmark this guide. You're going to reboot at least a few times. + +Optional - change host name +``` +Rename-Computer -NewName FOOOOOOO -Restart +``` + +1. [Install chocolatey](https://chocolatey.org/install) + +2. Tell `choco` to watch for reboots, as this is Windows. +``` +choco feature enable -name=exitOnRebootDetected +``` + +3. Install a decent terminal. This invokes a bunch of KBs. +```powershell +choco install microsoft-windows-terminal # reboot after +``` + +3. Set dark theme (non-admin prompt) +``` +Set-ItemProperty -Path HKCU:\SOFTWARE\Microsoft\Windows\CurrentVersion\Themes\Personalize -Name AppsUseLightTheme -Value 0 +``` + +4. Reboot after first setup - you may see errors in `choco` commands otherwise. +5. Set the PC time zone correctly - otherwise expect an install error in later `choco` commands. + +4. More packages +``` +choco install git +choco install vscode +choco install powertoys # reboot after +``` + +``` +git clone https://github.com/edthedev/dotfiles.git +cd dotfiles +code . +``` + +Admin prompt: +``` +Set-ExecutionPolicy -ExecutionPolicy RemoteSigned +``` + +Install VSCode plugins: +``` +.\setup\code-plugins.ps1 +``` + +Set git username. +``` +git config --global user.email "edward@delaporte.us" +git config --global user.name "Edward Delaporte" +``` diff --git a/win/stay_awake.ps1 b/win/stay_awake.ps1 new file mode 100644 index 0000000..aba956a --- /dev/null +++ b/win/stay_awake.ps1 @@ -0,0 +1,10 @@ +$wsh = New-Object -ComObject WScript.Shell +$minutes = 15 +do{ + "Staying awake for $minutes minutes" + $minutes-=1; + # Send Shift+F15 + $wsh.SendKeys('+{F15}') + Start-Sleep -seconds 59 +}until($minutes -lt 0) +# Thank you to http://www.zhornsoftware.co.uk/caffeine/