From: EdTheDev Date: Sun, 17 Jan 2021 23:27:08 +0000 (-0600) Subject: Merge branch 'master' of github.com:edthedev/dotfiles X-Git-Url: https://us-delaporte.pagekite.me/gitweb/dotfiles.git/commitdiff_plain/b7118db1d4cd260d6538e84438bfec80e2e14f52?hp=87107f770753704744a2abf60a07f3fd4036e6fe Merge branch 'master' of github.com:edthedev/dotfiles --- diff --git a/.gitignore b/.gitignore index dde2b51..81ad23c 100644 --- a/.gitignore +++ b/.gitignore @@ -1,2 +1,7 @@ *.log -DONE.md \ No newline at end of file +DONE.md +.github_access_token +env/* +*.json +OneTrust.ipynb +*.conf \ No newline at end of file diff --git a/.vscode/settings.json b/.vscode/settings.json index 4a059b8..bf73da0 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -15,5 +15,6 @@ "titleBar.inactiveBackground": "#21573299", "titleBar.inactiveForeground": "#e7e7e799" }, - "peacock.color": "#215732" + "peacock.color": "#215732", + "python.pythonPath": "/usr/bin/python3" } \ No newline at end of file diff --git a/Microsoft.PowerShell_profile.ps1 b/Microsoft.PowerShell_profile.ps1 index e75befa..7f54a1d 100644 --- a/Microsoft.PowerShell_profile.ps1 +++ b/Microsoft.PowerShell_profile.ps1 @@ -117,6 +117,11 @@ function Start-DockerFindSecrets { docker run -v /c/src:/etc/src dxa4481/trufflehog /etc/src/SecOps-Tools } +function Export-VSCodeExtensions { + code --list-extensions | Out-File -FilePath /src/dotfiles/vscode-extensions.txt + Get-Content -Path /src/dotfiles/vscode-extensions.txt +} + #requires -version 5.1 #ConvertTo-ASCIIArt.ps1 diff --git a/Toybox/Teams2Markdown.ps1 b/Toybox/Teams2Markdown.ps1 new file mode 100644 index 0000000..fc1a156 --- /dev/null +++ b/Toybox/Teams2Markdown.ps1 @@ -0,0 +1,52 @@ +<# +.SYNOPSIS + Converts a Microsoft Teams Project Board Excel export into Markdown. + +.PARAMETER Path + The path to an Excel file exported from a Microsoft Teams project. + +.PARAMETER StartRow + The first row of data in the Teams project Excel export. + Defaults to 5. + +.EXAMPLE + +> ./Teams2Markdown.ps1 -Path C:\tmp\TeamsExport.xlsx | Out-File c:\tmp\TeamsMarkdown.md + +.NOTES + +This script requires the Import-Excel module, available in PowerShell gallery. + +> Install-Module Import-Excel + +#> +param( + [string]$Path, + [int]$StartRow = 5 +) + +$xlData = Import-Excel -Path $Path -StartRow $StartRow + + # $xlData | Select-Object -First 2 | Format-List + +$xlData | Sort-Object { $_."Bucket Name" } | ForEach-Object { + + if(!$_."Task Name" -eq "") { + "" + "## $($_."Task Name") - $($_."Bucket Name")" + "" + + if(!$_."Description" -eq "") { + "$($_."Description")" + } + + if(!$_."Checklist Items" -eq "") { + $_."Checklist Items".split(';') | ForEach-Object { + "+ $($_)" + } + } + } +} + +"Generated by [Teams2Markdown Script][1]." +"[1]: https://github.com/edthedev/dotfiles/blob/master/Toybox/Teams2Markdown.ps1" \ No newline at end of file diff --git a/Toybox/salesforce.ps1 b/Toybox/salesforce.ps1 new file mode 100644 index 0000000..ddda7a0 --- /dev/null +++ b/Toybox/salesforce.ps1 @@ -0,0 +1,29 @@ +<# +.SYNOPSIS +Some notes on using the SalesForce API. + +.NOTES + +Requires PsIni + +> Install-Module PsIni + +#> + +# --- Arrange +$FileContent = Get-IniContent ".salesforce.conf" +$url = $FileContent['salesforce']['url'] +$api_url = "$url/services/data" + +# --- Act + +$aboutAPI = curl $api_url + +# --- Assert + +# Write-Output $api_url +# $aboutAPI | Format-List +$basicAPIInfo = $aboutAPI.Content | ConvertFrom-Json +return $basicAPIInfo + +# Write-Output $aboutAPI. diff --git a/bootstrap.ps1 b/bootstrap.ps1 index b297d75..807826c 100644 --- a/bootstrap.ps1 +++ b/bootstrap.ps1 @@ -19,18 +19,6 @@ if(! $profileContents -contains $sourceMeLine) { # TODO Install Chocolatey -# PoshGit -PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force - - -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 @@ -56,10 +44,6 @@ if($false) { choco install zap } -# Install GNU Make for Windows -if($false) { - choco install make -} ## TODO: Can I set this via command line: chrome://flags/#enable-force-dark if($doBootStrap) { @@ -72,6 +56,5 @@ if($false) { choco install archi } -if($false) { - choco install powershell-core -} \ No newline at end of file +# Install dev tools +./install/dev.ps1 \ No newline at end of file diff --git a/bootstrap_pi.sh b/bootstrap_pi.sh index d192d9d..145fbce 100755 --- a/bootstrap_pi.sh +++ b/bootstrap_pi.sh @@ -6,8 +6,8 @@ echo "Git, vi are already installed." mkdir -p ~/.installed -## Setup Git and Vim if [ ! -d ~/dotfiles ]; then + echo "************** Setup Git and Vim" sudo apt-get install git vim-nox cd ~; git clone git@github.com:edthedev/dotfiles.git fi @@ -15,6 +15,7 @@ fi # sudo apt-get install vim-nox if [ ! -f ~/.vimrc ]; then + echo "************** Configure Git and link Vimrc" git config --global user.email "edward@delaporte.us" git config --global user.name "Edward Delaporte" git config --global core.editor /usr/bin/vim @@ -22,12 +23,14 @@ if [ ! -f ~/.vimrc ]; then fi if [ ! -f ~/.installed/i3 ]; then + echo "************** Install i3 Window Manager" sudo apt-get install i3 touch ~/.installed/i3 fi ## Setup PowerShell if [ ! -f ~/.config/powershell/Microsoft.PowerShell_profile.ps1 ]; then + echo "************** Install PowerShell and setup profile" sudo apt-get install powershell chsh --shell /usr/bin/pwsh mkdir -p ~/.config/powershell/ @@ -36,6 +39,7 @@ fi ## Create SSH Keys if [ ! -f ~/.ssh/id_rsa ]; then + echo "************** Generate an SSH key" ssh-keygen fi @@ -47,17 +51,20 @@ fi ## Setup Screen if [ ! -f ~/.screenrc ]; then + echo "************** Install Screen" sudo apt-get install screen ln -s ~/dotfiles/screenrc ~/.screenrc fi ## Setup Vundle for Vim if [ ! -d ~/.vim/bundle ]; then + echo "************** Setup Vundle for Vim" git clone https://github.com/gmarik/Vundle.vim.git ~/.vim/bundle/Vundle.vim vim +BundleInstall +qall fi 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 - diff --git a/cheatsheets/c64.md b/cheatsheets/c64.md new file mode 100644 index 0000000..7c16e93 --- /dev/null +++ b/cheatsheets/c64.md @@ -0,0 +1,5 @@ +Docs are in +/usr/local/share/doc/vice + +Run command is: +C64DTV \ No newline at end of file diff --git a/cheatsheets/github.py b/cheatsheets/github.py new file mode 100644 index 0000000..dab4849 --- /dev/null +++ b/cheatsheets/github.py @@ -0,0 +1,58 @@ +""" +Recently Updated Open GitHub Issues +""" + +import http.client + +conn = http.client.HTTPSConnection("api.github.com") + +payload = "" +token = open('./.github_access_token').read() +headers = { 'authorization': "token {}".format(token), + 'User-Agent': 'Python Jupyter Notebook'} +conn.request("GET", "/issues?state=open&sort=updated", payload, headers) + +res = conn.getresponse() +data = res.read() + +results = data.decode("utf-8") + +data_file = 'gh_open.json' +f = open(data_file, "w") +f.write(results) +f.close() +print("Updated {} with {} length".format(data_file, len(results))) + +import pandas + +pdata = pandas.read_json(data_file) +# print(pdata.title.head(3)) + +from simple_rest_client import api + +token = open('./.github_access_token').read() +headers = { 'authorization': "token {}".format(token), + 'User-Agent': 'Python Jupyter Notebook'} +gh = api.API(api_root_url="https://api.github.com", headers=headers, + append_slash=False, + json_encode_body=True) + +gh.add_resource(resource_name='issues') +gh.issues.actions + +results = gh.issues.list(params=query) +titles = list(map(lambda t : t["title"], results.body)) + +from simple_rest_client import api + +token = open('./.github_access_token').read() +headers = { 'authorization': "token {}".format(token), + 'User-Agent': 'Python Jupyter Notebook'} +gh = api.API(api_root_url="https://api.github.com", headers=headers, + append_slash=False, + json_encode_body=True) + +gh.add_resource(resource_name='issues') +gh.issues.actions + +titles = list(map(lambda t : t["title"], results.body)) \ No newline at end of file diff --git a/cheatsheets/requirements.txt b/cheatsheets/requirements.txt new file mode 100644 index 0000000..357b0d2 --- /dev/null +++ b/cheatsheets/requirements.txt @@ -0,0 +1,9 @@ +PyGitHubcertifi==2020.6.20 +chardet==3.0.4 +Deprecated==1.2.10 +idna==2.10 +PyGithub==1.53 +PyJWT==1.7.1 +requests==2.24.0 +urllib3==1.25.11 +wrapt==1.12.1 \ No newline at end of file diff --git a/cheatsheets/setup-i3.md b/cheatsheets/setup-i3.md new file mode 100644 index 0000000..3b1dedd --- /dev/null +++ b/cheatsheets/setup-i3.md @@ -0,0 +1,12 @@ +# Reminder how to Setup I3 Window Manager on Raspberry Pi + +Modify this file to add `~/.config/lxsession/LXDE-pi/desktop.conf` + +``` +[Session] +window_manager=/usr/bin/i3 +``` + +Remember `alt+d` to run commands. + +You might need to hit `alt+2` as space 1 seems to get filled with the GTK desktop. diff --git a/cheatsheets/setup.ps1 b/cheatsheets/setup.ps1 new file mode 100644 index 0000000..fd68d89 --- /dev/null +++ b/cheatsheets/setup.ps1 @@ -0,0 +1 @@ +py -m venv env diff --git a/install_art.sh b/install/art.sh old mode 100755 new mode 100644 similarity index 83% rename from install_art.sh rename to install/art.sh index caa2c83..905dfd8 --- a/install_art.sh +++ b/install/art.sh @@ -5,4 +5,4 @@ if [ ! -f ~/.installed/gimp ]; then touch ~/.installed/gimp fi -ls -al ~/.installeear +ls -al ~/.installed diff --git a/install/dev.ps1 b/install/dev.ps1 new file mode 100644 index 0000000..53d4877 --- /dev/null +++ b/install/dev.ps1 @@ -0,0 +1,20 @@ +if(-Not(Test-Path -Path ~/.installed)) { + New-Item -ItemType Directory -Path ~/.installed +} + +if(-Not(Test-Path -Path ~/.installed/dev)) { + choco install docker-desktop + choco install powershell-core + choco install make # Install GNU Make for Windows + choco install act-cli # GitHub action runner + # PowerShell git aware prompt + PowerShellGet\Install-Module posh-git -Scope CurrentUser -Force + New-Item -ItemType File -Path ~/.installed/dev +} + +if(-Not(Test-Path -Path ~/.ssh/id_rsa.pub)) { + choco install gnupg + gpg --full-generate-key +} + +Get-ChildItem -Path ~/.installed \ No newline at end of file diff --git a/install/exfat_pi.sh b/install/exfat_pi.sh new file mode 100644 index 0000000..1f703aa --- /dev/null +++ b/install/exfat_pi.sh @@ -0,0 +1,4 @@ +sudo apt-get update +sudo apt-get upgrade +sudo apt-get install exfat-fuse +sudo apt-get install exfat-utils \ No newline at end of file diff --git a/install/install-vscode-journal.sh b/install/install-vscode-journal.sh new file mode 100755 index 0000000..e358f8e --- /dev/null +++ b/install/install-vscode-journal.sh @@ -0,0 +1,18 @@ +#/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/vice_pi.sh b/install/vice_pi.sh new file mode 100755 index 0000000..1f6736c --- /dev/null +++ b/install/vice_pi.sh @@ -0,0 +1,21 @@ +cd ~/src +mkdir vice-src +cd ~/src/vice-src + +sudo apt install autoconf automake build-essential byacc dos2unix flex libavcodec-dev libavformat-dev libgtk2.0-cil-dev libgtkglext1-dev libmp3lame-dev libmpg123-dev libpcap-dev libpulse-dev libreadline-dev libswscale-dev libvte-dev libxaw7-dev subversion yasm libgtk3.0-cil-dev xa65 libsdl2-dev libsdl2-image-dev libgtk-3-dev libglew-dev + +mkdir -p src + +cd src + +svn checkout https://svn.code.sf.net/p/vice-emu/code/trunk trunk + +cd trunk/vice + +./autogen.sh + +./configure --disable-pdf-docs + +make -j4 + +sudo make install \ No newline at end of file diff --git a/this.code-workspace b/this.code-workspace index 8c51176..f3c688b 100644 --- a/this.code-workspace +++ b/this.code-workspace @@ -21,6 +21,7 @@ "titleBar.inactiveBackground": "#42b88399", "titleBar.inactiveForeground": "#15202b99" }, - "peacock.color": "#42b883" + "peacock.color": "#42b883", + "python.dataScience.jupyterServerURI": "local" } } \ No newline at end of file diff --git a/vaultconfig.hcl b/vaultconfig.hcl deleted file mode 100644 index fa135b0..0000000 --- a/vaultconfig.hcl +++ /dev/null @@ -1,9 +0,0 @@ -storage "consul" { - address = "127.0.0.1:8500" - path = "vault/" -} - -listener "tcp" { - address = "127.0.0.1:8200" - tls_disable = 1 -} \ No newline at end of file diff --git a/vscode-extensions.txt b/vscode-extensions.txt new file mode 100644 index 0000000..d3a7ef2 Binary files /dev/null and b/vscode-extensions.txt differ