diff --git a/404.html b/404.html index f67d98a..0601173 100644 --- a/404.html +++ b/404.html @@ -14,9 +14,10 @@
+ Jump directly to main content

Error 404

- +
-
+

You broke the internet

This page probably doesn't exist, but if it's supposed to a developer will be looking into why it's borked.

diff --git a/README.md b/README.md index 45a1814..b062b99 100644 --- a/README.md +++ b/README.md @@ -24,6 +24,18 @@ semantic, accessable, and snappy. ## Release Notes +### v0.10.0 +- Tweaks to blog articles, and pages + +### v0.9.0 + +- Accessibility changes +- Change colours +- Increase font size/whitespace +- Add "skip to content" button +- Redesign burger navigation +[Patch notes](https://aney.co.uk/blog/release-0.9.0) + ### v0.8.0 - Add about page diff --git a/about.html b/about.html index a86208b..47f6f78 100644 --- a/about.html +++ b/about.html @@ -14,9 +14,10 @@
+ Jump directly to main content

About me

- +
-
+

Who are you

I'm Aney, a developer, and self-hoster that enjoys art/design, automation, Unix, and those pesky Japanese cartoons. Yes, that's a straight up rip from the homepage, why re-invent the wheel right?

@@ -37,7 +38,7 @@

I set this website up as a means to share information to educate, and help people, as well as to easily point people to my answers for common questions.

What do you do?

-

I'm currently employed as a web developer, and I enjoy it to an extent. I love solving problems, optimising sites, and creating designs/experiences, but building the guts, not so much.

+

I'm currently taking some time away from work, but looking for places I believe I'd be a good fit. I love solving problems, optimising sites, and creating designs/experiences, so I'm kind of a developer at heart.

Outside of work I practise minimalism, frugalism (to an extent), and work towards Financial Independance (FI/RE). I also love the idea of OneBagging, self-sufficiency, and travelling, so these are things I'm trying to work towards.

What else do you do?

diff --git a/blog/blog-thoughts-220822.html b/blog/blog-thoughts-220822.html index 88bbbf4..a37600b 100644 --- a/blog/blog-thoughts-220822.html +++ b/blog/blog-thoughts-220822.html @@ -15,9 +15,10 @@
+ Jump directly to main content

Blog Thoughts

- +
-
+

I've been having some thoughts about potential changes to the blog, including layouts, moving existing content, and such.

diff --git a/blog/burger-menu.html b/blog/burger-menu.html index 5459801..7dcfded 100644 --- a/blog/burger-menu.html +++ b/blog/burger-menu.html @@ -14,9 +14,10 @@
+ Jump directly to main content

Hello, Burger menu!

- +
-
+

On Friday 18th of November 2022, I released version 0.8.0 of this website. With that a large, and very noticable change occured. The addition of a burger menu.

diff --git a/blog/index.html b/blog/index.html index 9a8b762..c1c6bb4 100644 --- a/blog/index.html +++ b/blog/index.html @@ -15,9 +15,10 @@
+ Jump directly to main content

Aney's Blog

- +
-
+

You may be looking for my guides, or recipes.

+

2022

+ +

2022

  • Hello, Burger menu! - 21/11/2022
  • diff --git a/blog/ive-started-a-blog.html b/blog/ive-started-a-blog.html index 29c72bf..701ba2e 100644 --- a/blog/ive-started-a-blog.html +++ b/blog/ive-started-a-blog.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    I've started a blog

    - +
    -
    +

    To preface, I am not an author. In fact my skill with the pen was much more proficient when I was a youngling, but alas I have returned to write.

    Why?

    diff --git a/blog/my-steamdeck-arrived.html b/blog/my-steamdeck-arrived.html index 3886b20..95a001e 100644 --- a/blog/my-steamdeck-arrived.html +++ b/blog/my-steamdeck-arrived.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    My SteamDeck Arrived!

    - +
    -
    +

    The title does not decieve you, my SteamDeck has in fact arrived! Well actually it arrived on the 15th of August, and I've been using it since.

    diff --git a/blog/reducing-homelab.html b/blog/reducing-homelab.html index e984e56..7a86693 100644 --- a/blog/reducing-homelab.html +++ b/blog/reducing-homelab.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Reducing my Homelab

    - +
    -
    +

    Homelabbing, and with it self-hosting, has been a great exploration into server maintance, dabbling with new technologies, and has overall (sometimes it's been a hassle, but it comes with the territory) been an enjoyable little hobby.

    As the title implies, however, I have reduced the amount of services, and horsepower in my homelab, at least for the time being, starting from 24/09/2022.

    diff --git a/blog/release-0.9.0.html b/blog/release-0.9.0.html new file mode 100644 index 0000000..9914b33 --- /dev/null +++ b/blog/release-0.9.0.html @@ -0,0 +1,128 @@ + + + + + + + + + + + + Release 0.9.0 + + + +
    + Jump directly to main content +

    Release 0.9.0

    + + +
    + +
    +
    + +
    +

    Accessibility and Design

    +

    Release 0.9.0 was a non-functionality release, as I focussed my lil' brain on Accessibility, the User Experience (UX), and the design of the website. Also this is my first publicised "patch note" so go easy, ok.

    + +

    Accessiblity

    +
      +
    • Fix burger menu's accessiblity issues +
        +
      • Add label content, but make hidden for non screen-readers.
      • +
      • Make top of burger clickable. The burger wasn't fitting to its elements container, as a negative margin was used.
      • +
    • +
    • Add "Skip nav" functionality +
        +
      • Added a hidden button for keyboard tab-targetting that skips over the navigation, straight to the content.
      • +
    • +
    + +

    User Experience

    +
      +
    • Styled <code> tags +
        +
      • So they can be used in-line to aid with any development guides.
      • +
      +
    • +
    • + Make mobile nav/burger fixed +
        +
      • This allows the navigation to be opened/closed and visible from anywhere on the page, not just the top.
      • +
      +
    + +

    Design/User Interface

    +
      +
    • Font
        +
      • Increase the font-size.
      • +
      • Increase the whitespace used around the site.
      • +
    • +
    • Colours
        +
      • Altered colours to improve the visual hierarchy of the elements.
      • +
    • +
    • Remove hr above navigation
        +
      • Due to the nav now being atop the page, this wasn't needed to seperate the content.
      • +
    • +
    • Restyle mobile nav
        +
      • Instead of having the nav just pop-up atop the page, it now displays as a sidebar.
      • +
    • +
    • Add background and border to burger
        +
      • As it's not fixed it needed to be visually differentiated from content.
      • +
    • +
    • Scrollable table
        +
      • Super basic overflow-x on a parent of table so tables fit on screen, but all content can still be accessed.
      • +
    • +
    • Add &nbsp; to tags
        +
      • Multiple word tags were breaking, and looked pretty bad, so made them non-breakable.
      • +
    • +
    + +

    Dev

    +
      +
    • Colour simplification
        +
      • I changed the colours to all be 3 digit HEX values, saving a few bytes for the CSS.
      • +
    • +
    • Add test.html page
        +
      • For testing elements without navigating through the site, it's public too because why not.
      • +
      • Side note: This got me thinking about writing a lil' CSS framework.
      • +
    • +
    + +

    Known Issues

    +
      +
    • When the burger menu is active, the page is still scrollable
        +
      • Easily fixed with JS (and a basic overflow), however I want to stay away from JS as much as possible. I believe the approach I took is the best-case scenario, as users at least know if they're scrolling with the sidebar styled nav.
      • +
    • +
    • Burger nav animation
        +
      • Changes to clickable area of burger icon meant the animation needed tweaking, and it looks worse. It's not really important though.
      • +
    • +
    • h1 in nav
        +
      • I was contemplating moving this into the main, but have yet to do so. Not sure if this is technically an issue, but will need to look into it.
      • +
    • +
    • Scrollable table
        +
      • I'd like a better solution than this, preferably one that doesn't require an additional element.
      • +
    • +
    + +

    Final words

    +

    This release should offer better accesibility, and a nicer look and feel all around.

    +

    All changes were made as semantic as possible, and the site has been kept accessible, and usable for those not running CSS/JS at all (for instance terminal browsers, and neo-luddites with everything disabled).

    +
    + + + + + diff --git a/cv.html b/cv.html index bfa079c..17d8f9f 100644 --- a/cv.html +++ b/cv.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Aney's CV

    - +
    -
    +

    About Me

    I'm a helpful and well-mannered person that can work both alone, and as part of a team. I have a willingness to learn, and a proficiency with post-optimisation, and problem-solving. A goal of mine is to always help people to the best of my ability, and to improve myself wherever possible.

    @@ -41,7 +42,7 @@

    TJS

    April 2021 - January 2023

    Position: Developer

    -

    My time at TJS online is spent developing, and maintaining both the front, and back-end of the dozens of client websites, primarily using a Symfony based stack.

    +

    My time at TJS online was spent developing, and maintaining both the front, and back-end of the dozens of client websites, primarily using a Symfony based stack. This also entailed working with the databases, and ensuring service, and cronjob uptimes.

    Skills: PHP Symfony SCSS Git Linux NGINX SEO

    @@ -49,7 +50,7 @@

    Time: October 2018 - March 2021

    Position: System Developer and Technician

    I worked as part of the DevOps team at the car financing company, Advantage Finance. Whilst there I worked full-stack on the numerous bespoke systems; adding features, working on bug fixes, and rewriting legacy code for both desktop and web applications. I also assumed the position of IT support, aiding with general AD and PC issues, along with assisting in the training of new starters.

    -

    Skills: VB6 VB.net ASP Classic SVN SQL Active Directory

    +

    Skills: VB6 VB.net ASP Classic SVN SQL Active Directory

    Oxfam

    @@ -122,7 +123,8 @@

    Contact

    If you like what you see, feel free to contact me via one of the methods below:

    -

    the.nathan.steel@outlook.com

    +

    Email: the.nathan.steel@outlook.com

    +

    LinkedIn: Nathan Steel

    diff --git a/equipment.html b/equipment.html index e595968..d5e5ff8 100644 --- a/equipment.html +++ b/equipment.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Aney's Hardware

    - +
    -
    +

    My everyday tech

    This is what I use basically every day. It's either at my desk, in my bag, or within arms reach.

    diff --git a/guides/add-domain-to-server.html b/guides/add-domain-to-server.html index 04a9d45..cbf4963 100644 --- a/guides/add-domain-to-server.html +++ b/guides/add-domain-to-server.html @@ -4,7 +4,6 @@ - @@ -15,9 +14,10 @@
    + Jump directly to main content

    Link your domain name to your server

    - +
    -
    +
    -

    To avoid needing to remember an IP, this guide will help to link your domain name to your server.

    +

    To avoid needing to remember an IP, this guide will help to link your domain name to your server. It assumes you have already attained a domain name.

    +

    Login to your domain name registrar

    Login to the registrar, and select the domain name you want to point at your server.

    Find the section for DNS

    -

    The domain name should have a section named, "DNS", "Custom DNS records", or something similar to this. Find, and open it, there should be a bunch of boxes and an option to add a new record

    +

    The domain name should have a section named, "DNS", "Custom DNS records", or something similar to this. Find, and open it, there should be a bunch of boxes and an option to add a new record.

    Add the A record

    -

    There will likely be many option for adding records, but all we need is to add a singular A record

    -

    Find the box that allows you to "Add a new record" and input the below, changing and with your IP address, and domain name

    - -
    +

    Find the box that allows you to "Add a new record" and input the below, changing and with your IP address, and domain name.

    -

    If there are not multiple boxes, but instead a single box to input your record into, this will be what you add instead

    - -
    +
    <DOMAIN> A 86400 <IP>

    Wait for propagation

    Now there's a bit of a waiting game, as you need to wait for the new DNS record to propagate (get updated) for all nameservers. This can be anywhere from instantly to 72 hours, but typically takes an hour or two.

    Check your domain has propagated

    -

    Pinging the domain name will let you know when the IP has propagated, as when the ping command shows your IP, you're all set

    +

    Pinging the domain name will let you know when the IP has propagated, as when the ping command shows your IP, you're all set.

    + +
    ping -c 3 domainname.com
    diff --git a/guides/add-php-to-nginx.html b/guides/add-php-to-nginx.html index dfec5c4..f2fd409 100644 --- a/guides/add-php-to-nginx.html +++ b/guides/add-php-to-nginx.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Adding PHP to NGINX server

    - +
    -
    +

    PHP is one of the highest used programming languages for websites, and it allows you to add practically any functionality you'd ever want to your sites.

    Install

    -
    sudo apt install php-fpm php-mysql
    - -

    Um, I forgor

    -
    sudo nano /etc/php//fpm/php.ini
    -

    Comment the cgi.fix_pathinfo line, to look like below

    -
    #set cgi.fix_pathinfo = 0
    +
    sudo apt install php-fpm
    +

    If you want to work with mysql, then you also need to install php-mysql.

    Add to Website's NGINX conf

    -

    For each website you want to use php, you'll need to edit the confige file

    +

    For each website you want to use php, you'll need to edit the config file.

    sudo vim /etc/nginx/sites-available/
    -

    The following code needs adding within the XXX block

    +

    The following code needs adding within the server block.

    location ~ \.php$ {
     	include snippets/fastcgi-php.conf;
    -	fastcgi_pass unix:/run/php/php-fpm.sock;
    +	fastcgi_pass unix:/run/php/php<VERSION>-fpm.sock;
     }
    -

    This will use nginx's fastcgi-php.conf snippet which is more secure by deafult than many other php/nginx configs because it 404s if the files doesn't exist. Read Neal Poole'sDon't trust the tutorials for more info.

    +

    This will use nginx's fastcgi-php.conf snippet which is more secure by default than many other php/nginx configs because it 404s if the requested file doesn't exist. Read Neal Poole's Don't trust the tutorials for more info.

    Reload NGINX

    sudo systemctl reload nginx

    Test it works

    -

    Create a PHP file e.g. filename.php in the website's directory, and add the snippet below into it

    -
    +

    Create a PHP file e.g. filename.php in the website's directory, and add the snippet below into it.

    +
    <?php phpinfo(); ?>

    Go to that webpage in your browser e.g. domain.co.uk/filename.php, and if php is working you should see a dump of your PHP's version, headers, etc.

    Make nginx use index.php as homepage/root

    -

    Now we'll set nginx to load up index.php as the root of the website, if it exists. Open the site's config with an editor

    +

    Now we'll set nginx to load up index.php as the root of the website, if it exists. Open the site's config with an editor.

    vim /etc/nginx/sites-available/
    -

    Change the index line to read as below. This will then tell the server to load index.php, and if it doesn't exists, load index.html in it's stead

    +

    Change the index line to read as below. This will then tell the server to load index.php, and if it doesn't exists, load index.html in its stead.

    index index.php index.html
    diff --git a/guides/adminer-setup.html b/guides/adminer-setup.html index b80c5e8..a749f4e 100644 --- a/guides/adminer-setup.html +++ b/guides/adminer-setup.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Adminer Setup

    - +
    -
    +

    Adminer is a simple front-end for your database server that can be access through the browser

    Pre-Requirements

    @@ -49,10 +50,10 @@ chmod 755 /var/www/html/adminer.php

    Access it

    -

    Head to your /adminer.php, and you should load into the adminer login. Using your mysql/mariaDB credentials, you can then login, and use the GUI to manage your database(s)

    +

    Head to your <WEBSITE/IP>/adminer.php, and you should load into the adminer login. Using your mysql/mariaDB credentials, you can then login, and use the GUI to manage your database(s)

    Make it a directory, not a file

    -

    Instead of accessing /adminer.php?, we can make it look like /adminer/

    +

    Instead of accessing /adminer.php?<ARGUMENTS>, we can make it look like /adminer/<ARGUMENTS>

    location /adminer/ {
     	root /var/www/html ;
     	try_files $uri $uri/ /adminer/index.php/$is_args$args ;
    @@ -61,16 +62,16 @@ chmod 755 /var/www/html/adminer.php

    Password Protect

    An additional level of security, just in case. Using Htaccess, any file, or directory can be password protected

    sudo apt install apache2-utils
    -htpasswd -c /home//.htpasswd admin
    +htpasswd -c /home/<USER>/.htpasswd admin

    Add to location

    Add the location of the auth file to the adminer location block

    auth_basic "Adminer" ;
    -auth_basic_user_file /home//.htpasswd ;
    +auth_basic_user_file /home/<USER/>.htpasswd ;

    They block should look like below

    location /adminer/ {
     	auth_basic "Adminer" ;
    -	auth_basic_user_file /home//.htpasswd ;
    +	auth_basic_user_file /home/<USER>/.htpasswd ;
     	root /var/www/html ;
     	try_files $uri $uri/ /adminer/index.php/$is_args$args ;
     }
    diff --git a/guides/backup-mysql-mariadb.html b/guides/backup-mysql-mariadb.html index 7515ff8..81dd61f 100644 --- a/guides/backup-mysql-mariadb.html +++ b/guides/backup-mysql-mariadb.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Backup MySQL/MariaDB

    - +
    -
    +

    A database if a huge part of many projects, services, and servers. If something goes wrong, data is wrongly updated/deleted there could be many problems. Thankfully we can make backups to make sure our data is safe.

    Manual Backup of a DB

    diff --git a/guides/backup-with-cron.html b/guides/backup-with-cron.html index fd368f9..4ae952c 100644 --- a/guides/backup-with-cron.html +++ b/guides/backup-with-cron.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Automating Backups with Cronjobs

    - +
    -
    +

    Backups are wonderful things that save hours upon hours of work, and stress, so long as they're actually made in the first place!

    Automatically taking backups allows for peace of mind that your work won't be lost forever whilst you go about your normal workflow..

    diff --git a/guides/backup-with-rdiff.html b/guides/backup-with-rdiff.html index fe27a96..faf2dff 100644 --- a/guides/backup-with-rdiff.html +++ b/guides/backup-with-rdiff.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Backup with rdiff-backup

    - +
    -
    +

    Like rsync, rdiff-backup is a tool used for incremental backups. Unlike rsync however, rdiff keeps the most-recent file change, along with any previous changes, deletions, etc.

    Install

    diff --git a/guides/backup-with-rsync.html b/guides/backup-with-rsync.html index 6d359e2..0a7d210 100644 --- a/guides/backup-with-rsync.html +++ b/guides/backup-with-rsync.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Backup with rsync

    - +
    -
    +

    Rsync is a program that allows for incremental backups. This means that rsync will not create an additional copy of the data when backing up, it will only backup changes to the files/directories, saving bandwidth and storage space.

    @@ -58,8 +59,7 @@
    rsync -auv $USER@$HOST:$BACKUP $RESTORE

    Notes/Advanced

    -
    
    --r recursive. All files/directories in the path will be backed up
    +
    -r recursive. All files/directories in the path will be backed up
     -a archive mode. Recursive, but with file permissions, symlinks, etc retained.
     -z compress
     -b backups
    diff --git a/guides/certbot-ssl.html b/guides/certbot-ssl.html
    index db1da6b..45a4a39 100644
    --- a/guides/certbot-ssl.html
    +++ b/guides/certbot-ssl.html
    @@ -15,9 +15,10 @@
     
     	
     		
    + Jump directly to main content

    Setup SSL with Certbot

    - +
    -
    +

    An SSL certificate is used to secure a domain, preventing people from seeing many things, including those entered into forms (username, password, etc.).

    Install Certbot

    diff --git a/guides/get-a-domain-name.html b/guides/get-a-domain-name.html index 243ac88..830c62b 100644 --- a/guides/get-a-domain-name.html +++ b/guides/get-a-domain-name.html @@ -4,7 +4,6 @@ - @@ -15,9 +14,10 @@
    + Jump directly to main content

    Get a domain name

    - +
    -
    +
    -

    A domain name, as many will know is what people typing into their browser, e.g. google.com, facebook.com, etc.

    -

    The primary use for these is to have a memorable thing for users, instead of needing to type the IP address of the server

    +

    A domain name, as many will know is what you type into a browser to access a website. Without a domain name, everyone accessing your server/website would need to be entering the IP address.

    Choose a registrar

    -

    First thing is to choose a registrar (who you are leasing the domain from). You can search for "domain name registrars" and find who is cheapest. So long as they handle DNS (which all I've used do) you're good.

    +

    First thing is to choose a registrar (who you are leasing the domain from). You can search for "domain name registrars" and find who is cheapest. So long as they handle DNS (which most do) you're good.

    I'm currently using tsohost.com, as they're pretty cheap, and besides a few little issues, it works for me.

    Choose a domain name

    -

    On the registrar's website there will be a section to purchase a domain. Upon clicking this you'll likely be greeted with a searchbar, search for whatever domain you'd like here, and they'll let you know if it's available, and what similar domains there are

    +

    On the registrar's website there will be a section to purchase a domain. Upon clicking this you'll likely be greeted with a searchbar, search for whatever domain you'd like here, and they'll let you know if it's available, and what similar domains there are.

    Select the domain(s) you wish, and add it/them to your cart.

    Purchase your domain name

    -

    Simply checkout, and make your way through the process

    +

    Simply checkout, and make your way through the process. Tada, you now have a domain name!

    +

    Next up you'll need to link your server and domain name with DNS.

    diff --git a/guides/guide-to-server-hosting.html b/guides/guide-to-server-hosting.html index ba83b0e..447293a 100644 --- a/guides/guide-to-server-hosting.html +++ b/guides/guide-to-server-hosting.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Aney' guide to server hosting

    - +
    -
    +

    If you want to start getting into server hosting, system administration, or just want to get a basic minecraft/web server up for you and your friends, then welcome. We all start somewhere, and I would love if I could get your foot in the door.

    -

    Notice

    -

    This is heavily a WIP, so I'll be adding to this guide whenever I get time, and will update it's readibility, and correct/add anything missing once it's 'complete'. If I didn't put it up in an unfinished state, it would never go live, so bear with.

    Basic Server setup

    Now you officially own, and have setup a server. Currently all you can do is SSH into it though, so let's get some services on there

    +

    Virtualisation

    +

    Virtual machines allow you to use your server as multiple servers at once, with different operating systems, services, files, etc. If you're self-hosting this is a great way to separate concerns, having one system for each distinct task.

    + +

    Nginx Webserver

    A great first service for any server is a website, even if it's just a little page to let people know you own the server/domain name

    MariaDB Database

    @@ -62,63 +71,33 @@

    Backup your server!

    Backups are super useful. If something breaks, or gets accidentally deleted you can always use a backup to get it back

    - - - -

    Run virtual machines

    -

    Virtual machines allow you to use your server as multiple servers at once, with different operating systems, services, files, etc. If you're self-hosting this is a great way to separate concerns, having one system for each distinct task.

    -

    Additional services/potential guides

    Unless there is an anchor, these are all "TODO", and may just be omitted from this list

    Useful tidbits

    Additional Services

    • git
    • -
    • samba
    • -
    • Open Media Vault
    • -
    • umami
    • -
    • uptime kuma
    • +
    • Uptime Kuma
    • torrentbox
    • -
    • jellyfin
    • +
    • Jellyfin
    • VPN
    • -
    • mailserver
    • -
    • Host client websites
    • -
    - -

    Game Servers

    -
      -
    • minecraft
    • -
    • terraria
    • -
    • factorio
    • -
    - -

    Additional guides

    -

    These are some guides for specific use-cases, that will aid with setting up -

      -
    • Basic Homeserver for a web developer/designer
    diff --git a/guides/index.html b/guides/index.html index 5276c81..ec2480f 100644 --- a/guides/index.html +++ b/guides/index.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Aney's Guides

    - +
    -
    +

    Pinned

    diff --git a/guides/initial-server-setup.html b/guides/initial-server-setup.html index d7baebd..e60f8f1 100644 --- a/guides/initial-server-setup.html +++ b/guides/initial-server-setup.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Initial Server Setup

    - +
    -
    +
    -

    This section assumes you have a fresh Debian 11 install on a server (either physical or VPS)

    -

    It will cover installing the essentials for access, and basic security so you don't need to worry in the future. This section may seem a little daunting for a first-time linux user, but most of it is copy/paste, hopefully with enough description to understand what is being done. Just remember not to copy the $/root$ they're there to show what user/directory we're in.

    +

    This section assumes you have a fresh Debian install on a server (either physical or VPS)

    +

    It will cover installing the essentials for access, and basic security so you don't need to worry in the future. This section may seem a little daunting for a first-time linux user, but most of it is copy/paste, hopefully with enough description to understand what is being done.

    This first section will be done on the physical PC, or on the VPS via their website, or SSH'd as root if that's the option given.

    +

    Login

    +

    Perhaps silly, but login as your user with root priveleges or the root user if a user isn't currently setup.

    +

    For the first few steps it's written as if you're logged in as root, if you followed my install guide, this won't have a password, so we'll change user with the following command

    +
    sudo su -
    +

    Now just follow along with the remainder of the guide. If you wish not to change users you could also just add sudo in-front of the commands to run them as root that way.

    +

    Update the OS

    Even with a fresh install of Debian from the latest ISO, there may be some updates you're missing, and it's a good idea to have these, especially in case they're security updates.

    @@ -47,13 +54,14 @@

    Install essential packages

    These are packages that are needed for accessing, and controlling the server

    -
    apt install sudo ssh
    +
    apt install sudo ssh -y

    Some useful packages too

    -
    apt install vim htop wget curl tmux
    +
    apt install vim htop wget curl tmux -y

    Add a user, and give super user privilleges

    -

    You want to avoid using root as much as possible in regular use, so a new user for yourself is a must

    +

    This can be ignored if my guide was followed, or you already have a user setup. Some VPS just have root however, so I believe this should be included.

    +

    The reason for a new account instead of using root, basically comes down to security. If you want multiple people on the server too, it's best to have a unique account for each.

    adduser $USERNAME$	
     usermod -aG sudo $USERNAME$
    @@ -61,20 +69,19 @@ usermod -aG sudo $USERNAME$

    *replace $USERNAME$ with the user you want to create, e.g. nathan

    (Local server) Set static IP

    -

    If the server is a physical PC in your home you will need to set a static IP, otherwise your router could assign a differnent IP on reboot, and this would mess with port forwarding, and internal DNS.

    -

    Set static IP for local server

    -

    Port forwarding for local server

    -

    If you've set the static IP for your local server, you'll also have an additional step when making public (internet served) services, as unlike a VPS your ISP will likely have all outbound ports disabled by default

    -

    Port forward your local server

    +

    If the server is a physical PC in your home you will need to set a static IP, otherwise your router could assign a different IP on reboot, and this would mess with port forwarding, and internal DNS.

    +

    If you're using a VPS, this step can be ignored.

    +

    Set static IP for local server

    Secure ssh

    -

    Although this is optional, I recommend it, as SSH (secure shell) will be the primary means of access to the server.

    +

    Although this is optional, I recommend it, as SSH (secure shell) will likely be the primary means of access to the server. You don't want to be next to it whenever you've got a change to make.

    +

    Open the following file with your editor of choice, I use vim.

    vim /etc/ssh/sshd_config

    Within the editor you will need to search for PermitRootLogin and set it to no, this prevents ssh as root

    -

    Search for Port and set it to a different port to 22, a port over 1024 prevents basic nmap scans, and therefor a lot of bruteforcing, so let's go with 2020 so it's easy to remember

    -

    Below the Port line, add a new line with Protocol 2 this enables ssh2, which is more secure

    +

    Search for Port and set it to a different port than 22, a port over 1024 prevents basic nmap scans, and therefor a lot of bruteforcing, so let's go with 2020 as it's easy to remember

    +

    Below the Port line, add a new line and write Protocol 2 this enables ssh2, which is more secure than the standard ssh protocol.

    (Optional) Comment/Add a # to the beginning of the passwordlogin line. This will prevent sshing to the server from any PC that doesn't have it's SSH key on the server already. I recommend only doing this if your sshkeys are on the server, or you're comfortable adding them.

    systemctl reload sshd
    @@ -83,52 +90,73 @@ usermod -aG sudo $USERNAME$

    Setup UFW

    UFW (Uncomplicated Firewall) is a simple to use firewall, that can be used to easily open/close ports on your server.

    -

    We'll install ufw, deny access inwards to all ports, but allow our server to access any ports outwards. We will then manually allow inwards traffic to the SSH port we set, in this case 2020

    +

    We'll install ufw, deny access inwards to all ports, but allow our server to access any ports outwards. We will then manually allow traffic to the SSH port we set, in this case 2020.

    apt install ufw
    ufw default deny incoming &&
     ufw default allow outgoing &&
    -ufw default allow 2020 &&
    +ufw allow 2020 &&
     ufw enable

    If there are any other ports that need to be opened in the future this can be done with:

    ufw allow $PORT
    -

    or

    -
    sudo ufw allow $PORT
    -

    Then enable it, making sure you've allowed ssh first

    -
    sudo ufw enable

    Set hostname

    -

    Setting the name for a server is an important step, but the name doesn't need to be serious

    +

    Setting the name for a server is not an important step, but it's nice to have each server easily identifable.

    +

    Simply change the hostname within the two files below. Ensure they share the same name between files.

    vim /etc/hosts

    and

    vim /etc/hostname
    -

    Within both of these files the hostname should be changed to the same thing

    -
    -

    This next section can be done via a terminal, or an SSH client e.g. PuTTY for Windowss. For the sake of the guide, this assume you're using a Unix terminal

    -

    Create an SSH key

    -

    We'll create an ed25519 ssh-key, as it's more secure, and performant than the defaultrsa

    -
    ssh-keygen -t ed25519
    +
    +

    This next section is to be done via a terminal, or an SSH client e.g. PuTTY for Windows. This part of the guide is written for a Unix terminal.

    SSH into the server

    -

    This is a two part section, and I recommend using this every time you SSH into a server from a new PC

    +

    This is a two part section, and I recommend using this every time you SSH into a server from a new PC.

    ssh $USER$@$HOST$ -p 2020
    -

    This will likely display a message asking to verify the key for the server. This is to prevent man-in-the-middle attacks, so I reccommend verifying this whenever asked.

    -

    To check the key for the server, you need to run this command on the server.

    +

    This will likely display a message asking to verify the key for the server. This is to prevent man-in-the-middle attacks, so I recommend verifying this whenever asked.

    + +

    Verify SSH

    +

    To verify, you'll need to run the following command on the server.

    -
    ssh-keygen -l -f /etc/ssh/ssh_host_$KEY$_key.pub
    +
    ssh-keygen -l -f /etc/ssh/ssh_host_ed25519_key.pub
    + +

    Then if the key the server shows matches that on your PC's SSH prompt, type yes and hit enter from your PC.

    + +

    SSH without a password

    +

    To be more secure, and to SSH faster we can setup an SSH key, and use that for user authentication.

    +

    Create an SSH key

    +

    We'll create an ed25519 ssh-key, as it's more secure, and performant than the default rsa.

    +
    ssh-keygen -t ed25519
    -

    Replace $KEY$ with the key the message is asking about (e.g. ecdsa, rsa, ed25519). Then if key the server shows matches that on your PC you are SSHing from, type yes and hit enter

    +

    Copy the SSH key onto the server

    +

    From the terminal there's a nifty command to copy ssh keys to a server.

    +
    ssh-copy-id -p 2020 -i ~/.ssh/id_ed25519 USER@HOST
    -

    TODO:(Optional) Fail2Ban

    +

    Alternatively you can add the key to the server manually. This is recommended, especially when adding other users.

    +

    First on your PC you need to run the following, and take note of the output.

    +
    cat ~/.ssh/id_ed25519.pub
    +

    Then on the server, open the following file, and add the output to a new line.

    +
    vim /home/USER/.ssh/authorized_keys
    + +

    SSH again

    +

    Now simply run the same ssh command as before, and you shouldn't get a password prompt.

    +
    ssh $USER$@$HOST$ -p 2020
    + +

    (Optional) Fail2Ban

    +

    Fail2ban is used to periodically check server logs, and bans IPs that appear to be trying to brute-force into your server. It's only "required" for servers exposed to the internet.

    +
    apt install fail2ban -y
    +
    systemctl enable fail2ban
    +

    There's a lot of options for fail2ban, this just installs it. For a little more detail checkout Crownclouds fail2ban guide.

    TODO:(Optional) Unattended Upgrades

    -

    Updates to a server typically want to be done by a human in case things go wrong, but smaller updates can be set to be done automatically

    +

    Updates to a server typically want to be done by a human in case things go wrong, but smaller updates can be set to be done automatically.

    +
    apt install unattended-upgrades
    +

    The above downlads, and starts unattended-upgrades with some good defaults, but if you want a some more details check cyberciti'sunattended upgrades guide.

    (Optional) Setup User preferences

    These are a few things I personally like to have on a basic server. If you have your own preferences, dotfiles, or intend to use oh-my-zsh fell free to skip over this.

    @@ -141,27 +169,12 @@ ufw enable
    set -o vi

    Aliases

    -

    Instead of typing out long commands you can alias them, and type a shorthand version.I've written an article about aliases that explains setting up, and aliases I use. Below are some essentials for those that don't want to jump to another article.

    +

    Instead of typing out long commands you can alias them, and type a shorthand version. I've written an article about aliases that explains setting up, and aliases I use. Below are some essentials for those that don't want to jump to another article.

    alias ll="ls -lhtr"
     alias df="df -h"
     alias ta="tmux attach || tmux new"
     alias ipe="curl ifconfig.co"
    -

    Ctrl-L clear-screen

    -

    Sometimes a new system doesn't have this by default, and it's probably the thing I use most after ls.

    -

    Add, or create an .inputrc file

    -
    vim ~/.inputrc
    -

    Add the following line to the file

    -
    "C-l": clear-screen
    - -

    BashRC PS1

    -

    This will make your terminal look a little nicer, and display a directory path, user, and hostname. A ridiculously useful feature if you're managing multiple servers, or virtual machines

    -

    This is also in the .bashrc file, so open that up

    -
    vim ~/.bashrc
    -

    Then add the following to the bottom of the file

    -
    export PS1="\[\e[01;33m\]\u\[\e[0m\]\[\e[00;37m\]@\[\e[0m\]\[\e[01;36m\]\h\[\e[0m\]\[\e[00;37m\] \t \[\e[0m\]\[\e[01;35m\]\w\[\e[0m\]\[\e[01;37m\] \[\e[0m\]\n$ "
    -

    If you want to customise your terminal, you can do so with .bashrc PS1 generator. -

    Reads shouldn't write!

    Another personal opinion, and change is to enable noatime, and nodiratime. Be careful with this change! And ignore if you followed my Debian install guide, as they're already enabled.

    Basically without these, when a file is opened (read) on your filesystem, a write is invoked to update the time it was opened, which causes unwanted writes, and CPU cycles.

    diff --git a/guides/install-kvm-virtual-machine.html b/guides/install-kvm-virtual-machine.html index 9e9f252..2659cd4 100644 --- a/guides/install-kvm-virtual-machine.html +++ b/guides/install-kvm-virtual-machine.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Template for Blog

    - +
    -
    +

    This is an intro, you gotta believe me

    Heading

    @@ -39,6 +40,20 @@

    Install with virt (CLI)

    Install with virt-manager (GUI)

    + +By default virsh lists vms belonging to user +virsh --connect qemu:///system list --all +The above run as root shows all vms + + +For virtmanager, etc to controll vms from an remote host +It needs ssh-key shared + +If a different port, then use virt-manager -c 'qemu+ssh://myuser@192.168.1.139:2222/system?keyfile=id_rsa' + +e.g. +virt-manager -c 'qemu+ssh://nathan@aney.co.uk:2020/system?keyfile=id_rsa' +
    diff --git a/guides/install-mysql-mariadb.html b/guides/install-mysql-mariadb.html index 2caedd5..67cdae9 100644 --- a/guides/install-mysql-mariadb.html +++ b/guides/install-mysql-mariadb.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    MySQL (actually MariaDB) Setup Guide

    - +
    -
    +

    MySQL is a well known free, open-source relational database service, and it's great. MariaDB is just MySQL (a fork of it), but better.

    @@ -39,15 +40,20 @@

    Secure Install/Setup

    sudo mysql_secure_installation
    +

    Run the above command, and follow the instructions, if you don't want to then follow mine.

    +

    Press enter for the current password, and again when asked if you want to set a root password. Enter the password, then press enter for everything else.

    Create Admin user

    sudo mysql
    -
    GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;
    +
    GRANT ALL ON *.* TO 'admin'@'localhost' IDENTIFIED BY '<DESIRED_PASSWORD>' WITH GRANT OPTION;
    FLUSH PRIVILEGES;
    exit;

    Test it works

    +

    Simply try logging in as the admin account.

    +
    mysql -u admin -p
    +

    It should ask for a password, so enter your DESIRED_PASSWORD, and if you get mysql access, it's successful.

    (Optional) Make it easier to access on command line

    If you're working with a terminal, when calling mysql you'll need to enter a password each time. You can store the passwordwith a special .cnf file, making it faster to get into writing SQL.

    @@ -55,9 +61,9 @@
    vim ~/.my.cnf

    Add the following, with your credentials

    [mysql]
    -user=
    -password=
    -

    The above can be used for mysqldump, mysqladmin, and others too, by replacing the [mysql] block

    +user=<USERNAME> +password=<PASSWORD> +

    The above can be used for mysqldump, mysqladmin, and others too, by replacing the [mysql] block, with the related. e.g. [mysqldump].

    diff --git a/guides/kvm-optimisation.html b/guides/kvm-optimisation.html new file mode 100644 index 0000000..4ffdb84 --- /dev/null +++ b/guides/kvm-optimisation.html @@ -0,0 +1,73 @@ + + + + + + + + + + + + KVM Optimisation + + + +
    + Jump directly to main content +

    KVM Optimisation

    + + +
    + +
    +
    + +
    +
    +

    KVM Optimisations

    + +transmit queue +virsh domiflist +# this is then the txqueuelen change below ??? +# changing to 4096 +ifconfig txqueuelen + +txqueuelen (iwbcman comment) +defaults to 1000, apparently 200 is good + +ip link set eth0 txqueuelen 200 +vim /etc/network/interfaces +add +post-up /sbin/ip link set eth0 txqueuelen 200 +to the end + +If virtual hdd is slow can try +Cache mode: none (not default!) +I/O mode: native +https://unix.stackexchange.com/a/48584 + +non caching on dirves? +https://blog.jdpfu.com/2012/07/30/improving-kvm-performance +://documentation.suse.com/smart/linux/html/concept-virtual-disk-cache-modes/concept-virtual-disk-cache-modes.html#:~:text=A%20disk%20cache%20is%20a,example%2C%20by%20setting%20its%20type. +On VM turning cache off essentially acts like accessing the drive itself. No exactly a passthrough, but decent enough + +http://www.linux-kvm.org/page/Tuning_KVM + +
    +
    + + + + + diff --git a/guides/nginx-install.html b/guides/nginx-install.html index d55ee13..71901e4 100644 --- a/guides/nginx-install.html +++ b/guides/nginx-install.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    How to install an NGINX web server

    - +
    -
    +

    NGINX (engine X) is one of the top webservers. It has relatively easy learning curve, is fast, and secure. It's a great step into web hosting, and a good first service for many servers.

    Install

    diff --git a/guides/nginx-proxy.html b/guides/nginx-proxy.html index 6eeeea8..e135d09 100644 --- a/guides/nginx-proxy.html +++ b/guides/nginx-proxy.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Template for Blog

    - +
    -
    +

    This is an intro, you gotta believe me

    Install

    diff --git a/guides/nginx-web-optimisation.html b/guides/nginx-web-optimisation.html index 2f7bd60..973687b 100644 --- a/guides/nginx-web-optimisation.html +++ b/guides/nginx-web-optimisation.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    NGINX web optimisation

    - +
    -
    +

    Optimisations for the nginx configs will increase both the security, and performance of your website

    TODO: Headers

    diff --git a/guides/password-protect-webpage.html b/guides/password-protect-webpage.html index af2214b..788e8d4 100644 --- a/guides/password-protect-webpage.html +++ b/guides/password-protect-webpage.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Template for Blog

    - +
    -
    +

    This is an intro, you gotta believe me

    Heading

    diff --git a/guides/server-install-debian.html b/guides/server-install-debian.html index 984c20c..da7f9c8 100644 --- a/guides/server-install-debian.html +++ b/guides/server-install-debian.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Debian Install Guide for Servers

    - +
    -
    +

    Debian is a fantastic linux distrubution that works, and rarely causes issues. Due to this, it is a common canditate for a server OS, and is what this guide will walkthrough how to install on a PC.

    Assumptions

    @@ -42,8 +43,8 @@

    Download and Burn the ISO

    First thing is to get the install media setup. If you know how to burn an ISO, go ahead and get that done, I'll wait for you in the next section. If not follow below.

    -

    Download the latest debian ISO from the debian website, at the time of writing it's this release, but get it from their page.

    -

    Download Balena Etcher for your device (Windows, MacOS, Linux), and install it

    +

    Download the latest debian ISO from the debian distrubution page, at the time of writing it's this release (assuming you're installing on a 64bit PC), but get it from their page.

    +

    Download Balena Etcher for your device (Windows, MacOS, Linux), and install it

    Then open Etcher (with an empty USB plugged in), select the USB, and the downloaded ISO image, then hit run.

    When finished remove the USB and plug it into the PC you want to install Debian to

    @@ -55,53 +56,73 @@

    Like above, press the key to get into either a one-time boot menu, or the bios. From there select your USB as a boot override. This will boot from the USB just this time, and then revert to the normal boot order.

    Start install

    -

    When you're greeted by a debian boot page, select "Install" (that's what I'll be using) but "Graphical Install" is also fine, as it's essentially the samething, but you can use a mouse.

    +

    When you're greeted by a debian boot page, select "Install" (that's what I'll be using) but "Graphical Install" is also fine, as it's essentially the same thing, but you can use a mouse.

    Localisation

    As if you are filling out an online form, simply ensure the boxes are correct to your language, location (sets time, and download servers), and keyboard layout.

    -

    Network, and server name

    -

    If you're using DHCP, this can be...

    - TODO

    Hostname

    -

    What you wish to call your server, I like to give names that are quirky, but still kinda explain what they do. For example, my webserver is "spiderverse", and my NAS is "lilnas", etc.

    +

    What you wish to call your server, I like to give names that are quirky, but still kinda explain what they do. For example, some names I've used are "spiderverse" for a web server, and "lilnas" for a NAS, etc.

    Domain name

    -

    Leave this as default, and hit continue.

    +

    Leave this as default "home", and hit continue.

    -

    Create User

    +

    Set up users and password

    +

    The first thing you'll see is a screen asking for a root password.

    Don't set a root password

    -

    This will ask for a root password. Do not enter a password, and simply git the Enter key, then again when it asks for the password the second time. A root user with a password is a vulnerability, so we're avoiding this.

    +

    Simply hit the Enter key, then again when it asks for the password the second time. A root user with a password is a vulnerability, so we're avoiding this.

    Create your user (admin account)

    -

    Now enter your username, and password as the installer requests. This account will be added to the sudo group, making it an admin with access to root, and root commands.

    +

    Now enter your username, and password as the installer requests.

    +

    This account will be added to the sudo group, making it an admin with that can act as the root user.

    Disk Partitioning

    For this I am assume you're using a new drive, or at least one that you don't want any of the data on it

    -

    Auto-partitioning

    -

    You can do this, and it's recommended if you're new to linux. Once you've got the hang of it, you can always re-install your server from scratch (I recommend this a couple of times).

    -

    Also select to have all files in one partition, as it's the simplest option.

    -

    Finish Partitioning, and done.

    +

    Guided/Auto-partitioning

    +

    You can do this, and it's recommended if you're new to linux. Once you've got the hang of it, you can always re-install your server from scratch (I recommend this a couple of times if it's non-integral).

    +

    Select Guided - use entire disk then select the drive you want to boot from.

    +

    Then select All files in one partition (recommended for new users), as it's the simplest option.

    -

    Manual Partitioning

    -

    For a little more control over the partitioning, this is the option. If you are a beginner I'd just go with auto for now, but follow this if you desire.

    - TODO +

    Manual Partitioning

    +

    I've opted to leave this out, as it's a beginner guide. If you're reading this though I typically don't create a swap partition, but the guided installer does. It's no problem, but following this guide makes it redundant.

    -

    Preferences

    -

    Skip Swap (for now)

    +

    (Optional) Preferences

    +

    With your disk partitioned select the partion that has a / at the far right, and hit Enter.

    +

    Go to Mount Options, and select (using Space) noatime, and nodiratime. Then hit Enter, and select Done setting up the partition.

    -

    Scan Additional Media

    -

    Unless you've addition drivers, etc. (You probably don't) hit No

    +

    Finalising Partitioning

    +

    Simply hit Enter on Finish partitioning and write changes to disk at the bottom of the page.

    +

    Another screen will appear to verify you wish to partition, hit Yes, and it'll begin partitioning. Give it a little time.

    -

    Configure Mirror

    +

    Configure the package manager

    +

    A simple one, select your country, hit enter to the top selection, hit enter again when it asks for a proxy (unless you know what you're doing), and sorted.

    Popularity Contest

    +

    I typically select No here, but read what it is and select for yourself.

    Software Selection

    - -

    Install Grub Boot Loader

    +

    Now tasksel will load up, and ask if you want any software installed during setup.

    +

    I choose to deselect everything pre-selected (the ones with asterisks), however for a new setup keeping standard system utilities is a-ok.

    +

    If you're after a GUI experience you can select Xfce as it's pretty lightweight, however I'd recommend going with no GUI for a server.

    +

    Once you've selected what to install, hit Enter.

    Reboot, and enjoy!

    +

    Reboot your server, and tada!

    Setup Swap

    +

    I mentioned earlier I don't setup a swap partition, and that it'd be redundant if you follow this guide, so here we go.

    +

    Swap sizes vary per PC as different services use more RAM, etc. A decent(ish) rule of thumb is to set half your RAM size as the swap size, but to be honest 8GB will likely suffice.

    +

    Create the swap file

    +
    sudo fallocate -l 8G /swapfile
    +

    Set permissions

    +
    sudo chmod 600 /swapfile
    +

    Set the file as a swap area

    +
    sudo mkswap /swapfile && sudo swapon /swapfile
    +

    Set on boot

    +

    Open /etc/fstab with a text editor. I'll use vi for this.

    +
    sudo vi /etc/fstab
    +

    Press gg, followed by Shift+o, then type the following.

    +
    /swapfile swap swap defaults 0 0
    +

    Then press esc, followed by shift+ZZ.

    +

    Next steps

    Now that you've got a basic Debian install, you'll need to configure, and install a few things. I've written a little something, somthing like that, so check how to setup a new server install

    diff --git a/guides/set-static-ip.html b/guides/set-static-ip.html index 865be9b..8287ab3 100644 --- a/guides/set-static-ip.html +++ b/guides/set-static-ip.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    How to set a static IP

    - +
    -
    +

    For those that don't know a static IP is an IP address that doesn't change on reboots, etc. The opposite of a dynamic IP, which can change on reboots, and is the default mode for computers to get an IP (via DHCP).

    diff --git a/guides/setup-git-server.html b/guides/setup-git-server.html index 50fb7a2..b0c0bf6 100644 --- a/guides/setup-git-server.html +++ b/guides/setup-git-server.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Git server setup

    - +
    -
    +

    Self-hosted version control is great way to not be dependant of a third party to keep your git server up, or your code secure.

    @@ -56,7 +57,7 @@

    Use the git server

    With all the setup out the way, the git server is now usable as a remote for any of your git repos.

    -

    So on another PC...

    +

    So on another PC, you can use git as normal. For example.

    Add remote to existing repo

    git remote add origin git@<your-server>:/<repo.git>

    Clone the repo

    @@ -68,7 +69,7 @@

    Giving you something like this

    git clone git@<your-server>:<port>/<repo.git>
    -
    +

    Completed

    From here you can use git as you would via any other provider, but with the knowledge that your remote is yours.

    diff --git a/guides/setup-kvm-bridge.html b/guides/setup-kvm-bridge.html index ef128f2..0a2d91d 100644 --- a/guides/setup-kvm-bridge.html +++ b/guides/setup-kvm-bridge.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Setup a bridge network for KVM

    - +
    -
    +
    -

    A bridge network is a means to connect/bridge different networks together to act like a single network. In this case, it allows any connections to the bridge network to get their own internal IPs, as if plugged into the network directly, and work as you'd expect a completely new physical PC to work. i.e. Accessble to other clients outside of the host.

    +

    A bridge network is a means to connect/bridge different networks together to act as a single network. In this case, it allows any virtual connections to the bridge network to get their own internal IPs, as if plugged into the network directly.

    +

    Install bridge-utils

    sudo apt install bridge-utils
    -

    Find the network to bridge

    -

    First we need to find the network we want to bridge to the VMs

    -
    ip a
    +

    Find the network device to bridge

    +

    First we need to find the network device we want to bridge to the VMs.

    +
    ip link
    +

    You'll likely have a device called something similar to enp1s0, or eth0.

    -

    Bridge it

    +

    Create the bridge network

    This will be familiar to those who have set a static ip on linux, as it's essentially the same, with a few additional lines related to bridging

    -

    This can be done by editing /etc/network/interfaces

    +

    Remove interface from interfaces file

    +

    First step is to remove any references to your network device from /etc/network/interfaces, if this file is untouched there will likely be two lines at the bottom.

    sudo vim /etc/network/interfaces
    -

    And setting the following lines

    - -

    Change existing port to manual

    -

    There will already exist some lines with your chosen network adapter, such as

    -
    iface enp2s0 inet auto
    -

    Change this to contain manual instead

    -
    iface enp2s0 inet manual
    -

    Static Bridge

    -

    If you want your server to have a static IP use this

    +

    Create a new bridge interface

    +

    Now create a file in the /etc/network/interfaces.d/ directory, with the name of your bridge (I like br0).

    +

    Static IP

    auto br0
    -iface br0 inet static
    -	bridge_ports enp2s0 # which port(s) to bridge together
    -                address 192.168.0.100 # Static IP
    -                netmask 255.255.255.0
    -                network 192.168.0.1
    -                broadcast 192.168.0.255
    -                gateway 192.168.0.1
    -                bridge_stp off # New
    -                bridge_fd 0 # New
    -                bridge_maxwait 0 # New
    -                dns-nameservers 8.8.8.8 8.8.1.1
    -

    Dynamic Bridge

    -

    If instead you wish your server to have a dynamic IP (not recommended). A bridged network can be set, with a dynamic DHCP set IP

    +iface br0 inet static # Name the same as your file (br0) + address 192.168.0.100 + broadcast 192.168.0.255 + netmask 255.255.255.0 + gateway 192.168.0.1 # Normally your router's IP + dns-nameservers 192.168.0.1 8.8.8.8 8.8.4.4 # Don't set if resolveconf is installed, comment if internet borked + bridge_ports enp1s0 # Your device name + bridge_stp off # Disable Spanning Tree Protocol + bridge_waitport 0 # No delay before a port becomes available + bridge_fd 0 # No forwarding delay (Connects to network immediately) +

    Dynamic IP

    iface br0 inet dhcp
         bridge_ports enp2s0
    -

    Create Virtual Network

    -

    To make it easier to manage with VMs, this new bridge can be made into a Virtual Network.

    -

    Open up a text-editor, and create a file called bridged-network.xml

    -
    vim bridged-network.xml
    +

    (Optional) Create Virtual Network

    +

    To make it easier to manage with VMs, this new bridge can also be made into a Virtual Network (Basically so you can select it from a dropdown).

    +

    Create XML file

    +

    Open up a text-editor, and create a file called br0.xml, named after the bridge itself.

    +
    vim br0.xml

    Enter the following, then save

    <network>
    -	<name>bridged-network</name>
    +	<name>br0</name>
     	<forward mode="bridge"/>
     	<bridge name="br0"/>
     </network>
    -

    Then pass the file to virsh net-define

    -
    sudo virsh net-define bridged-network.xml
    -

    Active, and auto-start the new network

    -
    sudo virsh net-start bridged-network
    -
    sudo virsh net-autostart bridged-network
    + +

    Create the virtual network

    +
    sudo virsh net-define br0.xml
    +

    Activate, and auto-start (on boot) the new network.

    +
    sudo virsh net-start br0
    +
    sudo virsh net-autostart br0
    +

    You can now remove the br0.xml file.

    Reload the network

    sudo systemctl restart networking
    -

    If this creates the bridge, but claims to have failed, restart your PC

    +

    This may claim to have failed, but if checking with ip link shows the bridge, reboot. Essentially the bridge has been brought up, and it's trying to bring it up again (and can't), then throws an error.

    sudo reboot

    Check it's there

    -

    Run another check for networks, and you should now see br0

    -
    ip a
    +				

    Run some checks and you should now see br0, with an IP4 address.

    +
    ip a
    +
    ping google.co.uk
    diff --git a/guides/setup-nginx-website.html b/guides/setup-nginx-website.html index e158887..a34c940 100644 --- a/guides/setup-nginx-website.html +++ b/guides/setup-nginx-website.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    How to setup an NGINX website

    - +
    -
    +

    Nginx has the ability to host multiple websites, all at different domains/sub-domains. This guide will show you how to point a domain at the server, and display a different website than the default NGINX page.

    Make the domain point to the server

    diff --git a/guides/setup-qemu-kvm.html b/guides/setup-qemu-kvm.html index 40af569..1aa97fb 100644 --- a/guides/setup-qemu-kvm.html +++ b/guides/setup-qemu-kvm.html @@ -10,14 +10,15 @@ - Setup KVM/QEMU virtualisation + Setup QEMU/KVM virtualisation
    -

    Setup KVM/QEMU virtualisation

    + Jump directly to main content +

    Setup QEMU/KVM virtualisation

    - +
    -
    +
    -

    This is an intro, you gotta believe me

    -

    Heading

    +

    Virtualisation is the act of creating a virtualised computer (guest), inside another computer (the host) by sharing the hardware. This allows a single host the ability to run all your services, whilst keeping a level of SoC.

    + +

    Enable in the BIOS

    +

    To run virtual machines, certain flags in the bios need to be set. If you don't want to bring down an existing server to check, then check the next section first.

    +
      +
    • Reboot your PC
    • +
    • At the BIOS splashscreen, press your motherboard's prefered key (typically ESC, F3, or F12).
    • +
    • Find and enable the virtualisation setting(s). +
        +
      • One of VT-x, AMD-V, SVM, or Vanderpool.
      • +
      • One of Intel VT-d, or AMD IOMMU (if available)
      • +
      +
    • +
    + +

    Check Virtualisation is enabled

    +

    Double check to make sure your server can be used for virtualisation, if you've enabled it in the BIOS it should be good. Just run one of the following command

    +
    lscpu | grep 'Virtualization'
    +
    grep -E --color '(vmx|svm)' /proc/cpuinfo
    + +

    Install the packages

    +

    The easiest part, just copy and paste the below to install the required packages.

    +
    sudo apt install qemu-kvm libvirt-clients libvirt-daemon libvirt-daemon-system virtinst
    + +

    Sessions

    +

    There are two different session types for VMs, user, and system sessions. If you are using a desktop, and intend to virtualise other desktop OSs I recommend user sessions. If you're setting up a server hypervisor, then use System sessions.

    + +

    User Session

    +

    A user session VM is what I recommend for personal PCs, laptops, etc. as it's the best option for desktop virtualisation (e.g. a Kali install for l33t hackers).

    + +

    Add user to group

    +
    sudo adduser $USER libvirt
    + +

    Enable default network

    +

    Check the name of your default network (typically just 'default').

    +
    sudo virsh net-list --all
    +

    Enable the network.

    +
    sudo virsh net-start default
    +

    (Optionally) Set it to turn on with system boot.

    +
    sudo virsh net-autostart default
    + +

    System Session

    +

    For now all that's needed to know is that you run sudo before any virsh commands, and that the VMs will launch with root permissions.

    + +

    Extra

    +

    Setup bridge adapter for KVM

    +

    Optimisations for KVM Virtual Machines

    +
    diff --git a/guides/sql-cheatsheet.html b/guides/sql-cheatsheet.html index 6d89637..c753c95 100644 --- a/guides/sql-cheatsheet.html +++ b/guides/sql-cheatsheet.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    SQL Cheatsheet

    - +
    -
    +

    SQL is a great, simple to use language to manipulate data within a database. This cheatsheet is aimed at basic SQL for MySQL/MariaDB.

    diff --git a/guides/virsh-cheatsheet.html b/guides/virsh-cheatsheet.html index 4bfdafb..7a2a366 100644 --- a/guides/virsh-cheatsheet.html +++ b/guides/virsh-cheatsheet.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    Virsh Cheatsheet

    - +
    -
    +

    Virsh is an extremely powerful tool for managing KVM/QEMU virtual machines. From restarting, to changing hardware, snapshotting, and cloning machines. I'll cover the basics of Virsh here, as it's all I personally use.

    List VMs

    @@ -76,6 +77,11 @@
    virsh snapshot-delete --domain $vm --snapshotname $snapshot_name

    (TODO)Drive management

    +

    Resize virtual drives

    +

    Find the name of your drive.

    +
    virsh domblklist $vm
    +

    Resize with qemu

    +
    sudo qemu-img resize /location/drive.qcow2 +10G

    Change Memory

    In variantions of 512M, 1G, etc

    diff --git a/guides/vm-seperation-of-concerns.html b/guides/vm-seperation-of-concerns.html index 750251d..e210c46 100644 --- a/guides/vm-seperation-of-concerns.html +++ b/guides/vm-seperation-of-concerns.html @@ -15,9 +15,10 @@
    + Jump directly to main content

    VM/Server Seperation of Concerns

    - +
    -
    +

    Seperation of Concerns is a principle used in Computer Science that helps seperate functionality, making things easier to work with, and avoiding issues that could occur with too much going on in one place

    Why seperate concerns for a server?

    @@ -39,6 +40,7 @@

    How to seperate concerns

    Some people will seperate each service into their own VM, however I don't believe this to be efficient (in all cases).

    What I recommend is to take your server needs, and break them down into logical blocks, adding each of these blocks to their own VMs. This will keep certain things contained alone, as you want them seperated as much as possible (NAS, etc).

    +
    @@ -73,10 +75,10 @@
    Concern/VMServices
    +

    Why not use a dedicated server for each concern?

    You can! No-one's going to stop you, but unless each concern requires (i.e. needs the dedicated hardware/isolation) its own dedicated server, it's hugely redundant. Again NAS as an example, would be good for a dedicated machine, as it'll be safer if there's no additional chance it goes down due to failure of an unrelated service.

    -

    Virtual Machines are wonderful, as they allow you to make use of more powerful/high spec machines while minimising the wasted usage...

    diff --git a/guides/web-dev-101.html b/guides/web-dev-101.html index 0a46a01..bbdd5ae 100644 --- a/guides/web-dev-101.html +++ b/guides/web-dev-101.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Web Development 101

    - +
    -
    +

    Interested in web development, but don't know where to begin? Don't worry, I've got you covered.

    diff --git a/guides/webpage-to-website.html b/guides/webpage-to-website.html index 395b0b6..6ab5494 100644 --- a/guides/webpage-to-website.html +++ b/guides/webpage-to-website.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Webpage to website

    - +
    -
    +

    With a basic webpage now created, the next hurdle is to add multiple pages, and get them all linked together into a website of some sort.

    diff --git a/guides/your-first-webpage.html b/guides/your-first-webpage.html index e90cad8..a24fde1 100644 --- a/guides/your-first-webpage.html +++ b/guides/your-first-webpage.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Your first webpage

    - +
    -
    +

    In my opinion learning is done by doing, so where better to start than making your own basic webpage. This assumes you already have a text editor; you can use Notepad, Vim, etc. but if you're learning coding, I recommend Visual Studio Code

    diff --git a/images/200px.png b/images/200px.png new file mode 100755 index 0000000..969cfa6 Binary files /dev/null and b/images/200px.png differ diff --git a/images/200px.webp b/images/200px.webp new file mode 100755 index 0000000..f8b95da Binary files /dev/null and b/images/200px.webp differ diff --git a/index.html b/index.html index 3b23144..7e3b55b 100644 --- a/index.html +++ b/index.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Aney's Network

    - +
    -
    +

    I'm Aney

    Somehow you've landed on my website, welcome!

    diff --git a/main.css b/main.css index db1ced0..1335390 100644 --- a/main.css +++ b/main.css @@ -1,26 +1,31 @@ html,body{height:100%} -html{font-size:14px} +html{font-size:15px} header{position:relative} header hr{display:none} body{ -max-width:54rem; -margin:.2rem;padding:0 .62rem; -font:1.2rem/1.62 sans-serif; +max-width:768px; +margin:auto;padding:0 1.24rem; +font:1.2rem/1.62 sans-serif;color:#444; display:-webkit-flex;display:-ms-flexbox;display:flex; flex-direction:column} main{flex:1 0 auto} +nav{ +box-sizing:border-box; +z-index:9} nav>a{ padding:.2rem 0; display:block; -border-top:1px dotted #000} +border-top:1px dotted #101} nav>a:first-child{border:none} h1,h2,h3,h4,h5,h6{line-height:1} header h1{margin:1.4rem 52px 1.2rem auto} +h1{color:#000}h2{color:#111}h3{color:#222} +h4,h5,h6{color:#333} a{text-decoration:none} -a:link,a:visited{color:#087CA7} -a:hover,a:visited:hover{color:#09B2DC} +a:link,a:visited{color:#07C} +a:hover,a:visited:hover{color:#1AE} ul{padding-left:0;margin-left:0;list-style:inside} ul li{margin:.35rem} @@ -28,40 +33,70 @@ li>ul{margin-left:1em} .tag{ font-size:.8rem;vertical-align:middle; -padding:.2rem;border-radius:.33rem; -background:#191919;color:#FFF} +padding:.2rem .5rem;border-radius:.33rem; +border:1px solid #CCC} pre{ -background:#191919;color:#FFF; +background:#EEE;padding:1rem; white-space:pre-wrap;overflow-x:auto; -padding:12px;border:1px solid #FFF} +border:1px solid #DDD;border-radius:6px} +code{ +background:#EEE;padding:.2rem; +border:1px solid #DDD;border-radius:6px} +pre code{border:none} +blockquote{ +margin:0 .2rem; +border-left:2px solid; +padding:.4rem;padding-left:.8rem} .page-nav{ float:right; padding:14px;border:1px solid; margin:1.4rem;margin-right:auto} +.sr{ +position:absolute;overflow:hidden; +left:-9999px;top:auto; +width:1px;height:1px; +} +.vh{ +position:absolute; +clip:rect(1px,1px,1px,1px); +height:1px;width:1px; +padding:2px 8px;overflow:hidden; +white-space:nowrap; +background:#FFF;z-index:10} +.vh:focus{ +clip:auto;overflow:auto; +height:auto;width:auto} +.tblcon{overflow-x:auto} footer p{margin:0} -table{text-align:left;width:100%;border-collapse:collapse} -td,th{border:1px solid #222;padding:9px 6px} -th{padding:12px;color:#FFF} -thead th{background:#191919} -tbody th{background:#292929} -tr:nth-child(even){background:#FEFEFE} -tr:hover{background:#DEDEDE} +table{text-align:left;width:100%; +border-collapse:collapse; +overflow-wrap:normal; +margin:24px 0} +td,th{border:1px solid #CCC;padding:9px 6px} +th{padding:12px} +thead tr{background:#FFF} +tbody tr:nth-child(odd){background:#EEE} +tbody tr:hover{background:#DDD} .burger-container{ -position:absolute;height:24px;width:30px; -cursor:pointer;top:34px;right:10px} +position:absolute;height:34px;width:36px; +cursor:pointer;top:25px;right:1.24rem; +position:fixed;background:#FFF; +border:2px solid #EEE;border-radius:6px; +z-index:9} #burger-toggle,#burger-toggle~nav{display:none} +.burger{left:3px;top:7px} .burger,.burger::after,.burger::before{ position:absolute;background:#000; height:4px;width:30px;border-radius:2px;content:""; transition:transform 300ms cubic-bezier(.4,1,.5,1)} -.burger::before{margin-top:-8px} -.burger::after{margin-top:8px} +.burger::before{margin-top:8px} +.burger::after{margin-top:16px} #burger-toggle:checked~nav{display:block} -#burger-toggle:checked+.burger-container .burger::before{margin-top:0;transform:rotate(45deg)} -#burger-toggle:checked+.burger-container .burger::after{margin-top:0;transform:rotate(-45deg)} -#burger-toggle:checked+.burger-container .burger{background:rgba(255,255,255,0)} +#burger-toggle:checked+.burger-container .burger::before{margin-top:8px;transform:rotate(45deg)} +#burger-toggle:checked+.burger-container .burger::after{margin-top:8px;transform:rotate(-45deg)} +#burger-toggle:checked+.burger-container .burger{background:rgba(0,0,0,0)} @media print{body{max-width:none}} @media(min-width:720px){ @@ -72,17 +107,90 @@ transition:transform 300ms cubic-bezier(.4,1,.5,1)} .burger-container{display:none} #burger-toggle~nav,header hr{display:block} } +@media(min-width:320px) and (max-width:719px){ + nav{height:100%; + width:50%;min-width:250px; + position:fixed; + top:0;right:1.24rem; + padding:85px 1.24rem 1.24rem; + background:#FFF;border-left:1px solid #EEE; + z-index:8} +} @media(max-width:320px){ #burger-toggle~nav{display:block} .burger-container{display:none} header h1{margin-right:auto} + body{overflow-wrap:anywhere} + img{width:100%;height:auto} } @media(prefers-color-scheme:dark){ - body{color:#FFF;background:#191919} + body{color:#CCC;background:#101} a:link,a:visited{color:#9CF} - a:hover,a:visited:hover{color:#DA4167} - nav>a{border-color:#FFF} - .tag{background:#FFF;color:#000} - .burger,.burger::after,.burger::before{background:#FFF} + a:hover,a:visited:hover{color:#C34} + nav{background:#101;border-color:#555} + nav>a{border-color:#555} + .burger-container{border:2px solid #555;background:#555;} + .burger,.burger::after,.burger::before{background:#EEE} + h1{color:#FFF}h2{color:#EEE} + h3,h4,h5,h6{color:#DDD} + td,th{border-color:#444} + thead tr{background:#101} + tbody tr:nth-child(odd){background:#222} + tbody tr:hover{background:#333} + pre{background:#333;color:#EEE;border-color:#555} + code{background:#333} + .tag{border-color:#555} } +/* Form stuff */ +/* If I do a CSS framework, it'll need to have a reset too... */ +/* e.g. https://github.com/necolas/normalize.css/blob/master/normalize.css +https://byby.dev/normalize-css#:~:text=css%23css%2Dresets-,Normalize.,experience%20for%20each%20web%20browser. +https://www.joshwcomeau.com/css/custom-css-reset/ +*/ +form{ +border:1px solid; +padding: 1rem; +} +input,select,textarea{ +font:1.2rem/1.62 sans-serif;color:#444; +border:1px solid #CCC; +} +textarea{ +resize: vertical; +} + +input,select,textarea{ +background: #EEE; +border: 2px solid #444; +box-sizing: border-box; +color: #444; +display: block; +line-height: 1; +vertical-align: top; +transition-duration:.2s; +} +input,textarea{ +width:100%; +} +input[type="checkbox"]{ +display:inline-block; +} +input:focus,select:focus,textarea:focus { + border-color: #9CF; +} +@media(min-width:720px){ + input,select,textarea{ + display:inline-block; + max-width:50%; /* so half it can be, with margins factored in... */ + max-width:346.8px; + } + input,textarea{ + width:auto; + } +} +@media(prefers-color-scheme:dark){ + input,select,textarea{ + background:#CCC;border-color:#CCC; + } +} diff --git a/projects.html b/projects.html index 4269f9d..914fb25 100644 --- a/projects.html +++ b/projects.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Aney's Projects

    - +
    -
    +

    Current Projects

    -

    Here to hold me accountable, as I cannot finish my own projects

    Personal Website

    @@ -45,7 +45,7 @@

    aNetwork

    A gaming community, and public server host.

    This consists of a website, server hosting, and community/server administration.

    -

    Skills: HTML CSS JS Linux System Administration

    +

    Skills: HTML CSS JS Linux System Administration

    diff --git a/recipes/index.html b/recipes/index.html index 99c7055..39fd3ee 100644 --- a/recipes/index.html +++ b/recipes/index.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Aney's Recipes

    - +
    -
    +

    A collection of recipes I use, mostly budget oriented, but always tastee.

    diff --git a/recipes/woky-beef-stew.html b/recipes/woky-beef-stew.html index 5e19caa..2b6e221 100644 --- a/recipes/woky-beef-stew.html +++ b/recipes/woky-beef-stew.html @@ -14,9 +14,10 @@
    + Jump directly to main content

    Woky Beef Stew

    - +
    -
    +