From 97a8370caea2fae4a0a67165036aae2dc2d05900 Mon Sep 17 00:00:00 2001 From: Jacob McDonnell Date: Wed, 3 May 2023 13:13:47 -0400 Subject: Rewrite of the website in Flask --- .DS_Store | Bin 10244 -> 8196 bytes .vscode/settings.json | 3 - 404.html | 23 -- CSS/.DS_Store | Bin 6148 -> 0 bytes CSS/main.css | 138 --------- README.md | 39 --- Schoolproject/.DS_Store | Bin 6148 -> 0 bytes Schoolproject/CSS/main.css | 109 ------- Schoolproject/Declan'sPage.html | 65 ---- Schoolproject/JS/sidenav.js | 11 - Schoolproject/Jacob'sPage.html | 51 ---- Schoolproject/Jason'sPage.html | 38 --- Schoolproject/Nick'sPage.html | 56 ---- Schoolproject/images/constitution.jpg | Bin 1240227 -> 0 bytes Schoolproject/images/pixeltrump.gif | Bin 498329 -> 0 bytes Schoolproject/images/presidents.png | Bin 1105201 -> 0 bytes Schoolproject/index.html | 39 --- articles/.DS_Store | Bin 6148 -> 0 bytes .../img/Screen Shot 2022-02-19 at 2.15.13 PM.png | Bin 17415 -> 0 bytes .../img/Screen Shot 2022-02-19 at 2.18.39 PM.png | Bin 21318 -> 0 bytes .../img/Screen Shot 2022-02-19 at 2.23.20 PM.png | Bin 70360 -> 0 bytes .../img/Screen Shot 2022-02-19 at 2.56.21 PM.png | Bin 79823 -> 0 bytes .../img/Screen Shot 2022-02-19 at 2.58.29 PM.png | Bin 66928 -> 0 bytes articles/RpiRockyLinuxServer/index.html | 192 ------------ .../RpiRockyLinuxServer/rpi4rockylinuxwebserver.md | 303 ------------------ articles/articleMaker.tar | Bin 4096 -> 0 bytes articles/index.html | 26 -- articles/rss.xml | 204 ------------- db.py | 22 ++ favicon.ico | Bin 15406 -> 0 bytes fonts/IBMPlexMono-Regular.ttf | Bin 112140 -> 0 bytes images/LOGO_21x127.png | Bin 1218 -> 0 bytes images/LOGO_21x127.svg | 78 ----- images/LOGO_Transparent.png | Bin 800 -> 0 bytes images/LOGO_Transparent.svg | 74 ----- images/SideFlareGreen.svg | 3 - images/SideFlarePurple.svg | 3 - images/favicon.xcf | Bin 102074 -> 0 bytes images/menu.svg | 3 - images/wave.svg | 3 - index.html | 36 --- loadarticle.py | 34 +++ main.py | 73 +++++ robots.txt | 8 - static/404.md | 4 + static/README.md | 39 +++ .../__pycache__/dbbak.cpython-310.pyc | Bin 0 -> 471 bytes static/articles/rpilinuxserver/dbbak.py | 8 + .../img/ScreenShot2022-02-19at2.15.13PM.png | Bin 0 -> 17415 bytes .../img/ScreenShot2022-02-19at2.18.39PM.png | Bin 0 -> 21318 bytes .../img/ScreenShot2022-02-19at2.23.20PM.png | Bin 0 -> 70360 bytes .../img/ScreenShot2022-02-19at2.56.21PM.png | Bin 0 -> 79823 bytes .../img/ScreenShot2022-02-19at2.58.29PM.png | Bin 0 -> 66928 bytes static/articles/rpilinuxserver/rpilinuxserver.md | 339 +++++++++++++++++++++ static/business_card | 13 + static/css/main.css | 148 +++++++++ static/favicon.ico | Bin 0 -> 15406 bytes static/home.md | 23 ++ static/images/LOGO_21x127.png | Bin 0 -> 1218 bytes static/images/LOGO_21x127.svg | 78 +++++ static/images/LOGO_Transparent.png | Bin 0 -> 800 bytes static/images/LOGO_Transparent.svg | 74 +++++ static/images/SideFlareGreen.svg | 3 + static/images/SideFlarePurple.svg | 3 + static/images/favicon.xcf | Bin 0 -> 102074 bytes static/images/menu.svg | 3 + static/images/wave.svg | 3 + static/robots.txt | 6 + static/rss.xml | 23 ++ static/testpage.html | 75 +++++ template.html | 19 -- templates/404.html | 23 ++ templates/articletemplate.html | 23 ++ templates/template.html | 25 ++ testPage.html | 99 ------ 75 files changed, 1042 insertions(+), 1623 deletions(-) delete mode 100644 .vscode/settings.json delete mode 100755 404.html delete mode 100644 CSS/.DS_Store delete mode 100644 CSS/main.css delete mode 100755 README.md delete mode 100644 Schoolproject/.DS_Store delete mode 100755 Schoolproject/CSS/main.css delete mode 100755 Schoolproject/Declan'sPage.html delete mode 100755 Schoolproject/JS/sidenav.js delete mode 100755 Schoolproject/Jacob'sPage.html delete mode 100755 Schoolproject/Jason'sPage.html delete mode 100755 Schoolproject/Nick'sPage.html delete mode 100755 Schoolproject/images/constitution.jpg delete mode 100755 Schoolproject/images/pixeltrump.gif delete mode 100755 Schoolproject/images/presidents.png delete mode 100755 Schoolproject/index.html delete mode 100644 articles/.DS_Store delete mode 100644 articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.15.13 PM.png delete mode 100644 articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.18.39 PM.png delete mode 100644 articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.23.20 PM.png delete mode 100644 articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.56.21 PM.png delete mode 100644 articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.58.29 PM.png delete mode 100755 articles/RpiRockyLinuxServer/index.html delete mode 100644 articles/RpiRockyLinuxServer/rpi4rockylinuxwebserver.md delete mode 100644 articles/articleMaker.tar delete mode 100644 articles/index.html delete mode 100644 articles/rss.xml create mode 100755 db.py delete mode 100644 favicon.ico delete mode 100644 fonts/IBMPlexMono-Regular.ttf delete mode 100755 images/LOGO_21x127.png delete mode 100755 images/LOGO_21x127.svg delete mode 100755 images/LOGO_Transparent.png delete mode 100755 images/LOGO_Transparent.svg delete mode 100755 images/SideFlareGreen.svg delete mode 100755 images/SideFlarePurple.svg delete mode 100644 images/favicon.xcf delete mode 100755 images/menu.svg delete mode 100755 images/wave.svg delete mode 100755 index.html create mode 100755 loadarticle.py create mode 100755 main.py delete mode 100755 robots.txt create mode 100755 static/404.md create mode 100755 static/README.md create mode 100755 static/articles/rpilinuxserver/__pycache__/dbbak.cpython-310.pyc create mode 100755 static/articles/rpilinuxserver/dbbak.py create mode 100755 static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.15.13PM.png create mode 100755 static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.18.39PM.png create mode 100755 static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.23.20PM.png create mode 100755 static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.56.21PM.png create mode 100755 static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.58.29PM.png create mode 100755 static/articles/rpilinuxserver/rpilinuxserver.md create mode 100755 static/business_card create mode 100755 static/css/main.css create mode 100755 static/favicon.ico create mode 100755 static/home.md create mode 100755 static/images/LOGO_21x127.png create mode 100755 static/images/LOGO_21x127.svg create mode 100755 static/images/LOGO_Transparent.png create mode 100755 static/images/LOGO_Transparent.svg create mode 100755 static/images/SideFlareGreen.svg create mode 100755 static/images/SideFlarePurple.svg create mode 100755 static/images/favicon.xcf create mode 100755 static/images/menu.svg create mode 100755 static/images/wave.svg create mode 100755 static/robots.txt create mode 100755 static/rss.xml create mode 100755 static/testpage.html delete mode 100755 template.html create mode 100755 templates/404.html create mode 100755 templates/articletemplate.html create mode 100755 templates/template.html delete mode 100755 testPage.html diff --git a/.DS_Store b/.DS_Store index 006e5e3..1c5c448 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index 4c08140..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "livePreview.defaultPreviewPath": "/articles/index.html" -} \ No newline at end of file diff --git a/404.html b/404.html deleted file mode 100755 index 66918f5..0000000 --- a/404.html +++ /dev/null @@ -1,23 +0,0 @@ - - - - - - 404 Page Not Found - - - - - -
-
-

404 Page Not Found

-

Maybe you want to go to one of the pages in nav bar instead.

-
-
- - diff --git a/CSS/.DS_Store b/CSS/.DS_Store deleted file mode 100644 index 0bb201a..0000000 Binary files a/CSS/.DS_Store and /dev/null differ diff --git a/CSS/main.css b/CSS/main.css deleted file mode 100644 index e75c336..0000000 --- a/CSS/main.css +++ /dev/null @@ -1,138 +0,0 @@ -/* - * Color scheme - * Background color: #eaefef - * Code background: #d4d9d9 - * Main color: #00558e - * Secondary color: #0b3075 - */ -:root { - --color-1: #eaefef; - --color-2: #d4d9d9; - --color-3: #00558e; - --color-4: #0b3075; - } -body{ - background-color:var(--color-1); - color:var(--color-3); -} -a{ - color: var(--color-3); -} -ul.topBar{ - background-color:var(--color-3); -} -li.topLink a{ - color:var(--color-1); -} -li.topLink a:hover{ - background-color:var(--color-4); -} -.search{ - color:var(--color-3); - background-color:var(--color-1); - border-color:var(--color-3); -} -pre code { - background-color: var(--color-2); -} - -@media (prefers-color-scheme: dark) { - /* - * Color scheme - * Background color: #0D1F22 - * Text Color: #eaefef - * Main color: #00558e - * Secondary color: #0b3075 - */ - :root { - --color-1: #0D1F22; - --color-2: #081417; - --color-3: #00558e; - --color-4: #0b3075; - --text-color: #eaefef; - } - body{ - background-color:var(--color-1); - color:var(--text-color); - } - a{ - color: var(--text-color); - } - ul.topBar{ - background-color:var(--color-3); - } - li.topLink a{ - color:var(--text-color); - } - li.topLink a:hover{ - background-color:var(--color-4); - } - .search{ - color:var(--color-3); - background-color:var(--text-color); - border-color:var(--color-3); - } - pre code { - background-color: var(--color-2); - } -} - -/* Common CSS styling */ -body{ - font-family:Arial; -} -ul.topBar{ - text-transform:uppercase; - margin:0; - padding:0; - overflow:hidden; - list-style-type:none; -} -li.topLink{ - float:left; -} -li.topLink a{ - display:block; - text-align:center; - padding:0.875rem 1rem; - text-decoration:none; -} -.main{ - margin:auto; - width:60%; -} -.search{ - padding:0.75rem 1.25rem 0.75rem; - width:90%; - border-radius:0.3125rem; - margin-left:auto; - margin-right:auto; - margin-bottom:15em; - font-family:IBM Plex Mono; -} -pre code { - border: 0.0625rem solid #999; - display: block; - overflow:auto; - padding: 0.625rem; -} -.icon{ - font-size:12.5rem; - margin-top:0.625rem; - margin-bottom:0.625rem; -} - -@media only screen and (orientation: portrait){ - .main{ - margin:auto; - width:90%; - } -} - -div.article a{ - text-decoration:none; - display:block; -} -img.imgs { - width:75%; -} \ No newline at end of file diff --git a/README.md b/README.md deleted file mode 100755 index 997cafb..0000000 --- a/README.md +++ /dev/null @@ -1,39 +0,0 @@ -# What have you stumbled upon? - -This is the custom made startup page of mine. Please do not do anything to it. If you want to take some code feel free to. If you want to see what I plan on doing look below at the [Checklist](#check-list). - -# Check list - -## Overview - -This is a checklist of what needs to be done on this website. - -*** - -## Table of Contents - -- [Important Things to get done](#Imporant) -- [Unimportant Things to do](#Unimportant) -- [Completed](#Completed) - -*** - -## Imporant - -- none - -*** - -## Unimportant - -- none - -*** - -## Completed - -- ~~Create a READ.MD file~~ -- ~~Buy the domain jacobmcdonnell.com~~ -- ~~Merge or Seperate Main and Mobile CSS files~~ - -*** diff --git a/Schoolproject/.DS_Store b/Schoolproject/.DS_Store deleted file mode 100644 index c78d5e7..0000000 Binary files a/Schoolproject/.DS_Store and /dev/null differ diff --git a/Schoolproject/CSS/main.css b/Schoolproject/CSS/main.css deleted file mode 100755 index df97597..0000000 --- a/Schoolproject/CSS/main.css +++ /dev/null @@ -1,109 +0,0 @@ -body{ - background-image: url("../images/constitution.jpg"); - background-color: #cccccc; - height: 500px; - background-position: center; - background-repeat: no-repeat; - background-size: fill; - background-attachment: fixed; - position: relative; -} -h1{color:black;} -h2{color:black;} -h3{color:black;} -h4{color:black;} -h5{color:black;} -p{color:black;font-size:20px;font-family:Arial;} -td{color:black;font-size:20px;font-family:Arial;} -a{color:black;} -li{color:black;font-size:20px;font-family:Arial;} -h1.white{color:white;} -h2.white{color:white;} -h3.white{color:white;} -h4.white{color:white;} -h5.white{color:white;} -table{border-spacing: 5px;} -p.white{color:white;text-indent: 50px;font-size:20px;font-family:Arial;} -a.white{color:white;} -li.white{color:white;} -p.big{color:black;line-height: 2;text-indent: 50px;font-size:20px;font-family:Arial;} -span.nav_button{font-size:30px;cursor:pointer;color:white;} -img.logo{width:113.66px;height:120px;} -img.computer{height:200px;width:200px;} -img.work_computer{height:250px;width:200px;} -marquee{color:white;} -img.HundOS{height:113px;width:200px;} -img.hound{height:169px;width:300px;} -div.container { - width: 100%; - transition: margin-left .5s; -} -img.ac{width:500px;height:302.2px;} -img.sr{width:500px;height:342.2px;} -img.cb{width:500px;height:293.6px;} -img.mm{width:500px;height:296px;} -img.Presidents{width:500px;height:900px;} -img.jb{width:500px;height:334.4px;} -img.bill{width:500px;height:696px;} -#main { - transition: margin-left .5s; -} -header, footer { - padding: 1em; - color: white; - clear: left; -} -main { - transition: margin-left .5s; - padding: 16px; - margin-left:100px; - margin-right:100px; - background-color:white; -} -.button1 { - background-color: white; - color: black; - border: 2px solid #555555; -} - -.button1:hover { - background-color: #555555; - color: white; -} -.sidenav { - height: 100%; - width: 0; - position: fixed; - z-index: 1; - top: 0; - left: 0; - background-color: #111; - overflow-x: hidden; - transition: 0.5s; - padding-top: 60px; -} -.sidenav a { - padding: 8px 8px 8px 32px; - text-decoration: none; - font-size: 25px; - color: #818181; - display: block; - transition: 0.3s; -} -.sidenav a:hover, .offcanvas a:focus{ - color: #f1f1f1; -} -.sidenav p { - text-decoration: none; - font-size: 15px; - color: #818181; - display: block; - transition: 0.3s; -} -.sidenav .closebtn { - position: absolute; - top: 0; - right: 25px; - font-size: 25px; - margin-left: 50px; -} diff --git a/Schoolproject/Declan'sPage.html b/Schoolproject/Declan'sPage.html deleted file mode 100755 index 44be78c..0000000 --- a/Schoolproject/Declan'sPage.html +++ /dev/null @@ -1,65 +0,0 @@ - - - -Paraphrasing of the US Constitution, How A Bill Becomes A Law, and Election Basics - - - - -
-
-

Paraphrasing of the US Constitution, How A Bill Becomes A Law, and Election Basics

- -
-

Paraphrasing of the U.S. Constitution

-

Article 1: -Section 1: Congress has the power to create laws, and is divided into the House of Representatives and the Senate. -Section 2: Representatives in the House of Representatives will be voted on every 2 years. Representatives must be 25 years old and needs to be a citizen for at least seven years. They must live in the state they were elected in. States can have different taxes and representatives, both of which are decided upon by state population. For every 30,000 people there is one representative, however, slaves count as ⅗ of a person. When a legislator is too sick to work, the governor of that state will hold an election to fill in the position. Representatives can impeach other government officials. -Section 3: Every state will have two senators in the US Senate. They will all meet directly after the first election. During that meeting, the senators will divide into three groups; those that leave in 2 years, those that leave in 4 years, and those that live in 6 years. If a senator is too sick to serve, then the state governor chooses another senator until the next election. Senators must be at least 30 years old and be a citizen for at least 9 years and must live in the state they were elected in. The vice president will be the president of the senate. The senate will hold an impeachment trial for any official that has been impeached by the house. If they are guilty they are removed from office and can not work fo the US ever again. -Section 4: The date, time, and how the election works will be decided by states when they elect their senators and representatives, but so can congress. The places that senators and representatives cannot be changed. Congress must meet at least every year. -Section 5: The representatives of each state will decide how many representatives will be in their state. Members of the house can be punished if they don’t show up enough for voting on bills. The house may fire a member with a ⅔ majority. -Section 6: Senators and representatives will be paid for their work. The money will be from the US Bank. they cannot be arrested during the meeting of congress and when they are going to or from congress.They can be arrested for murder, assault, treason, or public indecency. Nobody in congress may have a second job in the government while in office. -Section 7: All bills on taxes will start in the house and will then go to the senate, who will decide to pass, change, or reject them. If all of congress passes a bill, it will go to the president. If he signs it, it becomes a law. If he will send it back and give reasons why. But if both the house and the senate still pass the bill with a ⅔ majority, they override the president and the bill becomes a law. -Section 8: congress can tax imports to the US. Congress also controls the national budget. All taxes will be the same in the US. Congress can get loans from the US. Congress controls trade with foreign powers. Congress can make laws about getting citizenship and people in debt. Congress controls how money is made and designed and may pass laws about counterfeit money. Congress can make laws about the postal service. Congress can make laws about patents. Congress can declare war on foreign powers and makes rules about POWs, and finances all branches of the military, and will set up the national guard. Congress can decide on where the capital of the US will be and will get 10 square miles in all directions from the neighboring state(s). Congress has the power to make laws for the US. -Section 9: Congress cannot control immigration to the US until 1808, but can charge ten dollars to enter the US. All people being arrested must be given a reason for their arrest, and nobody can be punished for breaking a law before the law was made. State tax will be decided by the state’s population. Congress cannot pass laws favoring any state. The senate must approve the money being made in mints, and must record how much money they spend. -Section 10: No individual state can have international relations of any kind. No state can have their own money or hire foreign soldiers. State may not make their own taxes without congress’ permission. -
Article 2 (FINALLY)
-Section 1: The executive power is given to the president of the US. He will have 4 year terms. The vice president will also be chosen for a 4 year term. For the presidential election, states will choose the amount of electors they have, but the number of electors must be the same as all the state’s senators and representatives, but no congressman can be an elector. In every state, every citizen that lives there will get one vote to vote for their prefered candidate, and when a candidate wins by popular vote in a state, all the electors vote for that candidate. Once a majority of the electors have voted for one candidate, then that candidate becomes the president and the second runner will become the vice president. If there is a tie, the house will vote on the president. If they end in a tie, then the senate will decide, and if there is a tie then, the current vice president will break the tie. In order to be a president, you must be born in the US, be at least 35, and have been a US citizen for 14 years. If the president dies, then the vice president takes over. If the vice president then dies, then congress will choose someone to be president until the deceased president’s term is over. The president will be paid a fixed amount of money every year of his term and may not receive any monetary gifts from the US. When the president is sworn in he will take an oath. -Section 2: The president shall have power over all branches of the military. He also can pick cabinet members to advise him on what to do for things like farming, defense, health, money and trade. The president can also get people out of jail for commiting crimes, but not a former government official that broke a law and went to jail. The president can make treaties, name ambassadors, pick cabinet members, and name supreme court justices as long as congress agrees by a ⅔ vote. Congress can also assign the president to fill less important positions. The president can also fill out government positions if congress is not in session, but then must be approved by congress when they meet again. -Section 3: The president can tell congress about important things going on in the country so they can pass bills about those issues. When there is a very important matter to vote on, the president can tell congress to vote on it. If congress doesn’t agree then the president can dismiss congress until they agree on the issue. He can meet with ambassadors from other countries even if he doesn’t agree with them. -Section 4: The president, vice president, cabinet members, or other people who work for the government will be removed from office if they are found guilty in a trial involving a criminal offense. -
Article 3
-Section 1: The judge power of the US will be in one supreme court, but less important courts will also be set up. All judges can hold office as long as they want, as long as they behave. They will be paid a fixed amount of money for as long as they are a judge. -Section 2: Judges will hear all cases of law. They can be about US laws, the constitution, or treaties. They deal with cases about ambassadors, or representatives of other countries, hear all cases from the navy and on international waters. They can deal with cases between states and other states, and they can deal with state vs person cases, and cases between people from different states. For ambassadors in court, the supreme court will decide, but for all other cases, the lower courts will decide unless they reach the supreme court. All criminal cases will be heard by a jury in the state where the crime occured. -Section 3: Treason is helping an enemy in a war against the US, or working with US enemies or helping them. Nobody can be tried for any crime unless you have 2 witnesses against you. Congress has the ability to decide the punishment for treason. -
Article 4:
-Section 1: Marriage, land sales, and decisions about the parent of a child will be given to the states. -Section 2: Every citizen of every state will be treated equally. Fugitives who commited a crime in one state and left will be sent back there for trial. If slaves escape to another state, will be returned to their owner. -Section 3: New states will be added to congress, but no new state can be formed from an old state. No states can merge to make a new state. Congress has the final say of what happens to the land in the US. -Section 4: The US will allow every state to set up a state government run by the people of that state. The US government can protect the state government if the state wishes. -
Article 5:
when there is a ⅔ majority in congress or if ⅔ of the congressmen of each state recommend so, a law can be changed in the constitution if it is necessary. When the amendment is approved by ¾ of every state’s legislature, the amendment will be added to the constitution. No state can lose their votes in the senate unless the state allows it. -
Article 6:
-Section 1: The constitution must be followed by everyone in the US and is the highest code of laws. All judges must make sure they follow all the constitution’s amendments and, if necessary, any state laws. All federal and state government workers must swear to support the constitution. Nobody can be kept from a government job because of their religion. -
Article 7:
Nine States need to vote in favor of ratification to establishment of this Constitution.

-
Constitution
-
-

How A Bill Becomes A Law

-

First, a bill must actually be made, either by someone from a town/city, from one of the houses of congress, or from the Executive Branch (see Executive Branch for more on the topic). Then, the bill must be introduced into the House of Representatives. If it passes, it then goes on to a committee, then it goes to Rules Committee, where it is then where the schedule is made for the debate. Then the House of Representatives debates on the bill. If passed, it moves to the Senate, where a senator presents the bill, and, if the committee majority votes for the bill, it goes to the whole Senate. After successful debate, the bill is potentially amended (basically meaning it gets altered based on the values of the Senate.) and if changes occurred, both houses make changes until they both agree. Eventually, the President, the one and only Donald Trump gets to decide on it. His decision is what makes or breaks a bill, because if he rejects it, it goes all the way back to a committee and hardly any persevere long enough to make it back to the president.

-
bill
-
-

Election Basics

-

For a presidential election, every state votes on two candidates and the candidate who wins in that state by a majority wins that state. Every state has at least three electors, who will then all vote for the candidate who won their state. The number of electors in a state is the same as the number of congressmen that state. Once one candidate gets to 270(out of 538) electors they win because that is a 51% majority. However, for all Congress or state government elections are by popular vote in one state.

-
vote
-
-
-
-
- - diff --git a/Schoolproject/JS/sidenav.js b/Schoolproject/JS/sidenav.js deleted file mode 100755 index 76fecd7..0000000 --- a/Schoolproject/JS/sidenav.js +++ /dev/null @@ -1,11 +0,0 @@ -function openNav() { - document.getElementById("mySidenav").style.width = "250px"; - document.getElementById("main").style.marginLeft = "250px"; - -} - -function closeNav() { - document.getElementById("mySidenav").style.width = "0"; - document.getElementById("main").style.marginLeft= "0"; - -} \ No newline at end of file diff --git a/Schoolproject/Jacob'sPage.html b/Schoolproject/Jacob'sPage.html deleted file mode 100755 index ec2cffc..0000000 --- a/Schoolproject/Jacob'sPage.html +++ /dev/null @@ -1,51 +0,0 @@ - - - -The Articles of Confederation and Shays' Rebellion - - - - -
-
-

The Articles of Confederation and Shays' Rebellion

- -
-

The Articles of Confederation

-

Reasons it didn't work

-
    -
  1. States want more votes not 1 state 1 vote
  2. -
  3. The federal government had to ask for troops from the states
  4. -
  5. States make their own currency and cause inflation
  6. -
  7. States don’t trade with each other
  8. -
  9. States have debts from revolution
  10. -
  11. Congress needed 9 of 13 states to pass any laws
  12. -
  13. The federal government couldn’t collect taxes to fund its operations
  14. -
  15. The Articles of Confederation were practically impossible to amend.
  16. -
-

(1) The Articles of Confederation allow for one state one vote. All large states wanted more than one vote because of their population. Also they wanted more power than the small states. -(2) The federal government had no army, so it had to ask the states for troops. This would make it hard for the U.S. to round up troops to fight in wars or to push the British of the continent.
-(3) There were no laws against the states making their own currency. This was the answer the states the came up with for their debts. They also printed large amounts of their currency making it worthless.
-(4) Because states could make their own currency, interstate trade was difficult. If you wanted something from another state you had to deal with currency conversion and inflation of the other currency.
-(5) All the states had debts for the Revolutionary war. This was to pay of the soldiers and other war expenses. This leads to the next issue.
-(6) this made it very difficult to pass any legislation that would affect all 13 states, since neither the north or the south had a majority.
-(7) The federal government could not tax U.S. citizens, so it needed voluntary taxes from the states.
-(8) The Articles required all 13 states to allow any amendment. Since there were rivalries between the states, mostly the north and south, that rule made the Articles of Confederation impossible to amend.

-
articles of confederation
-
-

Shays' Rebellion

-

A tax protest by western Massachusetts farmers in 1786 and 1787 showed the central government could not stop rebellion. The state militia was used because there was no federal army to stop the rebellion. These events scared Founders like George Washington, James Madison and Alexander Hamilton to the point where delegates from five states met at Annapolis, Maryland in September 1786 to discuss changing the Articles of Confederation. The group recommended that a meeting of all 13 states the following May in Philadelphia. The Constitutional Convention of 1787 ended the Articles of Confederation.

-
shays' rebellion -
-
-
-
- - diff --git a/Schoolproject/Jason'sPage.html b/Schoolproject/Jason'sPage.html deleted file mode 100755 index ce164e7..0000000 --- a/Schoolproject/Jason'sPage.html +++ /dev/null @@ -1,38 +0,0 @@ - - - -The Three Branches of Government and Important People from Each - - - - -
-
-

The Three Branches of Government and Important People from Each

- -
-

Branches of Government

-

The Executive Branch

-

The Executive Branch is the branch of Government where the President works. But, not only does the President,for example Donald Trump, work in the Executive branch, but other important people like the Secretary of Defence, Energy, and other people that oversee and advise changes on the qualities of different side categories the President must acknowledge.

-
Presidents
-
-

The Judicial Branch

-

The Judicial Branch of Government are the ones who are responsible for the overseeing and operating of the Federal, or Supreme Court. The Supreme Court is made up of 9 members currently- John Roberts, the Chief Justice, and 8 other associate justices such as Stephen Breyer and Clarence Thomas.

-
Judicial Branch
-
-

The Legislative Branch

-

The Legislative branch of Government is the branch of Government that is responsible for the revising and approval of bills to be signed by the President. There are two houses to the Legislative Branch- The Senate and the House of Representatives. Each state has 2 Senators no matter the population, but the state’s population does determine the amount of Representatives it has. A bill,to become a law, has to pass through both houses in order to advance to the President. Each senator serves for at least 6 years, but some are elected at different times so that there are elections more often. Representatives, however, serve only 2 years, Some people from the Senate are the Vice President, Mike Pence, President of the Senate, and an example of a senator is John Cornyn. Some people from the House of representatives are the Speaker, the leader of the House, Paul Ryan, and an example of a representative is Mike Rogers.

-
The Legislative Branch
-
-
-
-
- - diff --git a/Schoolproject/Nick'sPage.html b/Schoolproject/Nick'sPage.html deleted file mode 100755 index 581d01d..0000000 --- a/Schoolproject/Nick'sPage.html +++ /dev/null @@ -1,56 +0,0 @@ - - - -Checks and Balances, Supremacy Clause, Bicameral legislature, Marbury Vs Madison, and the history of each. - - - - -
-
-

Checks and Balances, Supremacy Clause, Bicameral legislature, Marbury Vs Madison, and the history of each.

- -
-

Checks and Balances

-

Check and balances is a system used in the government to create shared powers. This allows a government to not be ruled by one power, but multiple. -Check and Balances in the U.S work in a way where there are three powers that can’t do certain things without the agreement of the other. The three branches Executive,Judicial, and Legislative have certain powers over others. This creates a system of checks and balances in the government that lets decision be made and have them checked by other branches and create a balanced government.

-

History

-

The framers were the first to create the system we now know as checks and balances. James Madison being known as the one to put the most effort into this idea. This system was created, because of problems seen in the past were one person can become too powerful.The most know quote was said by james Madison in the federalist papers “If men were angels, no government would be necessary.” The same paper goes on to explain the government must control itself with the 3 branches looking lover each other.

-
Checks and Balances
-

Links

-Link1 -Link2 -
-

Supremacy Clause

-

The supremacy clause was made to deal with any problems between national and local governments. The best way to put it would be “both governments could be allowed to act without mutual interference, but one government's acts could be given primacy over the other's acts in the event of actual conflict.”-Heritage guide to the Constitution. This means that if local and federal governments interfere with each other the federal government would have more of a say.

-

History

-

The supremacy clause is in article VI of the constitution. The supremacy clause was controversial, because it gave more power to the federal government rather the state government. James Madison and other people wanted to give the federal government the power to veto state laws. The Supremacy law was finally passed as a way to fix any controversy between two laws made on similar subjects by federal and local governments.

-

Links

-Link -
-

Bicameral legislature

-

Bicameral Legislature is a body of government that has two legislative house. The reason for this is to represent the citizens and the country. It also allows the states to be more involved in the central government.

-
Bicameral legislature
-

Links

-Link -
-

Marbury Vs Madison

-

Marbury Vs Madison was a case in the supreme court that was decided by John Marshall in 1803. This case started the idea that the supreme court can declare laws passed by government unconstitutional this is called judicial review.

-

The case

-

The case brought up to the supreme court was between William Marbury and James Madison. When Madison and the new president Thomas Jefferson were wrong to prevent Marbury from becoming justice of peace for Washington County in the District of Columbia. Even though the supreme court could not force them to allow Marbury to become justice of peace. This lead to Marbury never going to office after it was said the judges had no right to decide, because it conflicts with the constitution.

-
Marbury Vs Madison
-

Links

-Link -
-
-
-
- - diff --git a/Schoolproject/images/constitution.jpg b/Schoolproject/images/constitution.jpg deleted file mode 100755 index 6977abd..0000000 Binary files a/Schoolproject/images/constitution.jpg and /dev/null differ diff --git a/Schoolproject/images/pixeltrump.gif b/Schoolproject/images/pixeltrump.gif deleted file mode 100755 index 386ffcb..0000000 Binary files a/Schoolproject/images/pixeltrump.gif and /dev/null differ diff --git a/Schoolproject/images/presidents.png b/Schoolproject/images/presidents.png deleted file mode 100755 index fe1eb97..0000000 Binary files a/Schoolproject/images/presidents.png and /dev/null differ diff --git a/Schoolproject/index.html b/Schoolproject/index.html deleted file mode 100755 index c031556..0000000 --- a/Schoolproject/index.html +++ /dev/null @@ -1,39 +0,0 @@ - - - -Home - - - - -
-
-

Home

- -
- - - - - - - - - - - - -
Nicholas TorrilloJason KirkJacob McDonnellDeclan Lees
-Checks and Balances
-Supremacy Clause
-Bicameral legislature
-Marbury Vs Madison
-The History of Each
-The Three Branches
-Important People from Each Branch
-The Articles of Confederation
-Shays' Rebellion
-Paraphrasing of the U.S. Constitution
-How A Bill Becomes A Law
-Election Basics
- -
-
-
- - diff --git a/articles/.DS_Store b/articles/.DS_Store deleted file mode 100644 index a5b33a5..0000000 Binary files a/articles/.DS_Store and /dev/null differ diff --git a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.15.13 PM.png b/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.15.13 PM.png deleted file mode 100644 index 34b57f4..0000000 Binary files a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.15.13 PM.png and /dev/null differ diff --git a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.18.39 PM.png b/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.18.39 PM.png deleted file mode 100644 index 6ef28ff..0000000 Binary files a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.18.39 PM.png and /dev/null differ diff --git a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.23.20 PM.png b/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.23.20 PM.png deleted file mode 100644 index cbc9b47..0000000 Binary files a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.23.20 PM.png and /dev/null differ diff --git a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.56.21 PM.png b/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.56.21 PM.png deleted file mode 100644 index 2482da0..0000000 Binary files a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.56.21 PM.png and /dev/null differ diff --git a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.58.29 PM.png b/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.58.29 PM.png deleted file mode 100644 index c952586..0000000 Binary files a/articles/RpiRockyLinuxServer/img/Screen Shot 2022-02-19 at 2.58.29 PM.png and /dev/null differ diff --git a/articles/RpiRockyLinuxServer/index.html b/articles/RpiRockyLinuxServer/index.html deleted file mode 100755 index edf6b5b..0000000 --- a/articles/RpiRockyLinuxServer/index.html +++ /dev/null @@ -1,192 +0,0 @@ - - - - - - Raspberry Pi Rocky Linux Webserver - - - - - - - - -
-

 

-

Hosting a Website on the Raspberry Pi with Rocky Linux

- Markdown File Download -

First Download Rocky Linux for the Raspberry Pi 3 & 4 from their website.

-
Screen Shot 2022-02-19 at 2.15.13 PM
-

Next you want to burn this image to the sd card that you are going to use. Now start up the Raspberry Pi and login with the default user rocky and the password is rockylinux.

-

To make the image take up the whole drive, run:

-
sudo rootfs-expand
-			
-

Now, you should create a new user:

-
sudo useradd -m -g users -G wheel userName
-sudo passwd username
-			
-

Next, we should delete the default user so logout and login to your new user:

-
sudo userdel rocky
-			
-

 

-
-

Setting a static IP address

-

The easiest way is to run:

-
sudo nmtui
-			
-
Screen Shot 2022-02-19 at 2.18.39 PM
-

Select Edit a connection and select your network interface.

-
Screen Shot 2022-02-19 at 2.23.20 PM
-

Select Show for IPv4 CONFIGURATION and enter the IP you want to set. Then select OK at the bottom, and quit the program.

-

Securing the PI

-

SSH Key Authorization

-

The best way to secure the pi is to use an SSH key to login instead of a password. First you want to generate an SSH key by running on your computer:

-
ssh-keygen -t rsa
-			
-

Next, to copy your SSH key to your server, run:

-
ssh-copy-id -i ~/.ssh/mykey user@host
-			
-

To test that it works, run:

-
ssh -i ~/.ssh/mykey user@host
-			
-

If it worked, you should be able to connect without needing a password.

-

To force an SSH key to login, edit /etc/ssh/sshd_config using nano or vim.

-

Change PermitRootLogin yes to PermitRootLogin no and PasswordAuthentication yes to PasswordAuthentication no.

-

Setting up fail2ban

-

First start and enable firewalld to run at boot:

-
sudo systemctl start firewalld
-sudo systemctl enable firewalld
-			
-

Now, enable the EPEL repository for Rocky Linux and install fail2ban:

-
sudo dnf install epel-release -y
-sudo dnf install fail2ban fail2ban-firewalld -y
-			
-

Start and enable fail2ban to run at boot:

-
sudo systemctl start fail2ban
-sudo systemctl enable fail2ban
-			
-

Now, we have to make fail2ban work with firewalld, run:

-
sudo mv /etc/fail2ban/jail.d/00-firewalld.conf /etc/fail2ban/jail.d/00-firewalld.local
-sudo systemctl restart fail2ban
-			
-

To create an SSH jail, edit the ssh config file with vim or nano:

-
sudo nano /etc/fail2ban/jail.d/sshd.local
-			
-

Paste the following into the file and change the values as you see fit:

-
[sshd]
-enabled = true
-bantime = 1d
-maxretry = 3
-			
-

Save and close the file and restart fail2ban:

-
sudo systemctl restart fail2ban
-			
-

Setting up Dynamic DNS with Google Domains

-

Configuring Google Domains

-

First, on Domains.google.com go the DNS page for your domain. Scroll down and click on Show advanced settings, Click Manage dynamic DNS, and then click Create new record. Enter your subdomain or leave it black for the domain itself. Finally, click Save.

-

Installing ddclient

-

To install ddclient you need to enable the PowerTools Repo for the perl dependency.

-

First, install dnf-plugins-core:

-
sudo dnf -y install dnf-plugins-core
-sudo dnf upgrade
-			
-

Next, enable PowerTools:

-
sudo dnf config-manager --set-enabled powertools
-			
-

Then, you can install ddclient:

-
sudo dnf install ddclient
-			
-

Now, we want to edit the config file for ddclient:

-
sudo nano /etc/ddclient.conf
-			
-

You'll want to look for where it says protocol=dyndns2, and enter your information:

-
##
-## nsupdate.info IPV4(https://www.nsupdate.info)
-##
-protocol=dyndns2
-use=web, web=http://ipv4.nsupdate.info/myip
-server=domains.google.com
-login=username
-password=password
-domain.tld
-			
-

Wait about 5 minutes and on the Google Domains website, under Dynamic DNS you should see your IP address under Data.

-

Setting up NGINX and Let's Encrypt

-

Installing NGINX

-

First, install nginx Webserver:

-
sudo dnf install nginx
-			
-

Next, start and enable nginx to run at boot:

-
sudo systemctl start nginx
-sudo systemctl enable nginx
-			
-

Then, check the status to see if it is running:

-
sudo systemctl status nginx
-			
-
Screen Shot 2022-02-19 at 2.56.21 PM
-

Now, we have to allow HTTP traffic through the firewall:

-
sudo firewall-cmd --add-service=http --permanent
-sudo firewall-cmd --add-service=https --permanent
-sudo firewall-cmd --reload
-			
-

In a web browser, go to the local ip of the server and you should see the nginx welcome page.

-
Screen Shot 2022-02-19 at 2.58.29 PM
-

Configuring NGINX

-

First, make your folder for the website, this is where your website will live:

-
sudo mkdir -p /var/www/websiteName
-			
-

Next, we need to set the proper permissions to make sure everything works:

-
sudo chown -R nginx /var/www/websiteName
-sudo chmod -R 755 /var/www/websiteName
-			
-

Now, we will create the config file for website:

-
sudo nano /etc/nginx/conf.d/websiteName.conf
-			
-

and paste the following into the file:

-
server {
-	listen 80;
-	server_name domain.tld www.domain.tld;
-	root /var/www/websiteName;
-	index index.php index.html index.htm;
-	access_log /var/log/nginx/websiteName.access.log;
-	error_log /var/log/nginx/websiteName.error.log;
-}
-			
-

Now, confirm that the nginx configuration is ok:

-
sudo nginx -t
-			
-

Restart nginx:

-
sudo systemctl restart nginx
-sudo systemctl status nginx
-			
-

Next, set SELinux to permissive mode:

-
sudo setenforce permissive
-sudo getenforce
-			
-

Now, we will need to set SELinux to permissive mode permanently:

-
sudo sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux
-			
-

Installing and Running Certbot

-

To install Certbot run:

-
sudo dnf install certbot python3-certbot-nginx
-			
-

To get SSL certificates for your websites run:

-
sudo certbot --nginx
-			
-

Answer the prompts that show up on screen as you wish.

-

To configure auto renewal of the SSL certificate run:

-
crontab -e
-			
-

and add the following line:

-
0 12 * * * /usr/bin/certbot renew --quiet
-			
-

This will check everyday at noon to see if the certificate will expire in the next month, if so it will renew the certificate.

-

Now your website should be operational.


-
- - diff --git a/articles/RpiRockyLinuxServer/rpi4rockylinuxwebserver.md b/articles/RpiRockyLinuxServer/rpi4rockylinuxwebserver.md deleted file mode 100644 index fa93505..0000000 --- a/articles/RpiRockyLinuxServer/rpi4rockylinuxwebserver.md +++ /dev/null @@ -1,303 +0,0 @@ -# Hosting a Website on the Raspberry Pi with Rocky Linux - -First Download Rocky Linux for the Raspberry Pi 3 & 4 from [their website](https://rockylinux.org/alternative-images).![Screen Shot 2022-02-19 at 2.15.13 PM](img/Screen Shot 2022-02-19 at 2.15.13 PM.png) - -Next you want to burn this image to the sd card that you are going to use. Now start up the Raspberry Pi and login with the default user `rocky` and the password is `rockylinux`. - -To make the image take up the whole drive, run: - -```sh -sudo rootfs-expand -``` - -Now, you should create a new user: - -```sh -sudo useradd -m -g users -G wheel userName -sudo passwd username -``` - -Next, we should delete the default user so logout and login to your new user: - -```sh -sudo userdel rocky -``` - - - -*** - -## Setting a static IP address - -The easiest way is to run: - -```shell -sudo nmtui -``` - -![Screen Shot 2022-02-19 at 2.18.39 PM](img/Screen Shot 2022-02-19 at 2.18.39 PM.png) - -Select **Edit** a connection and select your network interface. - -![Screen Shot 2022-02-19 at 2.23.20 PM](img/Screen Shot 2022-02-19 at 2.23.20 PM.png) - -Select **Show** for **IPv4 CONFIGURATION** and enter the IP you want to set. Then select **OK** at the bottom, and quit the program. - -## Securing the PI - -### SSH Key Authorization - -The best way to secure the pi is to use an SSH key to login instead of a password. First you want to generate an SSH key by running on your computer: - -```sh -ssh-keygen -t rsa -``` - -Next, to copy your SSH key to your server, run: - -```sh -ssh-copy-id -i ~/.ssh/mykey user@host -``` - -To test that it works, run: - -```sh -ssh -i ~/.ssh/mykey user@host -``` - -If it worked, you should be able to connect without needing a password. - -To force an SSH key to login, edit `/etc/ssh/sshd_config` using nano or vim. - -Change `PermitRootLogin yes` to `PermitRootLogin no` and `PasswordAuthentication yes` to `PasswordAuthentication no`. - -### Setting up fail2ban - -First start and enable firewalld to run at boot: - -```sh -sudo systemctl start firewalld -sudo systemctl enable firewalld -``` - -Now, enable the EPEL repository for Rocky Linux and install fail2ban: - -```sh -sudo dnf install epel-release -y -sudo dnf install fail2ban fail2ban-firewalld -y -``` - -Start and enable fail2ban to run at boot: - -```sh -sudo systemctl start fail2ban -sudo systemctl enable fail2ban -``` - -Now, we have to make fail2ban work with firewalld, run: - -```sh -sudo mv /etc/fail2ban/jail.d/00-firewalld.conf /etc/fail2ban/jail.d/00-firewalld.local -sudo systemctl restart fail2ban -``` - -To create an SSH jail, edit the ssh config file with nano or vim: - -```sh -sudo nano /etc/fail2ban/jail.d/sshd.local -``` - -Paste the following into the file and change the values as you see fit: - -``` -[sshd] -enabled = true -bantime = 1d -maxretry = 3 -``` - -Save and close the file and restart fail2ban: - -```sh -sudo systemctl restart fail2ban -``` - -## Setting up Dynamic DNS with Google Domains - -### Configuring Google Domains - -First, on [Domains.google.com](https://domains.google.com/) go the DNS page for your domain. Scroll down and click on **Show advanced settings**, Click **Manage dynamic DNS**, and then click **Create new record**. Enter your subdomain or leave it black for the domain itself. Finally, click Save. - -### Installing ddclient - -To install ddclient you need to enable the PowerTools Repo for the perl dependency. - -First, install `dnf-plugins-core`: - -```sh -sudo dnf -y install dnf-plugins-core -sudo dnf upgrade -``` - -Next, enable PowerTools: - -```sh -sudo dnf config-manager --set-enabled powertools -``` - -Then, you can install ddclient: - -```sh -sudo dnf install ddclient -``` - -Now, we want to edit the config file for ddclient: - -```sh -sudo nano /etc/ddclient.conf -``` - -You'll want to look for where it says `protocol=dyndns2`, and enter your information: - -``` -## -## nsupdate.info IPV4(https://www.nsupdate.info) -## -protocol=dyndns2 -use=web, web=http://ipv4.nsupdate.info/myip -server=domains.google.com -login=username -password=password -domain.tld -``` - -Wait about 5 minutes and on the Google Domains website, under Dynamic DNS you should see your IP address under **Data**. - -## Setting up NGINX and Let's Encrypt - -### Installing NGINX - -First, install nginx Webserver: - -```sh -sudo dnf install nginx -``` - -Next, start and enable nginx to run at boot: - -```sh -sudo systemctl start nginx -sudo systemctl enable nginx -``` - -Then, check the status to see if it is running: - -```sh -sudo systemctl status nginx -``` - -![Screen Shot 2022-02-19 at 2.56.21 PM](img/Screen Shot 2022-02-19 at 2.56.21 PM.png) - -Now, we have to allow HTTP traffic through the firewall: - -```sh -sudo firewall-cmd --add-service=http --permanent -sudo firewall-cmd --add-service=https --permanent -sudo firewall-cmd --reload -``` - -In a web browser, go to the local ip of the server and you should see the nginx welcome page. - -![Screen Shot 2022-02-19 at 2.58.29 PM](img/Screen Shot 2022-02-19 at 2.58.29 PM.png) - -### Configuring NGINX - -First, make your folder for the website, this is where your website will live: - -```sh -sudo mkdir -p /var/www/websiteName -``` - -Next, we need to set the proper permissions to make sure everything works: - -```sh -sudo chown -R nginx /var/www/websiteName -sudo chmod -R 755 /var/www/websiteName -``` - -Now, we will create the config file for website: - -```sh -sudo nano /etc/nginx/conf.d/websiteName.conf -``` - -and paste the following into the file: - -``` -server { - listen 80; - server_name domain.tld www.domain.tld; - root /var/www/websiteName; - index index.php index.html index.htm; - access_log /var/log/nginx/websiteName.access.log; - error_log /var/log/nginx/websiteName.error.log; -} -``` - -Now, confirm that the nginx configuration is ok: - -```sh -sudo nginx -t -``` - -Restart nginx: - -```sh -sudo systemctl restart nginx -sudo systemctl status nginx -``` - -Next, set SELinux to permissive mode: - -```sh -sudo setenforce permissive -sudo getenforce -``` - -Now, we will need to set SELinux to permissive mode permanently: - -```sh -sudo sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux -``` - -### Installing and Running Certbot - -To install Certbot run: - -```sh -sudo dnf install certbot python3-certbot-nginx -``` - -To get SSL certificates for your websites run: - -```sh -sudo certbot --nginx -``` - -Answer the prompts that show up on screen as you wish. - -To configure auto renewal of the SSL certificate run: - -```sh -crontab -e -``` - -and add the following line: - -``` -0 12 * * * /usr/bin/certbot renew --quiet -``` - -This will check everyday at noon to see if the certificate will expire in the next month, if so it will renew the certificate. - -Now your website should be operational. diff --git a/articles/articleMaker.tar b/articles/articleMaker.tar deleted file mode 100644 index 6ad885d..0000000 Binary files a/articles/articleMaker.tar and /dev/null differ diff --git a/articles/index.html b/articles/index.html deleted file mode 100644 index 3d1abc7..0000000 --- a/articles/index.html +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - Jacob McDonnell - - - - - - -
-
- -

Hosting a Website on the Raspberry Pi with Rocky Linux

-

2/19/22
A tutorial on setting up a webserver on a Raspberry Pi with Rocky Linux 8

-
-
-
- - diff --git a/articles/rss.xml b/articles/rss.xml deleted file mode 100644 index e280062..0000000 --- a/articles/rss.xml +++ /dev/null @@ -1,204 +0,0 @@ - - - - -Jacob McDonnell -Articles from Jacob McDonnell. -en-us -https://jacobmcdonnell.com/rss.xml - - -Jacob McDonnell -https://jacobmcdonnell.com/favicon.ico -https://jacobmcdonnell.com/rss.xml - - - - - - - - - - - -Hosting a Website on the Raspberry Pi with Rocky Linux -https://jacobmcdonnell.com/articles/RpiRockyLinuxServer/ -https://jacobmcdonnell.com/articles/RpiRockyLinuxServer/ -Sun, 19 Feb 2022 15:00:00 -0500 -First Download Rocky Linux for the Raspberry Pi 3 & 4 from their website.

-
Screen Shot 2022-02-19 at 2.15.13 PM
-

Next you want to burn this image to the sd card that you are going to use. Now start up the Raspberry Pi and login with the default user rocky and the password is rockylinux.

-

To make the image take up the whole drive, run:

-
sudo rootfs-expand
-			
-

Now, you should create a new user:

-
sudo useradd -m -g users -G wheel userName
-sudo passwd username
-			
-

Next, we should delete the default user so logout and login to your new user:

-
sudo userdel rocky
-			
-

 

-
-

Setting a static IP address

-

The easiest way is to run:

-
sudo nmtui
-			
-
Screen Shot 2022-02-19 at 2.18.39 PM
-

Select Edit a connection and select your network interface.

-
Screen Shot 2022-02-19 at 2.23.20 PM
-

Select Show for IPv4 CONFIGURATION and enter the IP you want to set. Then select OK at the bottom, and quit the program.

-

Securing the PI

-

SSH Key Authorization

-

The best way to secure the pi is to use an SSH key to login instead of a password. First you want to generate an SSH key by running on your computer:

-
ssh-keygen -t rsa
-			
-

Next, to copy your SSH key to your server, run:

-
ssh-copy-id -i ~/.ssh/mykey user@host
-			
-

To test that it works, run:

-
ssh -i ~/.ssh/mykey user@host
-			
-

If it worked, you should be able to connect without needing a password.

-

To force an SSH key to login, edit /etc/ssh/sshd_config using nano or vim.

-

Change PermitRootLogin yes to PermitRootLogin no and PasswordAuthentication yes to PasswordAuthentication no.

-

Setting up fail2ban

-

First start and enable firewalld to run at boot:

-
sudo systemctl start firewalld
-sudo systemctl enable firewalld
-			
-

Now, enable the EPEL repository for Rocky Linux and install fail2ban:

-
sudo dnf install epel-release -y
-sudo dnf install fail2ban fail2ban-firewalld -y
-			
-

Start and enable fail2ban to run at boot:

-
sudo systemctl start fail2ban
-sudo systemctl enable fail2ban
-			
-

Now, we have to make fail2ban work with firewalld, run:

-
sudo mv /etc/fail2ban/jail.d/00-firewalld.conf /etc/fail2ban/jail.d/00-firewalld.local
-sudo systemctl restart fail2ban
-			
-

To create an SSH jail, edit the ssh config file with vim or nano:

-
sudo nano /etc/fail2ban/jail.d/sshd.local
-			
-

Paste the following into the file and change the values as you see fit:

-
[sshd]
-enabled = true
-bantime = 1d
-maxretry = 3
-			
-

Save and close the file and restart fail2ban:

-
sudo systemctl restart fail2ban
-			
-

Setting up Dynamic DNS with Google Domains

-

Configuring Google Domains

-

First, on Domains.google.com go the DNS page for your domain. Scroll down and click on Show advanced settings, Click Manage dynamic DNS, and then click Create new record. Enter your subdomain or leave it black for the domain itself. Finally, click Save.

-

Installing ddclient

-

To install ddclient you need to enable the PowerTools Repo for the perl dependency.

-

First, install dnf-plugins-core:

-
sudo dnf -y install dnf-plugins-core
-sudo dnf upgrade
-			
-

Next, enable PowerTools:

-
sudo dnf config-manager --set-enabled powertools
-			
-

Then, you can install ddclient:

-
sudo dnf install ddclient
-			
-

Now, we want to edit the config file for ddclient:

-
sudo nano /etc/ddclient.conf
-			
-

You'll want to look for where it says protocol=dyndns2, and enter your information:

-
##
-## nsupdate.info IPV4(https://www.nsupdate.info)
-##
-protocol=dyndns2
-use=web, web=http://ipv4.nsupdate.info/myip
-server=domains.google.com
-login=username
-password=password
-domain.tld
-			
-

Wait about 5 minutes and on the Google Domains website, under Dynamic DNS you should see your IP address under Data.

-

Setting up NGINX and Let's Encrypt

-

Installing NGINX

-

First, install nginx Webserver:

-
sudo dnf install nginx
-			
-

Next, start and enable nginx to run at boot:

-
sudo systemctl start nginx
-sudo systemctl enable nginx
-			
-

Then, check the status to see if it is running:

-
sudo systemctl status nginx
-			
-
Screen Shot 2022-02-19 at 2.56.21 PM
-

Now, we have to allow HTTP traffic through the firewall:

-
sudo firewall-cmd --add-service=http --permanent
-sudo firewall-cmd --add-service=https --permanent
-sudo firewall-cmd --reload
-			
-

In a web browser, go to the local ip of the server and you should see the nginx welcome page.

-
Screen Shot 2022-02-19 at 2.58.29 PM
-

Configuring NGINX

-

First, make your folder for the website, this is where your website will live:

-
sudo mkdir -p /var/www/websiteName
-			
-

Next, we need to set the proper permissions to make sure everything works:

-
sudo chown -R nginx /var/www/websiteName
-sudo chmod -R 755 /var/www/websiteName
-			
-

Now, we will create the config file for website:

-
sudo nano /etc/nginx/conf.d/websiteName.conf
-			
-

and paste the following into the file:

-
server {
-	listen 80;
-	server_name domain.tld www.domain.tld;
-	root /var/www/websiteName;
-	index index.php index.html index.htm;
-	access_log /var/log/nginx/websiteName.access.log;
-	error_log /var/log/nginx/websiteName.error.log;
-}
-			
-

Now, confirm that the nginx configuration is ok:

-
sudo nginx -t
-			
-

Restart nginx:

-
sudo systemctl restart nginx
-sudo systemctl status nginx
-			
-

Next, set SELinux to permissive mode:

-
sudo setenforce permissive
-sudo getenforce
-			
-

Now, we will need to set SELinux to permissive mode permanently:

-
sudo sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux
-			
-

Installing and Running Certbot

-

To install Certbot run:

-
sudo dnf install certbot python3-certbot-nginx
-			
-

To get SSL certificates for your websites run:

-
sudo certbot --nginx
-			
-

Answer the prompts that show up on screen as you wish.

-

To configure auto renewal of the SSL certificate run:

-
crontab -e
-			
-

and add the following line:

-
0 12 * * * /usr/bin/certbot renew --quiet
-			
-

This will check everyday at noon to see if the certificate will expire in the next month, if so it will renew the certificate.

-

Now your website should be operational.


-]]>
-
- - - -
- -
diff --git a/db.py b/db.py new file mode 100755 index 0000000..ea42c73 --- /dev/null +++ b/db.py @@ -0,0 +1,22 @@ +import redis + +class DB: + def __init__(self, host='localhost', port=6379): + self.db = redis.Redis(host=host, port=port, decode_responses=True) + + def add_article(r, article): + r.db.hset(f"articles:{article['url']}", mapping=article) + + def get_article(r, name): + return r.db.hgetall(f"articles:{name}") + + def get_all_articles(r): + keys = r.get_all_articles_keys() + return [r.db.hgetall(key) for key in keys] + + def get_all_articles_keys(r): + return [key for key in r.db.scan_iter(f"articles:*")] + + def get_all_keys(r): + return [key for key in r.db.scan_iter("*")] + diff --git a/favicon.ico b/favicon.ico deleted file mode 100644 index 2224936..0000000 Binary files a/favicon.ico and /dev/null differ diff --git a/fonts/IBMPlexMono-Regular.ttf b/fonts/IBMPlexMono-Regular.ttf deleted file mode 100644 index 90325c8..0000000 Binary files a/fonts/IBMPlexMono-Regular.ttf and /dev/null differ diff --git a/images/LOGO_21x127.png b/images/LOGO_21x127.png deleted file mode 100755 index 22e3daf..0000000 Binary files a/images/LOGO_21x127.png and /dev/null differ diff --git a/images/LOGO_21x127.svg b/images/LOGO_21x127.svg deleted file mode 100755 index c888b2f..0000000 --- a/images/LOGO_21x127.svg +++ /dev/null @@ -1,78 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/images/LOGO_Transparent.png b/images/LOGO_Transparent.png deleted file mode 100755 index 43e6e4f..0000000 Binary files a/images/LOGO_Transparent.png and /dev/null differ diff --git a/images/LOGO_Transparent.svg b/images/LOGO_Transparent.svg deleted file mode 100755 index c4eb9c6..0000000 --- a/images/LOGO_Transparent.svg +++ /dev/null @@ -1,74 +0,0 @@ - - - - - - - - image/svg+xml - - - - - - - - - diff --git a/images/SideFlareGreen.svg b/images/SideFlareGreen.svg deleted file mode 100755 index 130f9f1..0000000 --- a/images/SideFlareGreen.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/images/SideFlarePurple.svg b/images/SideFlarePurple.svg deleted file mode 100755 index 2249c62..0000000 --- a/images/SideFlarePurple.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/images/favicon.xcf b/images/favicon.xcf deleted file mode 100644 index 344fd42..0000000 Binary files a/images/favicon.xcf and /dev/null differ diff --git a/images/menu.svg b/images/menu.svg deleted file mode 100755 index 7f1a394..0000000 --- a/images/menu.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/images/wave.svg b/images/wave.svg deleted file mode 100755 index 130f9f1..0000000 --- a/images/wave.svg +++ /dev/null @@ -1,3 +0,0 @@ - - - diff --git a/index.html b/index.html deleted file mode 100755 index 4b99370..0000000 --- a/index.html +++ /dev/null @@ -1,36 +0,0 @@ - - - - - - Jacob McDonnell - - - - - - - - -
-

About

-

I'm Jacob McDonnell. I have been interested in computers since I was young. - My father has been in the technology field since before I was born, so I guess that interest came from him. -

My interests, with respect to computers, are programming, UNIX/Plan9, and electronics/hardware. - I know how to program in Java thanks to a high school course, and I like the language for somethings. - Currently, I am learning the Go programming language with the hope to replace Java for a nice compiled single binary file. I would like to write my own unix-like operating system one day. - In my free time I like to play basketball, row, practice German and Russian, and play guitar.

- I do not know what I will do with this website just yet, maybe I will write articles about projects that I am - working on.

-

Projects

-

Jed is my own version of ed, currently written in java.

-

Ticalcprograms are a set of - small programs written in C for the TI-84 Plus CE graphing calculator.

-
- - diff --git a/loadarticle.py b/loadarticle.py new file mode 100755 index 0000000..451ddd6 --- /dev/null +++ b/loadarticle.py @@ -0,0 +1,34 @@ +import db +import sys +import datetime + +path = input("Enter path to db entry backup: ") +sys.path.append(path) +import dbbak + +r = db.DB() +r.add_article(dbbak.db_entry) +print(r.get_all_keys()) +print(r.get_article(dbbak.db_entry['url'])) + +def gen_item(article): + date = article["date"].split("/") + date = datetime.date(int(date[2]), int(date[0]), int(date[1])) + item = [ '', f'{article["title"]}', f'https://jacobmcdonnell.com/articles/article["url"]/', f'https://jacobmcdonnell.com/articles/article["url"]/', f'{date.strftime("%d %b %Y")} 00:00:00 -0500', '', '' ] + return "\n".join(item) + +def gen_rss(): + rss = ['', '', '', 'Jacob McDonnell', 'Articles from Jacob McDonnell.', 'en-us', 'https://jacobmcdonnell.com/rss.xml', '', '', 'Jacob McDonnell', 'https://jacobmcdonnell.com/favicon.ico', 'https://jacobmcdonnell.com/rss.xml', '' ] + articles = sorted(r.get_all_articles(), reverse=True, key=lambda d: d['id']) + for article in articles: + rss.append(gen_item(article)) + rss.append("") + rss = "\n".join(rss) + file = open("static/rss.xml", "w") + file.write(rss) + file.close() + +rss = input("Do you want to generate a new rss file? [y or n]: ") +if rss == 'y': + gen_rss() + diff --git a/main.py b/main.py new file mode 100755 index 0000000..7c530fc --- /dev/null +++ b/main.py @@ -0,0 +1,73 @@ +from flask import Flask, render_template, send_file +from markdown import markdown +from db import DB + +app = Flask(__name__) +r = DB() + +@app.route('/') +def home(): + return render_template("template.html", body=markdown(read_file("static/home.md"))) + +@app.route('/articles//') +def load_article(site): + '''Capture a given article page and load it''' + article = r.get_article(site) + body = markdown(read_file(article["file"])) + return render_template("articletemplate.html", body=body) + +@app.route('/articles/
/img/') +def get_article_images(article, image): + '''Capture a url for an image in an article and return the file''' + return send_file(f"static/articles/{article}/img/{image}", mimetype='image/png') + +@app.route('/articles/') +def articles_page(): + '''Render the main articles page''' + articles = sorted(r.get_all_articles(), reverse=True, key=lambda d: d['id']) + html = ['
'] + for article in articles: + html.append(f'

{article["title"]}

{article["date"]}
{article["desc"]}

') + html.append("
") + return render_template("articletemplate.html", body="".join(html)) + +@app.route("/card") +def get_card(): + return send_file("static/business_card") + +@app.route("/rss.xml") +@app.route("/rss") +def get_rss(): + return send_file("static/rss.xml") + +@app.route('/css/') +def get_css(file): + return send_file(f"static/css/{file}", mimetype='text/css') + +@app.route('/favicon.ico') +def get_favicon(): + return send_file("static/favicon.ico", mimetype='image/ico') + +@app.route('/robots.txt') +def get_robots(): + return send_file("static/robots.txt", mimetype='text/text') + +@app.route("/testpage") +def test_page(): + return render_template("template.html", body=read_file("static/testpage.html")) + +@app.errorhandler(404) +@app.errorhandler(500) +def page_not_found(e): + return render_template('template.html', body=markdown(read_file("static/404.md"))) + +def read_file(file): + '''Read a given html file and return string''' + file = open(file, "r") + body = file.read() + file.close() + return body + +if __name__ == "__main__": + app.run(host="0.0.0.0") + diff --git a/robots.txt b/robots.txt deleted file mode 100755 index 8cd68bd..0000000 --- a/robots.txt +++ /dev/null @@ -1,8 +0,0 @@ -User-agent: * -Disallow: /CSS -Disallow: /JS -Disallow: /Schoolproject -Disallow: /images -Disallow: /404.html -Disallow: /template.html -Disallow: /testPage.html diff --git a/static/404.md b/static/404.md new file mode 100755 index 0000000..39aa110 --- /dev/null +++ b/static/404.md @@ -0,0 +1,4 @@ +
+# 404 Page Not Found +Maybe you want to go to one of the pages in nav bar instead. +
diff --git a/static/README.md b/static/README.md new file mode 100755 index 0000000..997cafb --- /dev/null +++ b/static/README.md @@ -0,0 +1,39 @@ +# What have you stumbled upon? + +This is the custom made startup page of mine. Please do not do anything to it. If you want to take some code feel free to. If you want to see what I plan on doing look below at the [Checklist](#check-list). + +# Check list + +## Overview + +This is a checklist of what needs to be done on this website. + +*** + +## Table of Contents + +- [Important Things to get done](#Imporant) +- [Unimportant Things to do](#Unimportant) +- [Completed](#Completed) + +*** + +## Imporant + +- none + +*** + +## Unimportant + +- none + +*** + +## Completed + +- ~~Create a READ.MD file~~ +- ~~Buy the domain jacobmcdonnell.com~~ +- ~~Merge or Seperate Main and Mobile CSS files~~ + +*** diff --git a/static/articles/rpilinuxserver/__pycache__/dbbak.cpython-310.pyc b/static/articles/rpilinuxserver/__pycache__/dbbak.cpython-310.pyc new file mode 100755 index 0000000..2b2ab9d Binary files /dev/null and b/static/articles/rpilinuxserver/__pycache__/dbbak.cpython-310.pyc differ diff --git a/static/articles/rpilinuxserver/dbbak.py b/static/articles/rpilinuxserver/dbbak.py new file mode 100755 index 0000000..900780d --- /dev/null +++ b/static/articles/rpilinuxserver/dbbak.py @@ -0,0 +1,8 @@ +db_entry = { + "title": "Hosting a Website on the Raspberry Pi with Rocky Linux", + "date": "02/19/2022", + "file": "static/articles/rpilinuxserver/rpilinuxserver.md", + "desc": "A tutorial on setting up a webserver on a Raspberry Pi with Rocky Linux 8", + "url": "rpilinuxserver", + "id": 1 +} diff --git a/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.15.13PM.png b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.15.13PM.png new file mode 100755 index 0000000..34b57f4 Binary files /dev/null and b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.15.13PM.png differ diff --git a/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.18.39PM.png b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.18.39PM.png new file mode 100755 index 0000000..6ef28ff Binary files /dev/null and b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.18.39PM.png differ diff --git a/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.23.20PM.png b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.23.20PM.png new file mode 100755 index 0000000..cbc9b47 Binary files /dev/null and b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.23.20PM.png differ diff --git a/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.56.21PM.png b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.56.21PM.png new file mode 100755 index 0000000..2482da0 Binary files /dev/null and b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.56.21PM.png differ diff --git a/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.58.29PM.png b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.58.29PM.png new file mode 100755 index 0000000..c952586 Binary files /dev/null and b/static/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.58.29PM.png differ diff --git a/static/articles/rpilinuxserver/rpilinuxserver.md b/static/articles/rpilinuxserver/rpilinuxserver.md new file mode 100755 index 0000000..e89ff5e --- /dev/null +++ b/static/articles/rpilinuxserver/rpilinuxserver.md @@ -0,0 +1,339 @@ +# Hosting a Website on the Raspberry Pi with Rocky Linux + +First Download Rocky Linux for the Raspberry Pi 3 & 4 from +[their website](https://rockylinux.org/alternative-images). + +
+![Screen Shot 2022-02-19 at 2.15.13 PM](/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.15.13PM.png) +
+ +Next you want to burn this image to the sd card that you are going to use. Now +start up the Raspberry Pi and login with the default user `rocky` and the +password is `rockylinux`. + +To make the image take up the whole drive, run: + +

+sudo rootfs-expand
+
+ +Now, you should create a new user: + +

+sudo useradd -m -g users -G wheel userName
+sudo passwd username
+
+ +Next, we should delete the default user so logout and login to your new user: + +

+sudo userdel rocky
+
+ + + +*** + +## Setting a static IP address + +The easiest way is to run: + +

+sudo nmtui
+
+ +
+![Screen Shot 2022-02-19 at 2.18.39 PM](/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.18.39PM.png) +
+ +Select **Edit** a connection and select your network interface. + +
+![Screen Shot 2022-02-19 at 2.23.20 PM](/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.23.20PM.png) +
+ +Select **Show** for **IPv4 CONFIGURATION** and enter the IP you want to set. +Then select **OK** at the bottom, and quit the program. + +## Securing the PI + +### SSH Key Authorization + +The best way to secure the pi is to use an SSH key to login instead of a +password. First you want to generate an SSH key by running on your computer: + +

+ssh-keygen -t rsa
+
+ +Next, to copy your SSH key to your server, run: + +

+ssh-copy-id -i ~/.ssh/mykey user@host
+
+ +To test that it works, run: + +

+ssh -i ~/.ssh/mykey user@host
+
+ +If it worked, you should be able to connect without needing a password. + +To force an SSH key to login, edit `/etc/ssh/sshd_config` using nano or vim. + +Change + +

+PermitRootLogin yes
+PasswordAuthentication yes
+
+to +

+PermitRootLogin no
+PasswordAuthentication no
+
+ +### Setting up fail2ban + +First start and enable firewalld to run at boot: + +

+sudo systemctl start firewalld
+sudo systemctl enable firewalld
+
+ +Now, enable the EPEL repository for Rocky Linux and install fail2ban: + +

+sudo dnf install epel-release -y
+sudo dnf install fail2ban fail2ban-firewalld -y
+
+ +Start and enable fail2ban to run at boot: + +

+sudo systemctl start fail2ban
+sudo systemctl enable fail2ban
+
+ +Now, we have to make fail2ban work with firewalld, run: + +

+sudo mv /etc/fail2ban/jail.d/00-firewalld.conf /etc/fail2ban/jail.d/00-firewalld.local
+sudo systemctl restart fail2ban
+
+ +To create an SSH jail, edit the ssh config file with nano or vim: + +

+sudo nano /etc/fail2ban/jail.d/sshd.local
+
+ +Paste the following into the file and change the values as you see fit: + +

+[sshd]
+enabled = true
+bantime = 1d
+maxretry = 3
+
+ +Save and close the file and restart fail2ban: + +

+sudo systemctl restart fail2ban
+
+ +## Setting up Dynamic DNS with Google Domains + +### Configuring Google Domains + +First, on [Domains.google.com](https://domains.google.com/) go the DNS page for +your domain. Scroll down and click on **Show advanced settings**, Click **Manage +dynamic DNS**, and then click **Create new record**. Enter your subdomain or +leave it black for the domain itself. Finally, click Save. + +### Installing ddclient + +To install ddclient you need to enable the PowerTools Repo for the perl +dependency. + +First, install `dnf-plugins-core`: + +

+sudo dnf -y install dnf-plugins-core
+sudo dnf upgrade
+
+ +Next, enable PowerTools: + +

+sudo dnf config-manager --set-enabled powertools
+
+ +Then, you can install ddclient: + +

+sudo dnf install ddclient
+
+ +Now, we want to edit the config file for ddclient: + +

+sudo nano /etc/ddclient.conf
+
+ +You'll want to look for where it says `protocol=dyndns2`, and enter your +information: + +

+##
+## nsupdate.info IPV4(https://www.nsupdate.info)
+##
+protocol=dyndns2
+use=web, web=http://ipv4.nsupdate.info/myip
+server=domains.google.com
+login=username
+password=password
+domain.tld
+
+ +Wait about 5 minutes and on the Google Domains website, under Dynamic DNS you +should see your IP address under **Data**. + +## Setting up NGINX and Let's Encrypt + +### Installing NGINX + +First, install nginx Webserver: + +

+sudo dnf install nginx
+
+ +Next, start and enable nginx to run at boot: + +

+sudo systemctl start nginx
+sudo systemctl enable nginx
+
+ +Then, check the status to see if it is running: + +

+sudo systemctl status nginx
+
+ +
+![Screen Shot 2022-02-19 at 2.56.21 PM](/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.56.21PM.png) +
+ +Now, we have to allow HTTP traffic through the firewall: + +

+sudo firewall-cmd --add-service=http --permanent
+sudo firewall-cmd --add-service=https --permanent
+sudo firewall-cmd --reload
+
+ +In a web browser, go to the local ip of the server and you should see the nginx +welcome page. + +
+![Screen Shot 2022-02-19 at 2.58.29 PM](/articles/rpilinuxserver/img/ScreenShot2022-02-19at2.58.29PM.png) +
+ +### Configuring NGINX + +First, make your folder for the website, this is where your website will live: + +

+sudo mkdir -p /var/www/websiteName
+
+ +Next, we need to set the proper permissions to make sure everything works: + +

+sudo chown -R nginx /var/www/websiteName
+sudo chmod -R 755 /var/www/websiteName
+
+ +Now, we will create the config file for website: + +

+sudo nano /etc/nginx/conf.d/websiteName.conf
+
+ +and paste the following into the file: + +

+server {
+    listen 80;
+    server_name domain.tld www.domain.tld;
+    root /var/www/websiteName;
+    index index.php index.html index.htm;
+    access_log /var/log/nginx/websiteName.access.log;
+    error_log /var/log/nginx/websiteName.error.log;
+}
+
+ +Now, confirm that the nginx configuration is ok: + +

+sudo nginx -t
+
+ +Restart nginx: + +

+sudo systemctl restart nginx
+sudo systemctl status nginx
+
+ +Next, set SELinux to permissive mode: + +

+sudo setenforce permissive
+sudo getenforce
+
+ +Now, we will need to set SELinux to permissive mode permanently: + +

+sudo sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=permissive/g' /etc/sysconfig/selinux
+
+ +### Installing and Running Certbot + +To install Certbot run: + +

+sudo dnf install certbot python3-certbot-nginx
+
+ +To get SSL certificates for your websites run: + +

+sudo certbot --nginx
+
+ +Answer the prompts that show up on screen as you wish. + +To configure auto renewal of the SSL certificate run: + +

+crontab -e
+
+ +and add the following line: + +

+0 12 * * * /usr/bin/certbot renew --quiet
+
+ +This will check everyday at noon to see if the certificate will expire in the +next month, if so it will renew the certificate. + +Now your website should be operational. + diff --git a/static/business_card b/static/business_card new file mode 100755 index 0000000..1f838b9 --- /dev/null +++ b/static/business_card @@ -0,0 +1,13 @@ +╭──────────────────────────────────────────────────────────────╮ +│ │ +│ Jacob McDonnell │ +│ │ +│ Email: jacob@jacobmcdonnell.com │ +│ Web: https://jacobmcdonnell.com/ │ +│ │ +│ GitHub: https://github.com/JacobMcDonnell │ +│ LinkedIn: https://linkedin.com/JacobMcDonnell │ +│ │ +│ Card: curl -sL https://jacobmcdonnell.com/card │ +│ │ +╰──────────────────────────────────────────────────────────────╯ diff --git a/static/css/main.css b/static/css/main.css new file mode 100755 index 0000000..445f082 --- /dev/null +++ b/static/css/main.css @@ -0,0 +1,148 @@ +/* + * Color scheme + * Background color: #eaefef + * Code background: #d4d9d9 + * Main color: #00558e + * Secondary color: #0b3075 + */ +:root { + --color-1: #eaefef; + --color-2: #d4d9d9; + --color-3: #00558e; + --color-4: #0b3075; + } +body{ + background-color:var(--color-1); + color:var(--color-3); +} +a{ + color: var(--color-3); +} +ul.topBar{ + background-color:var(--color-3); +} +li.topLink a{ + color:var(--color-1); +} +li.topLink a:hover{ + background-color:var(--color-4); +} +.search{ + color:var(--color-3); + background-color:var(--color-1); + border-color:var(--color-3); +} +pre code { + background-color: var(--color-2); +} + +@media (prefers-color-scheme: dark) { + /* + * Color scheme + * Background color: #0D1F22 + * Text Color: #eaefef + * Main color: #00558e + * Secondary color: #0b3075 + */ + :root { + --color-1: #0D1F22; + --color-2: #081417; + --color-3: #00558e; + --color-4: #0b3075; + --text-color: #eaefef; + } + body{ + background-color:var(--color-1); + color:var(--text-color); + } + a{ + color: var(--text-color); + } + ul.topBar{ + background-color:var(--color-3); + } + li.topLink a{ + color:var(--text-color); + } + li.topLink a:hover{ + background-color:var(--color-4); + } + .search{ + color:var(--color-3); + background-color:var(--text-color); + border-color:var(--color-3); + } + pre code { + background-color: var(--color-2); + } +} + +/* Common CSS styling */ +body{ + font-family:Arial; +} +ul.topBar{ + text-transform:uppercase; + margin:0; + padding:0; + overflow:hidden; + list-style-type:none; +} +li.topLink{ + float:left; +} +li.topLink a{ + display:block; + text-align:center; + padding:0.875rem 1rem; + text-decoration:none; +} +.main{ + margin:auto; + width:60%; +} +.search{ + padding:0.75rem 1.25rem 0.75rem; + width:90%; + border-radius:0.3125rem; + margin-left:auto; + margin-right:auto; + margin-bottom:15em; + font-family:IBM Plex Mono; +} +pre code { + border: 0.0625rem solid #999; + display: block; + overflow:auto; + padding: 0.625rem; +} +.icon{ + font-size:12.5rem; + margin-top:0.625rem; + margin-bottom:0.625rem; +} + +@media only screen and (orientation: portrait){ + .main{ + margin:auto; + width:90%; + } +} + +div.article a{ + text-decoration:none; + display:block; +} + +/* Highlighting of article title */ +/* div.article{ */ +/* padding: 0.625rem; */ +/* } */ + +/* div.article a:hover{ */ +/* background-color:var(--color-2); */ +/* } */ + +img { + width:75%; +} diff --git a/static/favicon.ico b/static/favicon.ico new file mode 100755 index 0000000..2224936 Binary files /dev/null and b/static/favicon.ico differ diff --git a/static/home.md b/static/home.md new file mode 100755 index 0000000..69e7533 --- /dev/null +++ b/static/home.md @@ -0,0 +1,23 @@ +## About +I'm Jacob McDonnell. I have been interested in computers since I was young. +My father has been in the technology field since before I was born, so I guess +that interest came from him. + +My interests, with respect to computers, are programming, UNIX/Plan9, and +electronics/hardware. I know how to program in Java thanks to a high school +course, and I like the language for somethings. Currently, I am learning the +Go programming language with the hope to replace Java for a nice compiled +single binary file. I would like to write my own unix-like operating system one +day. In my free time I like to play basketball, row, practice German and +Russian, and play guitar. + +I do not know what I will do with this website just yet, maybe I will write +articles about projects that I am working on. + +## Projects +[This Website](https://github.com/JacobMcDonnell/JacobMcDonnell.com) is written +in Python using Flask. + +[Jed](https://github.com/JacobMcDonnell/jed) is my own version of ed, currently +written in java. + diff --git a/static/images/LOGO_21x127.png b/static/images/LOGO_21x127.png new file mode 100755 index 0000000..22e3daf Binary files /dev/null and b/static/images/LOGO_21x127.png differ diff --git a/static/images/LOGO_21x127.svg b/static/images/LOGO_21x127.svg new file mode 100755 index 0000000..c888b2f --- /dev/null +++ b/static/images/LOGO_21x127.svg @@ -0,0 +1,78 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/static/images/LOGO_Transparent.png b/static/images/LOGO_Transparent.png new file mode 100755 index 0000000..43e6e4f Binary files /dev/null and b/static/images/LOGO_Transparent.png differ diff --git a/static/images/LOGO_Transparent.svg b/static/images/LOGO_Transparent.svg new file mode 100755 index 0000000..c4eb9c6 --- /dev/null +++ b/static/images/LOGO_Transparent.svg @@ -0,0 +1,74 @@ + + + + + + + + image/svg+xml + + + + + + + + + diff --git a/static/images/SideFlareGreen.svg b/static/images/SideFlareGreen.svg new file mode 100755 index 0000000..130f9f1 --- /dev/null +++ b/static/images/SideFlareGreen.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/images/SideFlarePurple.svg b/static/images/SideFlarePurple.svg new file mode 100755 index 0000000..2249c62 --- /dev/null +++ b/static/images/SideFlarePurple.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/images/favicon.xcf b/static/images/favicon.xcf new file mode 100755 index 0000000..344fd42 Binary files /dev/null and b/static/images/favicon.xcf differ diff --git a/static/images/menu.svg b/static/images/menu.svg new file mode 100755 index 0000000..7f1a394 --- /dev/null +++ b/static/images/menu.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/images/wave.svg b/static/images/wave.svg new file mode 100755 index 0000000..130f9f1 --- /dev/null +++ b/static/images/wave.svg @@ -0,0 +1,3 @@ + + + diff --git a/static/robots.txt b/static/robots.txt new file mode 100755 index 0000000..14067d6 --- /dev/null +++ b/static/robots.txt @@ -0,0 +1,6 @@ +User-agent: * +Disallow: /css +Disallow: /images +Disallow: /404.html +Disallow: /testPage + diff --git a/static/rss.xml b/static/rss.xml new file mode 100755 index 0000000..badc2e5 --- /dev/null +++ b/static/rss.xml @@ -0,0 +1,23 @@ + + + +Jacob McDonnell +Articles from Jacob McDonnell. +en-us +https://jacobmcdonnell.com/rss.xml + + +Jacob McDonnell +https://jacobmcdonnell.com/favicon.ico +https://jacobmcdonnell.com/rss.xml + + +Hosting a Website on the Raspberry Pi with Rocky Linux +https://jacobmcdonnell.com/articles/article["url"]/ +https://jacobmcdonnell.com/articles/article["url"]/ +19 Feb 2022 00:00:00 -0500 + + + \ No newline at end of file diff --git a/static/testpage.html b/static/testpage.html new file mode 100755 index 0000000..382cbf2 --- /dev/null +++ b/static/testpage.html @@ -0,0 +1,75 @@ +

Projects

+

Jed is my own version of jed, currently written in java.

+

Ticalcprograms are a set of small programs written in C for the TI-84 Pluse CE graphing calculator.

+

About

+

I'm Jacob McDonnell. I have been interested in computers since I was young. My father has been in the technology field since before I was born, so I guess that interest came from him.

My interests, with respect to computers, are programming, UNIX/Plan9, and electronics/hardware. I know how to program in Java thanks to a high school course, and I like the language for somethings. Currently I am learning the C programming language with the hopes to write my own operating system one day. In my free time I like to play basketball, row, practice German and Russian, and play guitar.

I do not know what I will do with this website just yet, maybe I will write articles about projects that I am working on.

+
+
+#include <stdio.h>
+
+int
+main(void) {
+printf("hello world\n");
+return 0;
+}
+
+
+
+

JED - Jacob's ed

+

Jed is a line mode text editor written in Java. It is similar to ed but not a clone, infact the commands are changed. It currently works but has much room for improvement.

+

Commands

+

+Jed commands:
+
+q: quits.
+
+w: writes the file.
+
+w: filename: writes with inputted name.
+
+o: filename: opens the file.
+
+a: appends user input to the end of the file.
+
+A: appends user input after the current line.
+
+p: prints the file.
+
+n: prints the file with line numbers.
+
+c: deletes and changes the current line.
+
+d: deletes the current line.
+
+Any integer: changes to that line number.
+
+g/expression/: finds and prints the expression.
+
+%s/expression/newExpression/: replaces an expression
+with new user input through the whole file.
+
+zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
+
+<integer, integer>: prefix works with d
+and s/ex/nex/ for a range of line.
+
+s/expression/newExpression/: replaces an
+expression with new user input in the current line.
+
+h: prints the commands and their description.
+
+

Building Jed

+

+make
+sudo cp jed /usr/bin/jed && sudo cp jed.jar /usr/bin/jed.jar
+
+

TODO

+
    +
  • Add Regex support
  • +
  • check and rewrite poorly written functions
  • +
+
+

Test of Equations

+ +
+

diff --git a/template.html b/template.html deleted file mode 100755 index 4150317..0000000 --- a/template.html +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - Jacob McDonnell - - - - - -
-
- - diff --git a/templates/404.html b/templates/404.html new file mode 100755 index 0000000..66918f5 --- /dev/null +++ b/templates/404.html @@ -0,0 +1,23 @@ + + + + + + 404 Page Not Found + + + + + +
+
+

404 Page Not Found

+

Maybe you want to go to one of the pages in nav bar instead.

+
+
+ + diff --git a/templates/articletemplate.html b/templates/articletemplate.html new file mode 100755 index 0000000..4ba1204 --- /dev/null +++ b/templates/articletemplate.html @@ -0,0 +1,23 @@ + + + + + + Raspberry Pi Rocky Linux Webserver + + + + + + + + +
+ {{body|safe}} +
+ + diff --git a/templates/template.html b/templates/template.html new file mode 100755 index 0000000..a4e8c28 --- /dev/null +++ b/templates/template.html @@ -0,0 +1,25 @@ + + + + + + + + + + Jacob McDonnell + + + + + +
+ {{body|safe}} +
+ + diff --git a/testPage.html b/testPage.html deleted file mode 100755 index fac740e..0000000 --- a/testPage.html +++ /dev/null @@ -1,99 +0,0 @@ - - - - - - Jacob McDonnell - - - - - - - - - -
-

Projects

-

Jed is my own version of jed, currently written in java.

-

Ticalcprograms are a set of small programs written in C for the TI-84 Pluse CE graphing calculator.

-

About

-

I'm Jacob McDonnell. I have been interested in computers since I was young. My father has been in the technology field since before I was born, so I guess that interest came from him.

My interests, with respect to computers, are programming, UNIX/Plan9, and electronics/hardware. I know how to program in Java thanks to a high school course, and I like the language for somethings. Currently I am learning the C programming language with the hopes to write my own operating system one day. In my free time I like to play basketball, row, practice German and Russian, and play guitar.

I do not know what I will do with this website just yet, maybe I will write articles about projects that I am working on.

-
-				
-#include <stdio.h>
-
-int
-main(void) {
-	printf("hello world\n");
-	return 0;
-}
-				
-			
-
-

JED - Jacob's ed

-

Jed is a line mode text editor written in Java. It is similar to ed but not a clone, infact the commands are changed. It currently works but has much room for improvement.

-

Commands

-

-Jed commands:
-
-q: quits.
-
-w: writes the file.
-
-w: filename: writes with inputted name.
-
-o: filename: opens the file.
-
-a: appends user input to the end of the file.
-
-A: appends user input after the current line.
-
-p: prints the file.
-
-n: prints the file with line numbers.
-
-c: deletes and changes the current line.
-
-d: deletes the current line.
-
-Any integer: changes to that line number.
-
-g/expression/: finds and prints the expression.
-
-%s/expression/newExpression/: replaces an expression
-with new user input through the whole file.
-
-zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz
-
-<integer, integer>: prefix works with d
-and s/ex/nex/ for a range of line.
-
-s/expression/newExpression/: replaces an
-expression with new user input in the current line.
-
-h: prints the commands and their description.
-			
-

Building Jed

-

-make
-sudo cp jed /usr/bin/jed && sudo cp jed.jar /usr/bin/jed.jar
-			
-

TODO

-
    -
  • Add Regex support
  • -
  • check and rewrite poorly written functions
  • -
-
-

Test of Equations

- -
-

-
- - -- cgit v1.2.3