Ken Schaefer
2 years ago
commit
85f8eb183e
16 changed files with 863 additions and 0 deletions
@ -0,0 +1,159 @@ |
|||||||
|
# DOCKER BASICS |
||||||
|
|
||||||
|
## Table of Contents |
||||||
|
1. [Introduction](#introduction) |
||||||
|
2. [Installation](#ubuntu-installation) |
||||||
|
3. [Building Images](#building-images) |
||||||
|
- [Basic build command](#basic-build-command) |
||||||
|
4. [Managing Images](#managing-images) |
||||||
|
|
||||||
|
## INTRODUCTION |
||||||
|
|
||||||
|
|
||||||
|
## UBUNTU INSTALLATION |
||||||
|
|
||||||
|
### Base Install |
||||||
|
As usual, update your packages |
||||||
|
|
||||||
|
`sudo apt update` |
||||||
|
|
||||||
|
Prepare Ubuntu for the Docker installation |
||||||
|
|
||||||
|
`sudo apt install apt-transport-https ca-certificates curl software-properties-common` |
||||||
|
|
||||||
|
`curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg` |
||||||
|
|
||||||
|
`echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null` |
||||||
|
|
||||||
|
Update the packages again |
||||||
|
|
||||||
|
`sudo apt update` |
||||||
|
|
||||||
|
Now do the install from Docker |
||||||
|
|
||||||
|
`apt-cache policy docker-ce` |
||||||
|
|
||||||
|
`sudo apt install docker-ce` |
||||||
|
|
||||||
|
Make sure it is running |
||||||
|
|
||||||
|
`sudo systemctl status docker` |
||||||
|
|
||||||
|
### Put yourself in the Docker group |
||||||
|
Do this so you don't have to use sudo all the time |
||||||
|
|
||||||
|
`sudo usermod -aG docker ${USER}` |
||||||
|
|
||||||
|
You can reboot to make it take effect or... |
||||||
|
|
||||||
|
`su - ${USER}` |
||||||
|
|
||||||
|
## BUILDING IMAGES |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
### Basic build command |
||||||
|
|
||||||
|
`docker build .` |
||||||
|
|
||||||
|
### Assign a Name:Tag to the build |
||||||
|
|
||||||
|
Assign a name and tag to the image because you are a responsible dev. |
||||||
|
|
||||||
|
`docker build -t name:tag .` |
||||||
|
|
||||||
|
## MANAGING IMAGES |
||||||
|
|
||||||
|
### List out the images installed on this server |
||||||
|
`docker images` |
||||||
|
|
||||||
|
### Remove an image from this server |
||||||
|
`docker rmi {imagename}` |
||||||
|
|
||||||
|
### Remove all dangling (untagged) images |
||||||
|
`docker image prune` |
||||||
|
|
||||||
|
## MANAGING CONTAINERS |
||||||
|
|
||||||
|
Parameters for running a container |
||||||
|
|Switch | Description | |
||||||
|
|-------|-------| |
||||||
|
|-p |(port) map a port| |
||||||
|
|-d |(detached mode) run in the background| |
||||||
|
|-it |(interactive mode) not -d| |
||||||
|
|--rm |(remove) the container when the service is stopped| |
||||||
|
|--name |(name) give the container a name| |
||||||
|
|-v |(volume) assigns a named volume to the container| |
||||||
|
|
||||||
|
`docker run -p 3000:80 -d --rm --name goalsapp goals:latest` |
||||||
|
|
||||||
|
### List all running containers |
||||||
|
`docker ps` |
||||||
|
|
||||||
|
### List all containers (running and not running) |
||||||
|
`docker ps -a` |
||||||
|
|
||||||
|
### Stop a container |
||||||
|
`docker stop {containername}` |
||||||
|
|
||||||
|
### Remove a stopped container |
||||||
|
`docker rm {containername}` |
||||||
|
|
||||||
|
### Remove ALL stopped containers |
||||||
|
`docker container prune` |
||||||
|
|
||||||
|
## Volumes |
||||||
|
|
||||||
|
Volumes store persistent data that survives after a container shuts down. These are folders on the host machine that are mounted in the container. |
||||||
|
|
||||||
|
Volumes are managed by Docker. This means that we do not know where the volume is located and have no ability to manage them. Bind mounts solve that problem. |
||||||
|
|
||||||
|
### Add a volume to the container |
||||||
|
|
||||||
|
This command creates an anonymous volume. Anonymous volumes are not persisted when the container is removed. |
||||||
|
|
||||||
|
`VOLUME ["{path}"]` |
||||||
|
`VOLUME ["app/feedback"]` |
||||||
|
|
||||||
|
Named volumes persist data when the container is removed. Named volumes are NOT defined in the Dockerfile, rather it is done at the command line when running the container. |
||||||
|
|
||||||
|
`-v {volume name}:{mount location in container}` |
||||||
|
|
||||||
|
`docker run -d -p 3000:80 --rm --name feedback-app -v feedback:/app/feedback feedback-node:volumes` |
||||||
|
|
||||||
|
### List volumes |
||||||
|
|
||||||
|
`docker volume ls` |
||||||
|
|
||||||
|
### Troubleshooting |
||||||
|
|
||||||
|
`docker logs {appname}` |
||||||
|
|
||||||
|
## Bind Mounts |
||||||
|
|
||||||
|
Like named volumes but we have management control over the file system. Bind mounts are not created in the Dockerfile. Bind mounts are created from terminal. |
||||||
|
|
||||||
|
A bind mount is created by adding a second -v command. Should use quotes to protect the absolute path. |
||||||
|
|
||||||
|
`-v "{absolute path on host file system}:{mount location in container}"` |
||||||
|
|
||||||
|
`docker run -d -p 3000:80 --rm --name feedback-app -v feedback:/app/feedback -v "/home/kschaefer/repos/webdev/docker/data-volumes-01-starting-setup:/app" feedback-node:volumes` |
||||||
|
|
||||||
|
If you mount a volume to the app folder in the way that this command above does, then the mount will overwrite everything that the COPY and RUN commands do in the Dockerfile. This command is overwriting the container folder with the contents of the local host folder. Since the local host does not have the same npm dependencies as the container then we get an issue. |
||||||
|
|
||||||
|
The solution is to use an anonymous volume. In the following command the folder that is defined in the anon volume is protected. |
||||||
|
|
||||||
|
`docker run -d -p 3000:80 --rm --name feedback-app -v feedback:/app/feedback -v "/home/kschaefer/repos/webdev/docker/data-volumes-01-starting-setup:/app" -v /app/node_modules feedback-node:volumes` |
||||||
|
|
||||||
|
🛸 Why do this? Now we can make changes to the HTML files and we do NOT have to rebuild the container. |
||||||
|
|
||||||
|
### Read Only Volume |
||||||
|
When using a Bind Mount, the local drive that is mapped to the container is writable by the container. Since we probably don't want the container writing back to our source-code marking the volume as read-only is a good idea. Do this by adding :ro to the end of the volume declaration. |
||||||
|
|
||||||
|
`docker run -d -p 3000:80 --rm --name feedback-app -v feedback:/app/feedback -v "/home/kschaefer/repos/webdev/docker/data-volumes-01-starting-setup:/app:ro" -v /app/node_modules feedback-node:volumes` |
||||||
|
|
||||||
|
You can add volume declarations after the bind-mount to make subfolders writable if they need it. Use anonymous folders to do this. In the above example, all of app is read only but node_modules can be written by the container. |
||||||
|
|
||||||
|
## References |
||||||
|
|
||||||
|
[Docker & Kubernetes: The Practical Guide](https://www.udemy.com/course/docker-kubernetes-the-practical-guide/) |
@ -0,0 +1,12 @@ |
|||||||
|
Emmet Commands make coding easier |
||||||
|
|
||||||
|
! |
||||||
|
Fills in a basic HTML5 template |
||||||
|
|
||||||
|
.classname |
||||||
|
Creates a div with this classname |
||||||
|
|
||||||
|
#id |
||||||
|
Creates a div with this id |
||||||
|
|
||||||
|
Can use the above 2 items with HTML tags to create the same |
@ -0,0 +1,23 @@ |
|||||||
|
# Using Markdown to learn Markdown |
||||||
|
|
||||||
|
## Table of contents |
||||||
|
1. [Introduction](#introduction) |
||||||
|
2. [Paragraph 1](#paragraph-1) |
||||||
|
3. [References](#references) |
||||||
|
4. [Other interesting files](#other-interesting-files) |
||||||
|
|
||||||
|
## Introduction <a name="introduction"></a> |
||||||
|
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam nisl nisi, maximus vel elit sed, rutrum suscipit libero. Proin ullamcorper sagittis dui, et luctus odio hendrerit ornare. Sed fringilla fringilla ligula vitae porttitor. Integer odio dui, malesuada a lorem vel, tincidunt malesuada nisi. Suspendisse lacinia vel lectus vel mattis. Etiam iaculis turpis ut sem vulputate viverra. Nunc nec ullamcorper felis, at aliquam purus. Nunc tincidunt sapien purus. Donec interdum iaculis ipsum et maximus. Nam justo metus, volutpat eget libero at, malesuada viverra lorem. Ut sed dictum felis. Aenean tempus ipsum quam, et mollis nunc maximus id. |
||||||
|
|
||||||
|
### Section 1 |
||||||
|
|
||||||
|
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Aliquam nisl nisi, maximus vel elit sed, rutrum suscipit libero. Proin ullamcorper sagittis dui, et luctus odio hendrerit ornare. Sed fringilla fringilla ligula vitae porttitor. Integer odio dui, malesuada a lorem vel, tincidunt malesuada nisi. Suspendisse lacinia vel lectus vel mattis. Etiam iaculis turpis ut sem vulputate viverra. Nunc nec ullamcorper felis, at aliquam purus. Nunc tincidunt sapien purus. Donec interdum iaculis ipsum et maximus. Nam justo metus, volutpat eget libero at, malesuada viverra lorem. Ut sed dictum felis. Aenean tempus ipsum quam, et mollis nunc maximus id. |
||||||
|
|
||||||
|
## References |
||||||
|
|
||||||
|
[Google](https://www.google.com) |
||||||
|
|
||||||
|
## Other interesting files |
||||||
|
|
||||||
|
[Docker](./docker.md) |
@ -0,0 +1,205 @@ |
|||||||
|
# Networking Fundamentals |
||||||
|
|
||||||
|
## Table of Contents |
||||||
|
1. [OSI Network Model](#open-systems-interconnect-(osi)-network-model) |
||||||
|
2. [Protocols and Ports](#protocols-and-ports) |
||||||
|
|
||||||
|
## Open Systems Interconnect (OSI) Network Model |
||||||
|
|
||||||
|
A conceptual model that communicates the ways in which different systems work together in a network. |
||||||
|
|
||||||
|
| Layer | Description | |
||||||
|
|-------|-------| |
||||||
|
| Physical | Responsible for the transmission and reception of unstructured raw data between a device and a physical transmission medium. |
||||||
|
| Data Link | Provides node to node data transfer between two directly connected nodes. |
||||||
|
| Network | Provides the functional and procedural means of transferring packets from one node to another. This is where addressing and routing happens. |
||||||
|
| Transport | Makes the connection between a source and a destination. |
||||||
|
| Session | Controls the connections between computers. |
||||||
|
| Presentation | Establishes context between application layer entities. |
||||||
|
| Appliation | Interacts with software applications that implement communications. |
||||||
|
|
||||||
|
## Protocols and Ports |
||||||
|
|
||||||
|
Protocols are an Application Layer component. Ports are a Transport Layer component that is matched to the protocol. The port number helps the lower layer protocols understand which application is being used in the communication. |
||||||
|
|
||||||
|
|
||||||
|
| Service | Protocol | Port | |
||||||
|
|-------|-------|-------| |
||||||
|
| Transferring data | HTTP / HTTPS | 80 / 443 | |
||||||
|
| File transfer | FTP / sFTP / TFTP / SMB | 20 21 / 22 / 69 / 445 | |
||||||
|
| Email | POP3 / IMAP / SMTP | 110 995 / 143 993 / 25 465| |
||||||
|
| Authentication | LDAP / LDAPs | 389 / 636 | |
||||||
|
|
||||||
|
|
||||||
|
| Network Service | Description | |
||||||
|
|-------|-------| |
||||||
|
| DHCP | Dynamic addresses | |
||||||
|
| DNS | Name resolution | |
||||||
|
| NTP | Network Time Protocol | |
||||||
|
|
||||||
|
### Utilities |
||||||
|
|
||||||
|
`nslookup` |
||||||
|
|
||||||
|
## Tranmission Control Protocol |
||||||
|
|
||||||
|
This is a connection oriented protocol that establishes communications between a client and a server. This protocol prioritizes quality over time, therefore it contains error checking and recovery to ensure that a message is complete. |
||||||
|
|
||||||
|
TCP uses the 3 way handshake to establish a connection. The client starts by sending a SYN message to request a connection, the server sends back an ACK message to confirm the connection, lastly the client uses a protocol (like HTTP) to send the message and get back a response. |
||||||
|
|
||||||
|
Connections are gracefully closed with a 4 way disconnect. The server sends a FIN message and the client sends an ACK message, then they do it again. |
||||||
|
|
||||||
|
## User Datagram Protocol |
||||||
|
|
||||||
|
This is a connection-less protocol that prioritizes time over quality. This services is more like a broadcast than a phone call. Used for things like DNS where efficient data transfer is key. |
||||||
|
|
||||||
|
## Intro to Binary and Hexadecimal |
||||||
|
|
||||||
|
Converting binary to decimal. Multiply the value in the placeholder by the value of the placeholder and add the results together. |
||||||
|
|
||||||
|
``` |
||||||
|
128 64 32 16 8 4 2 1 |
||||||
|
1 1 0 0 0 0 0 0 |
||||||
|
128 64 0 0 0 0 0 0 = 192 |
||||||
|
``` |
||||||
|
|
||||||
|
Converting decimal to binary. Start with the highest place that you can subtract from the decimal number, then continue with the remainder until you get to 0. |
||||||
|
|
||||||
|
Hexadecimal is base 10 where the numbers are 1 - 9 then A - F with 10 being 16. |
||||||
|
|
||||||
|
## IP Addressing |
||||||
|
|
||||||
|
IP addresses live in layer 3 of the OSI model. Every device on the internet must have a unique IP address. An IP address consists of two components, the network address and the host address. |
||||||
|
|
||||||
|
All IP addresses consist of 4 8-bit numbers separated by decimals. |
||||||
|
|
||||||
|
``` |
||||||
|
203.0.113.10 |
||||||
|
11001011 00000000 01110001 00001010 |
||||||
|
``` |
||||||
|
|
||||||
|
### Classful vs Classless addressing |
||||||
|
|
||||||
|
Classless addressing is the modern approach. This approach uses a subnet mask to differentiate the network portion of the address from the host portion. The subnet mask uses 1 to mask out the network portion of the address and 0 for the host portion. |
||||||
|
|
||||||
|
``` |
||||||
|
203.0.113.10 |
||||||
|
11001011 00000000 01110001 00001010 |
||||||
|
|
||||||
|
11111111 11111111 11111111 00000000 |
||||||
|
255.255.255.0 |
||||||
|
``` |
||||||
|
|
||||||
|
Classful addressing was the old way of determining network and host. These were the old A, B, C, D, and E networks. The public internet is still based on the first three networks. |
||||||
|
|
||||||
|
A network address consists of the network address followed by a host portion with only 0s. A broadcast address is the network followed by all 1s in the host portion. The host address is anything in the host portion that is not all 0s and all 1s. |
||||||
|
|
||||||
|
### CIDR Notation |
||||||
|
|
||||||
|
A shortcut method for writing an address that shows the number of bits in the subnet mask. |
||||||
|
|
||||||
|
``` |
||||||
|
203.0.113.10/24 |
||||||
|
``` |
||||||
|
|
||||||
|
### Reserved network addresses |
||||||
|
|
||||||
|
These are reserved for use on private networks. |
||||||
|
|
||||||
|
| Network | Mask | CIDR | |
||||||
|
|-------|-------|-------| |
||||||
|
| 10.0.0.0 | 10.255.255.255 | 10.0.0.0/8 | |
||||||
|
| 172.16.0.0 | 172.31.255.255 | 172.16.0.0/12 | |
||||||
|
| 192.168.0.0 | 192.168.255.255 | 192.168.0.0/16 | |
||||||
|
|
||||||
|
## Subnetting |
||||||
|
|
||||||
|
## IPv6 |
||||||
|
|
||||||
|
### Address sizes |
||||||
|
**IPv4** are 32bits long in 4 octets |
||||||
|
**IPv6** are 128bits long in 8 hextets |
||||||
|
|
||||||
|
IPv6 are written in hex in blocks of 4 digits. |
||||||
|
``` |
||||||
|
2001:0DB8:0002:008D:0000:0000:00A5:52F5 |
||||||
|
``` |
||||||
|
|
||||||
|
In IPv6 the network portion is the first 64 bits and the host portion (interface identifier) is the last 64 bits. |
||||||
|
|
||||||
|
Reduce the address: |
||||||
|
- remove leading 0s |
||||||
|
- Eliminate sets of 0 with a :: |
||||||
|
- Can only use one :: in an address |
||||||
|
|
||||||
|
``` |
||||||
|
2001:DB8:2:8D::A5:52F5 |
||||||
|
``` |
||||||
|
|
||||||
|
## Ethernet and Switching |
||||||
|
|
||||||
|
Ethernet and switching exists at layer 2. The protocols at this level govern how devices connect to each other and communicate from point to point. |
||||||
|
|
||||||
|
CSMA/CD - Carrier Sense Multiple Access with Collision Detection |
||||||
|
|
||||||
|
This was the original standard to describe ethernet. When one device needs to send a message to another device on the network, it will send out a pulse to all devices on the network. All devices will get the message but only the intended device will send back an acknowledgement. |
||||||
|
|
||||||
|
### Ethernet Frame |
||||||
|
|
||||||
|
The ethernet frame has not changed since its beginning. Speeds and hardware have changed, but not the basic form of the frame. The frame information facilitiates the communication on Ethernet. Everything except the data packet are the frame information. |
||||||
|
|
||||||
|
| Destination Mac | Source Mac | Type | Data(Packet) | FCS | |
||||||
|
|-------|-------|-------|-------|-------| |
||||||
|
| 48 bit | 48 bit | 16 bit | MAX 1500 bytes | 32 bit | |
||||||
|
|
||||||
|
The type field tells what type of data is being transferred |
||||||
|
The frame check sequence (FCS) validates the frame |
||||||
|
|
||||||
|
### Switches |
||||||
|
|
||||||
|
Switches work by mapping the ports on the switch to the MAC addresses of the devices connected to that port. |
||||||
|
|
||||||
|
## Switching Features |
||||||
|
|
||||||
|
### VLANS |
||||||
|
|
||||||
|
Splitting a physical switch into multiple domains. Each VLAN exists on its own Layer-3 IP network. |
||||||
|
|
||||||
|
VLANs will sement your network based on specific functions. |
||||||
|
|
||||||
|
## IP Routing |
||||||
|
|
||||||
|
Address Resolution Protocol - gets a Layer-2 MAC address when all we have is a Layer-3 IP address. |
||||||
|
|
||||||
|
The ARP table is stored on the client device. The ARP table can be viewed on your PC. |
||||||
|
|
||||||
|
`arp -a` |
||||||
|
|
||||||
|
The default Gateway and the Router are the same thing. |
||||||
|
|
||||||
|
The router is used when the destination IP address is not on the same network as the source. |
||||||
|
|
||||||
|
The tracert utility shows a listing of all routers that a message crosses. |
||||||
|
|
||||||
|
`tracert -d 8.8.8.8` |
||||||
|
|
||||||
|
## Network Services |
||||||
|
|
||||||
|
### Network Topologies |
||||||
|
|
||||||
|
1. LAN (Local Area Network) |
||||||
|
2. WLAN (Wireless Local Area Network) |
||||||
|
3. WAN (Wide Area Network) |
||||||
|
4. SAN (Storage Area Network) |
||||||
|
5. PAN (Personal Area Network) - Hotspot |
||||||
|
|
||||||
|
### Network Address Translation (NAT) |
||||||
|
|
||||||
|
The default gateway will replace the local private IP address with the public IP address assigned to the router. It will also convert public messages to private. |
||||||
|
|
||||||
|
### Access Control Lists (ACL) |
||||||
|
|
||||||
|
A mechanism for flagging bad servers. |
||||||
|
|
||||||
|
## References |
||||||
|
[Wikipedia Article](https://en.wikipedia.org/wiki/OSI_model) |
@ -0,0 +1,22 @@ |
|||||||
|
# Splunk Enterprise on-prem |
||||||
|
|
||||||
|
## Setup |
||||||
|
### Dependencies |
||||||
|
- wget |
||||||
|
- net-tools |
||||||
|
|
||||||
|
### Download Splunk Enterprise |
||||||
|
|
||||||
|
`wget -O splunk-8.1.3-63079c59e632-linux-2.6-amd64.deb 'https://www.splunk.com/bin/splunk/DownloadActivityServlet?architecture=x86_64&platform=linux&version=8.1.3&product=splunk&filename=splunk-8.1.3-63079c59e632-linux-2.6-amd64.deb&wget=true'` |
||||||
|
|
||||||
|
### Install on Ubuntu Server 20.04 |
||||||
|
|
||||||
|
`sudo dpkg -i splunk-[rest of filename]` |
||||||
|
|
||||||
|
### Start Splunk |
||||||
|
|
||||||
|
`sudo /opt/splunk/bin/splunk start --accept-license` |
||||||
|
|
||||||
|
Splunk uses port 8000 as the default for the Splunk web site. |
||||||
|
|
||||||
|
## Operations |
@ -0,0 +1,13 @@ |
|||||||
|
# Extensions |
||||||
|
This is the list of essential extensions that you should be running with VSCode |
||||||
|
|
||||||
|
|Extension|Description| |
||||||
|
|-----|-----| |
||||||
|
|Prettier| adds capability to auto-format your code| |
||||||
|
|Remote - SSH| better than FTP any day| |
||||||
|
|Docker| adds syntax highlighting for your docker files| |
||||||
|
|Apache Conf Snippets| adds syntax highlighting to your .htaccess files| |
||||||
|
|Drupal Syntax Highlighting| adds syntax highting to .inc files| |
||||||
|
|CodeTour| extension for commenting code| |
||||||
|
|Live Server| adds a simple web server to vscode| |
||||||
|
|
@ -0,0 +1,7 @@ |
|||||||
|
# Copy Up/Down |
||||||
|
Shift + Alt + ArrowUp/ArrowDown |
||||||
|
|
||||||
|
# Find and Replace |
||||||
|
To add a line break at the replace add Ctrl + Enter. |
||||||
|
|
||||||
|
For example, in an X12 file, I want to add line breaks after each ~. So I would enter ~ in the find box and ~Ctrl+Enter in the replace box. |
@ -0,0 +1,158 @@ |
|||||||
|
# Notes from the Vue complete course |
||||||
|
|
||||||
|
## The Basics of Vue |
||||||
|
|
||||||
|
1. [Creating a Vue app](#creating-a-vue-app) |
||||||
|
2. [Event Handling](#event-handling) |
||||||
|
3. [Data Binding](#data-binding) |
||||||
|
4. [Computed Properties](#computed-properties) |
||||||
|
5. [Watchers](#watchers) |
||||||
|
6. [Shortcuts](#shortcuts) |
||||||
|
|
||||||
|
### Creating a Vue app |
||||||
|
|
||||||
|
```javascript |
||||||
|
const app = Vue.createApp({ |
||||||
|
data() { |
||||||
|
return {}; |
||||||
|
}, |
||||||
|
watch: { |
||||||
|
|
||||||
|
}, |
||||||
|
computed: { |
||||||
|
|
||||||
|
}, |
||||||
|
methods: { |
||||||
|
|
||||||
|
} |
||||||
|
}); |
||||||
|
|
||||||
|
app.mount('#assignment'); |
||||||
|
``` |
||||||
|
|
||||||
|
### Event Handling |
||||||
|
|
||||||
|
### Data Binding |
||||||
|
|
||||||
|
In this example, we want to add a reset button that will reset the contents of the textbox. Rather than using JavaScript to access the textbox directly, we use data binding to bind the textbox to a property and then let the button also access the same property to reset it. |
||||||
|
|
||||||
|
Use the v-bind property to have the textbox value filled from the name property. |
||||||
|
```javascript |
||||||
|
<input type="text" v-bind:value="name" v-on:input="setName($event, 'Schwarzmüller')"> |
||||||
|
``` |
||||||
|
|
||||||
|
Bind the button to a new resetInput method |
||||||
|
```javascript |
||||||
|
<button v-on:click="resetInput">Reset Input</button> |
||||||
|
``` |
||||||
|
|
||||||
|
Add the new method in the app.js file. This method will reset the same property that is now bound to the textbox (it is also bound to the paragraph so that will reset as well) |
||||||
|
```javascript |
||||||
|
resetInput() { |
||||||
|
this.name = ''; |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
The textbox shows a very common pattern where you are binding a property to an input AND setting the property on input. All of this can be replaced with a shorter form: |
||||||
|
```javascript |
||||||
|
v-model="name" |
||||||
|
``` |
||||||
|
This is called Two-way binding. We are listening for the event AND writing the value back to the element. Thus, these two elements shown below do the exact same thing. |
||||||
|
```javascript |
||||||
|
<input type="text" v-bind:value="name" v-on:input="setName($event)"> |
||||||
|
<input type="text" v-model="name"> |
||||||
|
``` |
||||||
|
|
||||||
|
### Computed Properties |
||||||
|
|
||||||
|
Next we look at using a method in the paragraph to format the content rather than using binding. |
||||||
|
```javascript |
||||||
|
outputFullName() { |
||||||
|
if (this.name === '') { |
||||||
|
return ''; |
||||||
|
} |
||||||
|
return this.name + ' ' + 'Schaefer'; |
||||||
|
}, |
||||||
|
``` |
||||||
|
|
||||||
|
This pattern creates an inefficiency because Vue must execute this method whenever anything on the message changes. Rather than using methods, computed properties know the dependencies and will only execute when those dependencies change. |
||||||
|
|
||||||
|
Computer properties add a new section to the Vue app. They are methods but they should be named like properties. When called they are called WITHOUT (), they are used like variables. |
||||||
|
```javascript |
||||||
|
computed: { |
||||||
|
fullname() { |
||||||
|
if (this.name === '') { |
||||||
|
return ''; |
||||||
|
} |
||||||
|
return this.name + ' ' + 'Schaefer'; |
||||||
|
} |
||||||
|
}, |
||||||
|
``` |
||||||
|
|
||||||
|
### Watchers |
||||||
|
|
||||||
|
This is a function that executes when a dependency changes. Very similar to computed properties. Watcher methods are connected to a property name by being named the same. |
||||||
|
|
||||||
|
This is also a new section |
||||||
|
```javascript |
||||||
|
data() { |
||||||
|
return { |
||||||
|
counter: 0, |
||||||
|
name: '', |
||||||
|
fullname: '' |
||||||
|
}; |
||||||
|
}, |
||||||
|
watch: { |
||||||
|
name(value) { |
||||||
|
this.fullname = value + ' ' + 'Schaefer'; |
||||||
|
} |
||||||
|
}, |
||||||
|
``` |
||||||
|
|
||||||
|
The difference between watchers and computed properties is that watchers are bound to a single field whereas a computed field can work with more complex situations. Watchers are best used when you are validating or enforcing threshholds. Like having a maximum on the counter field. |
||||||
|
|
||||||
|
### Shortcuts |
||||||
|
|
||||||
|
v-on: can be replaced with @ |
||||||
|
v-bind: can be replaced with just the : |
||||||
|
|
||||||
|
### Dynamic Styling |
||||||
|
|
||||||
|
This is an approach that uses in-line styles |
||||||
|
|
||||||
|
```html |
||||||
|
<section id="styling"> |
||||||
|
<div |
||||||
|
class="demo" |
||||||
|
:style="{borderColor: boxASelected ? 'red' : '#ccc'}" |
||||||
|
@click="boxSelected('A')"></div> |
||||||
|
<div class="demo" @click="boxSelected('B')"></div> |
||||||
|
<div class="demo" @click="boxSelected('C')"></div> |
||||||
|
</section> |
||||||
|
``` |
||||||
|
|
||||||
|
A better approach is to use a css class dynamically |
||||||
|
|
||||||
|
```css |
||||||
|
.active { |
||||||
|
border-color: red; |
||||||
|
background-color: salmon; |
||||||
|
} |
||||||
|
``` |
||||||
|
|
||||||
|
Note in this code that the :style has been removed and now :class in its place |
||||||
|
|
||||||
|
```html |
||||||
|
<div |
||||||
|
:class="boxASelected ? 'demo active' : 'demo'" |
||||||
|
@click="boxSelected('A')"> |
||||||
|
</div> |
||||||
|
``` |
||||||
|
Vue supports a shorthand for css styles |
||||||
|
```html |
||||||
|
<div |
||||||
|
class="demo" |
||||||
|
:class="{active: boxASelected}" |
||||||
|
@click="boxSelected('A')"> |
||||||
|
</div> |
||||||
|
``` |
@ -0,0 +1,40 @@ |
|||||||
|
|
||||||
|
[https://www.youtube.com/watch?v=bllS9tkCkaM] |
||||||
|
|
||||||
|
## Setup Image |
||||||
|
|
||||||
|
- Update the system |
||||||
|
|
||||||
|
## Install TOR |
||||||
|
|
||||||
|
``` |
||||||
|
sudo apt install tor |
||||||
|
sudo nano /etc/tor/torrc |
||||||
|
``` |
||||||
|
|
||||||
|
Uncomment HiddenServiceDir and HiddenServicePort |
||||||
|
Save and exit |
||||||
|
|
||||||
|
``` |
||||||
|
sudo service tor stop |
||||||
|
sudo service tor start |
||||||
|
|
||||||
|
cat /var/lib/tor/hidden_service/hostname |
||||||
|
``` |
||||||
|
|
||||||
|
hvikudrnymgd7ffgyrtojl45eawanuswoyslsnt4vq2pd7x6nqasmbad.onion |
||||||
|
|
||||||
|
## Install nginx |
||||||
|
|
||||||
|
``` |
||||||
|
sudo apt install nginx |
||||||
|
sudo service nginx start |
||||||
|
|
||||||
|
sudo nanno /etc/nginx/nginx.conf |
||||||
|
``` |
||||||
|
uncomment server_tokens off and server_name_in_redirect off |
||||||
|
add port_in_redirect off after the server_tokens line |
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
nginx web site is located at /var/www/html |
@ -0,0 +1,53 @@ |
|||||||
|
# Linux Stuff |
||||||
|
|
||||||
|
## Hardening |
||||||
|
|
||||||
|
1. Automatic Updates (Non-prod only) |
||||||
|
2. SSH Logins |
||||||
|
3. Lockdown logins |
||||||
|
4. Firewall |
||||||
|
|
||||||
|
### Automatic Updates |
||||||
|
|
||||||
|
To do updates manually. Don't do this on Production servers because you should have better planning to upgrade you key servers. |
||||||
|
|
||||||
|
``` |
||||||
|
apt update |
||||||
|
apt upgrade |
||||||
|
``` |
||||||
|
|
||||||
|
Install a utility that will perform auto-upgrades |
||||||
|
|
||||||
|
``` |
||||||
|
apt install unattended-upgrades |
||||||
|
``` |
||||||
|
|
||||||
|
Configure the utility |
||||||
|
|
||||||
|
``` |
||||||
|
dpkg-reconfigure --priority=low unattended-upgrades |
||||||
|
``` |
||||||
|
|
||||||
|
### SSH Logins |
||||||
|
|
||||||
|
### Lockdown Logins |
||||||
|
|
||||||
|
Edit the following file in nano on the server: |
||||||
|
|
||||||
|
``` |
||||||
|
sudo nano /etc/ssh/sshd_config |
||||||
|
``` |
||||||
|
|
||||||
|
Make the following changes: |
||||||
|
|
||||||
|
1. Change the **Port** to something other than 22 |
||||||
|
2. Uncomment **AddressFamily** |
||||||
|
3. Change AddressFamily to **inet** |
||||||
|
4. Change PermitRooLogin to **no** |
||||||
|
5. Change PasswordAuthentication to **no** |
||||||
|
|
||||||
|
Save the file and restart the ssh service |
||||||
|
|
||||||
|
``` |
||||||
|
sudo systemctl restart sshd |
||||||
|
``` |
@ -0,0 +1,43 @@ |
|||||||
|
# Secure Shell (SSH) |
||||||
|
|
||||||
|
SSH is a network protocol for creating a secure connection from a client to a server. |
||||||
|
|
||||||
|
## Client-side setup |
||||||
|
|
||||||
|
### On the server-side |
||||||
|
|
||||||
|
In your home folder create an ssh folder |
||||||
|
|
||||||
|
``` |
||||||
|
mkdir ~/.ssh && chmod 700~/.ssh |
||||||
|
``` |
||||||
|
|
||||||
|
### Create SSH keys on your client |
||||||
|
|
||||||
|
``` |
||||||
|
ssh-keygen -t rsa -b 4096 -C "email@domain.com" |
||||||
|
``` |
||||||
|
|
||||||
|
### Copy key to a remote server |
||||||
|
|
||||||
|
On Windows execute the following command to copy the public key up to the server. |
||||||
|
|
||||||
|
``` |
||||||
|
scp $env:USERPROFILE/.ssh/id_rsa.pub username@ip_address:~/.ssh/authorized_keys |
||||||
|
``` |
||||||
|
|
||||||
|
On Linux execute the following |
||||||
|
|
||||||
|
``` |
||||||
|
ssh-copy-id username@ip_address |
||||||
|
``` |
||||||
|
|
||||||
|
When you copy the key over, the server will challenge for your server password. After this initial step, the server will accept your keys as the login and you will not be challenged for the password. |
||||||
|
|
||||||
|
### Copy key to Azure DevOps |
||||||
|
|
||||||
|
Note about git: I have noticed that you need to generate keys for both your user account and root. |
||||||
|
|
||||||
|
### Login to remote server using your key |
||||||
|
|
||||||
|
`ssh username@ip_address` |
@ -0,0 +1,36 @@ |
|||||||
|
# Install Ubuntu Server |
||||||
|
|
||||||
|
This guide assumes that the server is a plain-vanilla installation of Ubuntu Server. You can select the option to install OpenSSH Server during the installation wizard or follow the instructions below to install it post-installation. This guide assumes that you did not select any of the Featured Server Snaps during installation. |
||||||
|
|
||||||
|
## Post Installation |
||||||
|
|
||||||
|
Once installation is complete run update and upgrade to ensure that you have the latest version of the server installed along with all of its patches. |
||||||
|
|
||||||
|
``` |
||||||
|
sudo apt update |
||||||
|
sudo apt upgrade |
||||||
|
``` |
||||||
|
|
||||||
|
## Install OpenSSH Server |
||||||
|
|
||||||
|
These days everything should be done over SSH. Install the server so that you can connect to it using this standard protocol rather than FTP or RDP. |
||||||
|
|
||||||
|
``` |
||||||
|
sudo apt install -y openssh-server |
||||||
|
``` |
||||||
|
## Install GIT |
||||||
|
|
||||||
|
If you will be editing or developing anything in this server, install GIT. GIT is the source control tool of choice. |
||||||
|
|
||||||
|
``` |
||||||
|
sudo apt install -y git |
||||||
|
``` |
||||||
|
|
||||||
|
## Install the Lynx browser |
||||||
|
|
||||||
|
Lynx is a command-line browser. This guide assumes that you are installing Ubuntu server without a GUI, therefore you will need lynx to browse the web or to browse sites on this server (e.g., localhost). |
||||||
|
|
||||||
|
``` |
||||||
|
sudo apt install -y lynx |
||||||
|
``` |
||||||
|
|
@ -0,0 +1,15 @@ |
|||||||
|
# Patient Data Entry |
||||||
|
|
||||||
|
## OpenEMR |
||||||
|
|
||||||
|
- Patient Demographics |
||||||
|
- Patient Choices |
||||||
|
- Guradian Information |
||||||
|
- Insurance Data [how to read the insurance card] |
||||||
|
- ID Card scanning and upload |
||||||
|
|
||||||
|
## Payer Portals |
||||||
|
|
||||||
|
- Link [United Healthcare] |
||||||
|
- Availaity [BCBS, Aetna] |
||||||
|
- Cigna |
@ -0,0 +1,63 @@ |
|||||||
|
# Teams |
||||||
|
|
||||||
|
## Office 365 Refresher |
||||||
|
|
||||||
|
|
||||||
|
## Intro to Teams |
||||||
|
|
||||||
|
### What is a Team |
||||||
|
- Teams and Groups |
||||||
|
- Why is a Group important: other O365 apps |
||||||
|
|
||||||
|
### Collaboration |
||||||
|
- Connecting |
||||||
|
- Sharing |
||||||
|
- Productivity |
||||||
|
|
||||||
|
## Beginning With You |
||||||
|
|
||||||
|
### User Profile |
||||||
|
- Profile and Status |
||||||
|
- Settings |
||||||
|
- Desktop and Mobile apps |
||||||
|
- Accounts & orgs |
||||||
|
|
||||||
|
### Chat Basics |
||||||
|
- Conversation bar |
||||||
|
- Conversation Actions [Pinning, Pop out, Muting, Hiding] |
||||||
|
- Starting a chat - how to the To: bar works |
||||||
|
- The conversation bar |
||||||
|
- Formatting [Text, Lists, Tables, Quotes, Code] |
||||||
|
- Status |
||||||
|
- Attachments |
||||||
|
- Decorations [Emoji, GIF, Stickers] |
||||||
|
- Stream |
||||||
|
- Praise |
||||||
|
- Approvals |
||||||
|
- Apps |
||||||
|
|
||||||
|
### Chat Conversations |
||||||
|
- Quick response icons |
||||||
|
- Chat actions [Saving, Outlook, Apps] |
||||||
|
- Immersive Reader |
||||||
|
- Adding people to the conversation |
||||||
|
- Going Live |
||||||
|
- Video/Audio call |
||||||
|
- Screen sharing |
||||||
|
|
||||||
|
## Groups |
||||||
|
|
||||||
|
### Getting to know people |
||||||
|
- The contact card |
||||||
|
- Contact information |
||||||
|
- Collaboration [Chat, Email, Call, Video] |
||||||
|
- Organization |
||||||
|
- Activity |
||||||
|
- Files |
||||||
|
|
||||||
|
### Your Teams |
||||||
|
- Teams and Channels |
||||||
|
|
||||||
|
## Provisioning |
||||||
|
|
||||||
|
## Administration |
Loading…
Reference in new issue