An AWS Cloud Architecture For Web Hosting
https://docs.aws.amazon.com/whitepapers/latest/web-application-hosting-best-practices/an-aws-cloud-architecture-for-web-hosting.html
Web Architecture 101
https://medium.com/storyblocks-engineering/web-architecture-101-a3224e126947
How Amazon Route 53 Routes Traffic For Your Domain
https://docs.aws.amazon.com/Route53/latest/DeveloperGuide/welcome-dns-service.html
If you're going to make the browser download the CSS/JS every time then you may as well just include it in the page itself so only one request needs to be made per page.
You're working on your project and have a couple of commits already on the master branch. This is your Production version of code.
You decide to add new funtionality to Production.
Create a new branch off master: $ git branch newfunctionality
Switch to the new branch: $ git checkout newfunctionality
You are working and doing commits on branch newfunctionality
Production code blows up and you need to fix it.
Commit your changes on branch newfunctionality.
Switch back to master: $ git checkout master
Create a new branch off master: $ git branch emergencyfix
Switch to the new branch: $ git checkout emergencyfix
fix the code and then commit it to emergencyfix
Switch to master: $ git checkout master
Merge emergencyfix into master: $ git merge emergencyfix
Delete emergencyfix: $ git branch -d emergencyfix
Got back to newfunctionalitybranch: $ git checkout newfunctionality
select json_each(CAST(session_data AS JSON)) from user_data;
select session_data::json->>'graphthrower' from user_data;
vi
0 Number zero, move to beginning of line.
$ Move to end of line.
vi & less
G Move to end of file.
1G Move to top of file.
ctrl+f Page down.
ctrl+b Page up.
/<searchtext> in command mode search forward.
?<searchtext> in command mode search backward.
n goes to the next instance of <searchtext> in the direction of the last search.
N goes to the next instance of <searchtext> in the opposite direction of the last search.
One of Elon Musks super powers is he thinks optimistically about any idea that comes into his head. He forces himself to think it through and try to solve all the problems it might present.
For example, if someone told you they had a great idea to ease traffic congestion by building hundreds of tunnels under cities, you would probably think, Thats stupid, dont waste any time thinking about that!
Not so for Elon. He lets his mind go there. He optimistically tries to solve even the most outrageous sounding problems. Next time you hear an idea that sounds stupid, try to think about it optimistically and see if that presents you with anything interesting.
JSON object
It is derived from Javascript objects.
It is a text only string.
The keys must be a string written with double quotes:
{"name":"harrry","price":120,"inStock":true,"features":["WiFi","LTE"],"xyz":null}
The values can be any of the following:
strings, numbers, objects, arrays, Boolean, null
Convert JSON object to a Javascript object: JSON.parse()
Check Versions
Ubuntu Operating System & Kernel
As root: $ hostnamectl
Nginx
As root: $ nginx -v
Postgres Client
As postgres: $ psql -V
Postgres Server
As postgres: $ psql -d kenworth
psql prompt: # select version();
ThrowsLog.com shut down:
Logged in as root
$ ps -ef | egrep "kenworth|UID"
$ kill ??? (whatever the PID is for /home/toddad538/go/bin/kenworthserver)
$ kill ??? (whatever the PID is for /home/toddad538/go/bin/kenworthexception)
$ systemctl stop nginx
$ systemctl stop postgresql
Log out of SSH sessions and select the Stop command from the GCP control panel for the VM you want to shut down.
Once the instance has stopped select the Start/Resume command from the GCP control panel for the VM you want to start up.
ThrowsLog.com start up:
As root do the following:
If $ systemctl status nginx does not show it running
$ systemctl start nginx
If $ systemctl status postgresql does not show it running
$ systemctl start postgresql
Run the following commands as root in /home/toddad538/go/bin:
$ /home/toddad538/go/bin/kenworthserver &
$ /home/toddad538/go/bin/kenworthexception &
ThrowsLog.com & NotesRightHere.com monitoring:
$ ps -ef | egrep "kenworth|UID"
$ systemctl status nginx 'postgresql*'
grep results should be similar to the following processes:
root 00000 00000 0 00:00 pts/2 00:00:00 /home/toddad538/go/bin/kenworthserver
postgres 00000 00000 0 00:00 ? 00:00:00 postgres: 11/main: postgres kenworth 127.0.0.1(00000) idle
NotesRightHere.com shut down:
Logged in as root
$ ps -ef | egrep "kenworth|UID"
$ kill ??? (whatever the PID is for /home/toddad538/go/bin/kenworthserver)
$ systemctl stop nginx
$ systemctl stop postgresql
Log out of SSH sessions and select the Stop command from the GCP control panel for the VM you want to shut down.
Once the instance has stopped select the Start/Resume command from the GCP control panel for the VM you want to start up.
NotesRightHere.com start up:
As root do the following:
If $ systemctl status nginx does not show it running
$ systemctl start nginx
If $ systemctl status postgresql does not show it running
$ systemctl start postgresql
Run the following commands as root in /home/toddad538/go/bin:
$ /home/toddad538/go/bin/kenworthserver &
Ubuntu System Maintenance
If needed do: Throwslog.com shut down: Leave VM running
If needed do: NotesRightHere.com shut down: Leave VM running
Logged in as root.
$ apt update
This command uses the repository entries in the following:
1. File: /etc/apt/sources.list
2. Files in directory: /etc/apt/sources.list.d/
Example entry:
deb http://us-central1.gce.archive.ubuntu.com/ubuntu/ bionic main restricted
to download/update the files in
/var/lib/apt/lists/partial
and then
/var/lib/apt/lists
The files in /var/lib/apt/lists contain the information
about all the packages in the repositories pointed to
by the repository entries in 1. & 2. above.
I believe the files in /var/lib/apt/lists can be deleted temporarily
because the files are created by the apt update command.
If the files in /var/lib/apt/lists are temporarily deleted
other commands may fail because those commands use the
information in the files in /var/lib/apt/lists.
Once the apt update command is finished I don't belive
there should be any files in /var/lib/apt/lists/partial
$ apt list --upgradable
Look over the packages that will be updated.
$ apt upgrade
If you see there are packages that are no longer needed,
Answer the: Do you want to continue? [Y/n] with n
and run the following:
$ apt autoremove
The autoremove option is used to remove packages that were automatically
installed to satisfy dependencies for other packages and are now no longer
needed as dependencies changed or the package(s) needing them were removed
in the meantime. For example, when you upgrade Linux kernel to 4.1.5,
you may not need Linux kernel version 3.8.5.
$ apt list | grep '\[residual-config'
This command will list config files related to the packages that were removed
by the: apt autoremove command above.
$ apt purge [package_name]
This command will delete the config files for package(s) that were returned
from the: apt list | grep '\[residual-config' command above
$ apt upgrade
This is the command that will apply any changes needed to installed packages
and/or those packages dependency packages.
$ apt clean
This removes all retrieved package files (.deb) from the local repository except
for the lock file.
(.deb) files in transit go into directory
/var/cache/apt/archives/partial
(.deb) files that have finished downloading go into directory
/var/cache/apt/archives
$ apt autoclean
This does the same as apt clean BUT it only removes (.deb) files that can no
longer be downloaded, and are largely useless. This allows the cache to be
maintained over a long period without it going out of control.
$ snap list --all
For any that have: disabled in the Notes column do the following:
$ snap remove Namecolumn --revision=Revcolumn
Remove the files in /var/lib/snapd/cache without issue.
Also there is no need to stop the snapd service.
Once the: apt upgrade command has finished use Google Cloud Console to stop and
then restart the VM instance.
dpkg is the low level package management tool that is called by command:
apt upgrade
/var/lib/dpkg/info contains files that relate to packages - including the list of
files (as full path names) provided by each package, the MD5sums of each of these
files, and the executable scripts that would be run before and after installation
or removal (preinst, postinst, prerm, postrm). Of course the system contains many,
many packages and each one has multiple files here.
The more packages you install, the bigger this directory will get.
THIS DIRECTORY IS REALLY IMPORTANT TO THE SYSTEM.
YOU SHOULD NEVER DELETE ANYTHING FROM IT MANUALLY.
IF YOU DO, YOU CAN EXPECT BAD BAD BAD THINGS TO OCCUR.
Use the following to manipulate this directory:
apt commands, apt-get commands or dpkg commands
/var/lib/dpkg/info/[package_name].list
$ apt remove [package_name]
The command above deletes the files/directories listed in
file: /var/lib/dpkg/info/[package_name].list
Directories are only deleted if they are empty.
/var/lib/dpkg/info/[package_name].conffiles
$ apt purge [package_name]
The command above deletes the files listed in file:
/var/lib/dpkg/info/[package_name].conffiles
It can be used to delete config files even if package related files have already
been deleted.
Not sure if .conffiles contains directories or not.
If there are, I assume the same rules apply to them as for directories listed in
the .list file.
Any files or directories not in .list or .conffiles need to be deleted by the
system administrator. These would be files that are created by something or
someone other than dpkg.
Directory /var/cache/apt/archives/partial
Storage area for package files (.deb) in transit.
Directory /var/cache/apt/archives
Storage area for retrieved package files (.deb).
https://fred.stlouisfed.org/series/T10Y3M
https://fred.stlouisfed.org/series/T10Y2Y
You want 0 or higher.
https://tradingeconomics.com/united-states/business-confidence
The ISM (Institute of Supply Management) surveys 50,000+ executives from 400 US manufacturing companies monthly to gauage their sentiment on various factors, such as employment, new orders, production, and more.
A score below 50 indicates contraction and may signal an impending recession.
Above 50 signals growth.
Over 60 signals a booming economy.