This sheet goes along with this SSH YouTube tutorial
$ ssh brad@192.168.1.29
$ mkdir test
$ cd test
| # GET VERSION | |
| npm -v (or --version) | |
| # GET HELP | |
| npm help | |
| npm | |
| # CREATE PACKAGE.JSON | |
| npm init | |
| npm init -y (or --yes) |
| # GET VERSION | |
| yarn -v (or --version) | |
| # GET HELP | |
| yarn help | |
| # CREATE PACKAGE.JSON | |
| yarn init | |
| yarn init -y // Use defaults |
| #! /bin/bash | |
| # ECHO COMMAND | |
| # echo Hello World! | |
| # VARIABLES | |
| # Uppercase by convention | |
| # Letters, numbers, underscores | |
| NAME="Bob" | |
| # echo "My name is $NAME" |
$ ssh brad@192.168.1.29
$ mkdir test
$ cd test
| import requests | |
| from bs4 import BeautifulSoup | |
| from csv import writer | |
| response = requests.get('http://codedemos.com/sampleblog/') | |
| soup = BeautifulSoup(response.text, 'html.parser') | |
| posts = soup.find_all(class_='post-preview') |
| const cacheName = 'v1'; | |
| const cacheAssets = [ | |
| 'index.html', | |
| 'about.html', | |
| '/css/style.css', | |
| '/js/main.js' | |
| ]; | |
| // Call Install Event |
| const cacheName = 'v2'; | |
| // Call Install Event | |
| self.addEventListener('install', e => { | |
| console.log('Service Worker: Installed'); | |
| }); | |
| // Call Activate Event | |
| self.addEventListener('activate', e => { | |
| console.log('Service Worker: Activated'); |
| const request = require('request'); | |
| const cheerio = require('cheerio'); | |
| const fs = require('fs'); | |
| const writeStream = fs.createWriteStream('post.csv'); | |
| // Write Headers | |
| writeStream.write(`Title,Link,Date \n`); | |
| request('http://codedemos.com/sampleblog', (error, response, html) => { | |
| if (!error && response.statusCode == 200) { |