]> apps.delaporte.us Git - dotfiles.git/commitdiff
Merge branch 'master' of github.com:edthedev/dotfiles
authorEdTheDev <edward@delaporte.us>
Sun, 17 Jan 2021 23:27:08 +0000 (17:27 -0600)
committerEdTheDev <edward@delaporte.us>
Sun, 17 Jan 2021 23:27:08 +0000 (17:27 -0600)
20 files changed:
.gitignore
.vscode/settings.json
Microsoft.PowerShell_profile.ps1
Toybox/Teams2Markdown.ps1 [new file with mode: 0644]
Toybox/salesforce.ps1 [new file with mode: 0644]
bootstrap.ps1
bootstrap_pi.sh
cheatsheets/c64.md [new file with mode: 0644]
cheatsheets/github.py [new file with mode: 0644]
cheatsheets/requirements.txt [new file with mode: 0644]
cheatsheets/setup-i3.md [new file with mode: 0644]
cheatsheets/setup.ps1 [new file with mode: 0644]
install/art.sh [moved from install_art.sh with 83% similarity, mode: 0644]
install/dev.ps1 [new file with mode: 0644]
install/exfat_pi.sh [new file with mode: 0644]
install/install-vscode-journal.sh [new file with mode: 0755]
install/vice_pi.sh [new file with mode: 0755]
this.code-workspace
vaultconfig.hcl [deleted file]
vscode-extensions.txt [new file with mode: 0644]

index dde2b51448a8a8ff654683aec57971e20db32ba6..81ad23c76eb110259b07d922e6e3f9d3548a6229 100644 (file)
@@ -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
index 4a059b845e06cc3e61348bff8e9eee94d399bdcd..bf73da097fa830fbc0d79ca0b1256f2283d02b8e 100644 (file)
@@ -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
index e75befa7a4cd63c73d299808780d803169a0cd8a..7f54a1d89187e408dd4bfa7fe5269caa976e321a 100644 (file)
@@ -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 (file)
index 0000000..fc1a156
--- /dev/null
@@ -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 (file)
index 0000000..ddda7a0
--- /dev/null
@@ -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.
index b297d750419ed5ec4bdb445a1c79ada670e3ed78..807826c8a3ba1657504e1fd1f264df96a2db1ec9 100644 (file)
@@ -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
index d192d9d874c1d6db1c3abaa7287e73754c9e8d7c..145fbce20b52eafbdb9eae274d20dc77e8c55d1e 100755 (executable)
@@ -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 (file)
index 0000000..7c16e93
--- /dev/null
@@ -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 (file)
index 0000000..dab4849
--- /dev/null
@@ -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 (file)
index 0000000..357b0d2
--- /dev/null
@@ -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 (file)
index 0000000..3b1dedd
--- /dev/null
@@ -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 (file)
index 0000000..fd68d89
--- /dev/null
@@ -0,0 +1 @@
+py -m venv env
old mode 100755 (executable)
new mode 100644 (file)
similarity index 83%
rename from install_art.sh
rename to install/art.sh
index caa2c83..905dfd8
@@ -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 (file)
index 0000000..53d4877
--- /dev/null
@@ -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 (file)
index 0000000..1f703aa
--- /dev/null
@@ -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 (executable)
index 0000000..e358f8e
--- /dev/null
@@ -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 (executable)
index 0000000..1f6736c
--- /dev/null
@@ -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
index 8c511763d01876cb4204ea2aa22fa0ef9aaa45ab..f3c688bcdb154cc36fb70668cfb1a7d6acca24fc 100644 (file)
@@ -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 (file)
index fa135b0..0000000
+++ /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 (file)
index 0000000..d3a7ef2
Binary files /dev/null and b/vscode-extensions.txt differ