This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # rest of existing .bashrc goes here | |
| # set prompt, green username followed by blue current path | |
| PS1='\n[\[\033[01;32m\]\u@\h \[\033[01;34m\]\w\[\033[00m\]]\$ ' | |
| # ignore pwd, exit, quit, q etc. commands in bash history | |
| HISTIGNORE="pwd":"exit":"quit":"q":"history" | |
| # add timestamps to history | |
| HISTTIMEFORMAT="%F %T " | |
| # don't put duplicate lines or lines starting with space in the history. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| syntax on |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| # Respect default shortcuts. | |
| $include /etc/inputrc | |
| ## arrow up | |
| "\e[A":history-search-backward | |
| ## arrow down | |
| "\e[B":history-search-forward | |
| ## esc = clear whole line | |
| "\e": kill-whole-line |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Get remote desktop sessions for a specified computer or computers, from the Terminal | |
| Services event log. Adapted from https://serverfault.com/a/687079/78216, https://ss64.com/ps/get-winevent.html | |
| Requires appropriate permission on computers to call Get-WinEvent remotely, PowerShell Active Directory module. | |
| If using Windows Firewall, may require enabling "Remote Event Log Management" rule (from | |
| https://social.technet.microsoft.com/Forums/en-US/69fba4e0-a248-4d1c-9e0d-80071a2a446d/getwinevent-the-rpc-server-is-unavailable) | |
| By Thomas Williams <https://github.com/thomasswilliams> | |
| .DESCRIPTION |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| Get history from Windows event log for events relating to startup & shutdown for a specified computer or computers. | |
| Adapted from https://social.technet.microsoft.com/wiki/contents/articles/17889.powershell-script-for-shutdownreboot-events-tracker.aspx | |
| By Thomas Williams <https://github.com/thomasswilliams> | |
| .DESCRIPTION | |
| Pass one or more computer names, or run without parameters to be prompted for computer name(s). | |
| .PARAMETER computers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <# | |
| .SYNOPSIS | |
| For a passed computer, collection of computers, or computer name(s) from prompt, return the boot time | |
| and calculated uptime in days, hours and minutes. | |
| By Thomas Williams <https://github.com/thomasswilliams> | |
| .DESCRIPTION | |
| Pass one or more computer names, or run without parameters to be prompted for computer name(s). Queries | |
| WMI/CIM Win32_OperatingSystem class "LastBootUpTime", so need appropriate permissions, and WS-Management | |
| service needs to be running. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| node_modules | |
| dist |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| { | |
| "name": "pedals-api-nov-2019", | |
| "version": "0.0.2", | |
| "scripts": { | |
| "serve": "npm run tsc && node ./dist/server.js", | |
| "tsc": "tsc", | |
| "lint": "eslint \"src/**/*.ts\"" | |
| }, | |
| "eslintConfig": { | |
| "root": true, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Show hidden characters
| { | |
| "compilerOptions": { | |
| "module": "commonjs", | |
| "esModuleInterop": true, | |
| "target": "es6", | |
| "noImplicitAny": true, | |
| "moduleResolution": "node", | |
| "sourceMap": true, | |
| "outDir": "dist", | |
| "baseUrl": ".", |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // in src directory | |
| import express from "express"; | |
| const app = express(); | |
| // route: get pedals collection | |
| app.get("/pedals", (req, res) => { | |
| console.log("Got pedals collection"); | |
| // hard-code JSON response | |
| res.send({ pedals: [{ name: "Boss SY-1", id: 1 }] }); |
NewerOlder