]> us-delaporte.pagekite.me Git - dotfiles.git/commitdiff
Move install scripts together.
authorEdward Delaporte <delaport@illinois.edu>
Fri, 11 Sep 2020 15:16:35 +0000 (10:16 -0500)
committerEdward Delaporte <delaport@illinois.edu>
Tue, 1 Dec 2020 22:24:55 +0000 (16:24 -0600)
12 files changed:
.gitignore
.vscode/settings.json
Microsoft.PowerShell_profile.ps1
bootstrap.ps1
cheatsheets/github.py [new file with mode: 0644]
cheatsheets/requirements.txt [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]
this.code-workspace
vaultconfig.hcl [deleted file]
vscode-extensions.txt [new file with mode: 0644]

index dde2b51448a8a8ff654683aec57971e20db32ba6..54d8b36880badc39e8fdb8761e0a5b2ef1228470 100644 (file)
@@ -1,2 +1,6 @@
 *.log
-DONE.md
\ No newline at end of file
+DONE.md
+.github_access_token
+env/*
+*.json
+OneTrust.ipynb
\ No newline at end of file
index 4a059b845e06cc3e61348bff8e9eee94d399bdcd..d84e3d06ad319734bb1ca7d027138a37f46da206 100644 (file)
@@ -15,5 +15,6 @@
     "titleBar.inactiveBackground": "#21573299",
     "titleBar.inactiveForeground": "#e7e7e799"
   },
-  "peacock.color": "#215732"
+  "peacock.color": "#215732",
+  "python.pythonPath": "c:\\src\\dotfiles\\env\\Scripts\\python.exe"
 }
\ No newline at end of file
index 02abc31fff3658fcd77cbc465345b9ea7997b641..7f54a1d89187e408dd4bfa7fe5269caa976e321a 100644 (file)
@@ -29,7 +29,11 @@ $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
+   Get-ChildItem c:\ -r| sort -descending -property length | select -first 10 name, Length, FullName
+}
+
+function List-DriveSpace() {
+  Get-PSDrive C | Select-Object Used,Free
 }
 
 
@@ -113,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
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
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.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
index a63f2972a307b097428fb3a2040bf9b7577d80b8..f3c688bcdb154cc36fb70668cfb1a7d6acca24fc 100644 (file)
@@ -2,9 +2,6 @@
        "folders": [
                {
                        "path": "."
-               },
-               {
-                       "path": ".."
                }
        ],
        "settings": {
@@ -24,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