Computer Hacking 101

Welcome to Computer Hacking 101

Welcome to the Computer Hacking 101 website. Our platform provides a vast array of valuable information to optimize your computing experience. Our extensive selection of tutorials covers topics such as docker, windows, file synchronization across devices, Linux, and much more.

Furthermore, we offer an accompanying YouTube channel, where you can find complementary resources to the documents found on our website, which are accessible through our comprehensive documentation section.

Subsections of Computer Hacking 101

Chapter 1

Blog

Welcome to my blog

  • website update and info about youtube

    We change the theme again to a new theme that might work better because I am planning on adding alot of documents to this site. Everything for git, docker, github, hugo, and even some neovim. I also got the search working. I am planning on making some more videos including a few shorts about neovim actions and tricks. The videos might take a while for me to produce and come out but I should have more docs first then I will add the videos to the docs and to youtube channel.

  • Feb 15, 2023, update

    Update what is going on with comptuerhacking101.com

  • We change the theme with other updates

    I have modified the appearance of this website and am currently in the process of refining some of its pages, such as the contact page, while also incorporating a new copy-and-paste feature for ease of code sharing. Please note that further changes to the website’s aesthetics may occur.

    In addition, I am diligently working on the completion of a tutorial video regarding the utilization of syncthing, which will likely be accompanied by supplementary documentation on this platform.

  • The first blog post

    Greetings and welcome to the inaugural post on the Computer Hacking 101 website. In this blog, we aim to keep you informed about our ongoing projects and updates to our YouTube channel and website.

    As part of our efforts to enhance the website’s functionality, we have transitioned from WordPress to Hugo, a contemporary and robust website builder. As we continue to refine the website’s design, some changes may occur over time.

Subsections of Blog

website update and info about youtube

We change the theme again to a new theme that might work better because I am planning on adding alot of documents to this site. Everything for git, docker, github, hugo, and even some neovim. I also got the search working. I am planning on making some more videos including a few shorts about neovim actions and tricks. The videos might take a while for me to produce and come out but I should have more docs first then I will add the videos to the docs and to youtube channel.

Feb 15, 2023, update

move to another server

I am now hosting this website on my own server located at my house. I am using Cloudflare tunnel, Cloudflare catch, docker, GitHub, and Jenkins to create and host this and my personal site. I will make multiple videos on how to do this. It took me a while to set it up correctly.

still fixing a few issues with the website

I still need to fix a few more issues on this website. The doc page is still messed up, and I have some SEO things to make the website better to find in search engines. I still need to get the copy-and-paste to work correctly.

youtube channel

Sorry, getting the syncthing video up and running has been taking forever. I had some issues when I was recording it. I have recorded it three times, and there are some spots I need to rerecord again. Then I have to finish editing it. I am still learning DaVinci Resolve, so it takes some time to create the video.

We change the theme with other updates

I have modified the appearance of this website and am currently in the process of refining some of its pages, such as the contact page, while also incorporating a new copy-and-paste feature for ease of code sharing. Please note that further changes to the website’s aesthetics may occur.

In addition, I am diligently working on the completion of a tutorial video regarding the utilization of syncthing, which will likely be accompanied by supplementary documentation on this platform.

Moreover, I am in the process of finalizing a video detailing my experience with transferring to a 1u case. I am eager for you to witness this video and learn from any potential errors I may have made.

The first blog post

Greetings and welcome to the inaugural post on the Computer Hacking 101 website. In this blog, we aim to keep you informed about our ongoing projects and updates to our YouTube channel and website.

As part of our efforts to enhance the website’s functionality, we have transitioned from WordPress to Hugo, a contemporary and robust website builder. As we continue to refine the website’s design, some changes may occur over time.

We are pleased to announce that we have an upcoming video titled “How to Use Syncthing” scheduled for release in the next few weeks. Additionally, we have recently acquired a 1u server case that we will be transferring our Promox server to, which will be the subject of a future video.

Please note that due to our team’s work commitments and personal obligations, video releases may be infrequent. However, we are committed to delivering high-quality content, and we appreciate your patience and understanding.

Chapter 1

Tutorials

Thease tutorials help you make your computer do what you want it to do.

  • All about ssh

    The following tutorials is all about ssh. What is ssh and how to use it.

  • Git

    The following tutorials is all about git. The history, how to use git and github.

    • Gits History

      Git, a distributed version control system, has a fascinating history rooted in open-source software development. Its journey reflects innovation and the needs of large-scale collaborative projects.

  • Setting up a server

    Selecting a web server provider and setting it up.

  • docker

    Welcome to our comprehensive collection of Docker-related resources. Whether you’re just getting started with Docker or you’re an advanced user, we have everything you need to build, ship, and run your applications more efficiently. Our documentation covers a wide range of topics, from installation and setup to advanced container management, ensuring that you can harness the full power of Docker in your development and production environments.

    Explore detailed guides on creating Docker images, managing containers, and using Docker Compose for multi-container applications. We also provide tips for optimizing performance, troubleshooting issues, and integrating Docker with CI/CD pipelines. These docs will help you navigate the ever-evolving ecosystem of containerization with ease, empowering you to streamline your workflows and achieve better scalability and portability for your applications.

  • syncthing

    The following tutorials is all about syncthing.

    • Dropbox Vs Syncthing

      Compare Dropbox and Syncthing on our site to find the ideal file sync tool for you. Discover which has better security, privacy, and pricing. Choose the best solution.

    • Install syncthing on linux

      This will show you how to install synchthing on a Linux computer using apt.

    • Installing Syncthing on windows

      This will show you how to use synctrazor to install syncthing on your windows computer.

Subsections of Tutorials

Chapter 1

All about ssh

The following tutorials is all about ssh. What is ssh and how to use it.

Subsections of All about ssh

Creating a ssh key

Creating an ed25519 key pair for SSH in Linux is straightforward. Follow these steps:

1. Open a Terminal

Open a terminal on your Linux system.

2. Generate the Key Pair

Use the ssh-keygen command to create an ed25519 key. Run the following command:

ssh-keygen -t ed25519 -C "your_email@example.com"

Replace "your_email@example.com" with an appropriate label for the key. This is optional and typically used to identify the key.

3. Specify File Location

When prompted to specify a file to save the key:

  • Press Enter to save it in the default location (~/.ssh/id_ed25519), or
  • Specify a different path if needed.

4. Set a Passphrase (Optional)

You’ll be asked to enter a passphrase. This adds an extra layer of security.

  • Leave it empty for no passphrase (not recommended for security reasons), or
  • Set a strong passphrase.

5. Key Generation Complete

Once complete, the keys will be saved in the specified location. You should see output like this:

Your identification has been saved in /home/username/.ssh/id_ed25519
Your public key has been saved in /home/username/.ssh/id_ed25519.pub
Chapter 1

Git

The following tutorials is all about git. The history, how to use git and github.

  • Gits History

    Git, a distributed version control system, has a fascinating history rooted in open-source software development. Its journey reflects innovation and the needs of large-scale collaborative projects.

Subsections of Git

Gits History

History of Git

Git, a distributed version control system, has a fascinating history rooted in open-source software development. Its journey reflects innovation and the needs of large-scale collaborative projects.

Origins

Before Git, version control systems like CVS (Concurrent Versions System) and SVN (Subversion) dominated the scene. These systems were centralized, which posed significant challenges for large, distributed projects.

The Linux kernel project initially relied on a proprietary system called BitKeeper, which allowed for distributed workflows crucial for the globally spread Linux developer community.

The Creation of Git (2005)

The BitKeeper Conflict

In 2005, the relationship between the Linux community and BitKeeper’s creator, Larry McVoy, broke down. As a result, the Linux kernel project lost access to BitKeeper.

A New Solution

Faced with this challenge, Linus Torvalds, the creator of Linux, decided to develop a new system with the following goals:

  • Distributed: Each developer has the complete history of the project.
  • Fast: Efficient performance for large-scale repositories.
  • Scalable: Suitable for massive projects like the Linux kernel.
  • Free and Open-Source: Accessible to everyone.

Thus, Git was born in April 2005. The name “Git” was humorously chosen by Linus as a self-deprecating term.

Early Features of Git

  1. Snapshots, Not Deltas
    Unlike other systems that stored changes (deltas), Git stored snapshots of the entire project tree, enabling faster and more efficient operations.

  2. Distributed Model
    Every Git clone is a complete repository with the project’s entire history.

  3. Lightweight Branching
    Git introduced efficient branching and merging, allowing developers to work on multiple features without disrupting the main codebase.

Evolution and Adoption

Under Junio Hamano

Linus handed over Git’s maintenance to Junio Hamano in mid-2005. Hamano has overseen Git’s evolution, ensuring its stability and adding features.

Widespread Adoption

By the late 2000s:

  • Git became popular among open-source projects like GNOME and KDE.
  • Platforms like GitHub (launched in 2008) simplified its use, accelerating adoption.

Git in the Modern Era

  • DevOps Integration: Git is central to modern workflows, supporting CI/CD pipelines.
  • Extensions and Tools: Innovations like Git LFS (Large File Storage) and GUI clients extend its capabilities.
  • Community: Git’s vibrant ecosystem of users and contributors continues to grow.

Legacy

Git revolutionized version control with its efficiency, flexibility, and scalability. It’s now the de facto standard for software development, empowering collaboration across projects of all sizes.

Whether it’s a small hobby project or an enterprise-level application, Git plays a pivotal role in modern development.

Subsections of Setting up a server

Creating a Droplet on DigitalOcean

Deploying a Virtual Private Server (VPS) isn’t as hard as it might seem. In this guide, I’ll walk you through the process of setting up a server correctly. I’ll be using Pop!_OS (built on Ubuntu) for my main computer and Ubuntu Server for my VPS. For this tutorial, I’ve chosen DigitalOcean as my VPS provider.

Step 1: Set Up a DigitalOcean Account

Start by creating an account on DigitalOcean. It’s a simple process, and with my referral link, you’ll receive $200 in credit to use on DigitalOcean for 60 days.

Step 2: Generate an SSH Key

You’ll need an SSH key for secure authentication. If you don’t already have one, follow These instructions to create an SSH key.

Step 3: Create a Droplet

Once your account is set up, navigate to the DigitalOcean dashboard and click on Create > Droplets. DigitalOcean refers to their VPS instances as “Droplets.”

Creating a Droplet Creating a Droplet

Select Data Center

Choose a data center closest to you or your target audience.

Choose an Image

Select Ubuntu 24.10 x64 as your operating system.

Choose a Plan

For small websites, the $4/month plan is sufficient. This plan includes:

  • 1 CPU
  • 512 MB of RAM
  • 10 GB SSD
  • 500 GB of transfer bandwidth

selecting a plan selecting a plan

If your needs grow, you can always upgrade later.

Authentication Method

Use SSH key authentication—it’s more secure than using a password. To add your SSH key:

  1. Open a terminal on your main desktop and run the following command:

    cat ~/.ssh/id_ed25519.pub

    SSH Public Key in Terminal SSH Public Key in Terminal

  2. Copy the output starting with ssh-ed25519 and ending with your email address.

  3. Paste it into the New SSH Key section on the DigitalOcean dashboard, name it, and click Add SSH Key.
    Adding an SSH Key Adding an SSH Key

Step 4: Finalize and Create Your Droplet

Scroll down, change the hostname to something meaningful, and click Create Droplet.
Changing Hostname Changing Hostname

What’s Next?

Congratulations! You’ve successfully created your first Droplet. Now, you can begin configuring it for your specific needs.

Setting Up and Securing Your Ubuntu Server

Introduction

DigitalOcean provides the option to configure your own VPS server. Now that your server is set up, it’s time to connect and secure it. Follow these steps to get started:

Step 1: Connect to Your Server

First, get the IP address of your new server. Then, open a terminal and type the following command:

ssh root@{ip_address_of_the_server}

Press Enter.

Connecting to SSH Connecting to SSH

The first time you connect, you’ll see a prompt asking if you want to continue. Type yes and press Enter.

SSH Fingerprint SSH Fingerprint

Step 2: Update Your System

Once connected, update your server to ensure it’s secure by running the following commands:

apt update && apt upgrade -y

This will apply all updates to your server. You should run this command regularly (weekly or monthly). If the updates include a kernel update, reboot the server with:

reboot

Wait a minute or two for the server to restart, then reconnect using the same ssh command as before.

Step 3: Create a New User

For security, avoid logging in as the root user. Create a new user with the following command:

adduser chris

Replace chris with your desired username. Follow the prompts to set a password and skip additional questions by pressing Enter multiple times. Confirm the information at the end by pressing Enter again.

Adding a User Adding a User

Next, add the new user to the sudo group:

usermod -aG sudo chris

Replace chris with your username.

Step 4: Configure SSH Keys

Copy your SSH public key to the new user’s home directory:

cp -r ~/.ssh /home/chris/.ssh

Update the ownership of the .ssh directory:

sudo chown -R chris:chris /home/chris/.ssh

Test logging in as the new user:

ssh chris@{ip_address_of_the_server}

Login as New User Login as New User

Step 5: Disable Root SSH Login

Open the SSH configuration file:

sudo vim /etc/ssh/sshd_config

Find the line PermitRootLogin yes and change it to PermitRootLogin no. Press i to edit, make the change, then press ESC and type :wq to save and exit.

Editing SSH Config Editing SSH Config

Restart the SSH service to apply the changes:

sudo systemctl restart sshd

Step 6: Set Up a Firewall

To block unwanted traffic, configure the Uncomplicated Firewall (UFW):

  1. Deny all incoming traffic:

    sudo ufw default deny incoming

    Deny Incoming Traffic Deny Incoming Traffic

  2. Allow all outgoing traffic:

    sudo ufw default allow outgoing

    Allow Outgoing Traffic Allow Outgoing Traffic

  3. Allow SSH connections:

    sudo ufw allow OpenSSH

    Allow SSH Allow SSH

  4. Verify the rules:

    sudo ufw show added

    Check Firewall Rules Check Firewall Rules

  5. Enable the firewall:

    sudo ufw enable

    Press y to confirm.

    Enable Firewall Enable Firewall

Conclusion

Your server is now secure and configured to allow only SSH connections. Regularly update your server and monitor firewall settings to maintain security.

Chapter 2

docker

Welcome to our comprehensive collection of Docker-related resources. Whether you’re just getting started with Docker or you’re an advanced user, we have everything you need to build, ship, and run your applications more efficiently. Our documentation covers a wide range of topics, from installation and setup to advanced container management, ensuring that you can harness the full power of Docker in your development and production environments.

Explore detailed guides on creating Docker images, managing containers, and using Docker Compose for multi-container applications. We also provide tips for optimizing performance, troubleshooting issues, and integrating Docker with CI/CD pipelines. These docs will help you navigate the ever-evolving ecosystem of containerization with ease, empowering you to streamline your workflows and achieve better scalability and portability for your applications.

  • What is docker

    Git, a distributed version control system, has a fascinating history rooted in open-source software development. Its journey reflects innovation and the needs of large-scale collaborative projects.

  • Install docker and portainer

    Learn how to install Docker, Docker Compose, and Portainer on a Linux server to build, ship, and manage your distributed applications. Follow step-by-step instructions to update your package index, install Docker CE, start the Docker daemon, download and make Docker Compose executable, and run Portainer. With this guide, you'll be able to manage your Docker environment with ease.

Subsections of docker

What is docker

In recent years, the use of Docker has skyrocketed in popularity, especially within the development community. Docker is an open-source containerization platform that simplifies the process of building, deploying, and managing applications. It provides a lightweight, portable, and self-sufficient runtime environment that can run on any machine. In this article, we will dive deep into Docker, its components, how it works, and its benefits.

Understanding Docker Architecture

Docker architecture comprises several components that work together to provide a complete containerization solution. Here are the key components of Docker:

Docker Daemon: It is the core component of Docker that runs in the background and manages the container’s lifecycle.

Docker Client: It is the command-line tool that interacts with the Docker daemon to create, run, and manage containers.

Docker Images: They are read-only templates that contain all the necessary files and configurations to run an application.

Docker Containers: They are the runtime instances of Docker images.

Docker Registry: It is a centralized repository that stores Docker images, making them available for sharing and distribution.

How Does Docker Work?

Docker uses a client-server architecture where the Docker daemon runs on the host machine and listens for Docker client requests. The Docker client communicates with the daemon via a REST API, and the daemon performs the requested actions, such as creating or deleting containers.

Docker uses a layered filesystem that allows multiple Docker images to share a common base image. The base image is read-only, and every subsequent layer is writeable. When a new container is created, a new writable layer is added on top of the base image layer. This allows the container to modify files without affecting the base image or other containers.

Docker Benefits

Portability: Docker containers are lightweight and portable, making them easy to move across different environments, such as development, testing, and production.

Isolation: Docker containers provide a high degree of isolation, allowing multiple applications to run on the same machine without interfering with each other.

Scalability: Docker containers can be scaled up or down quickly and easily to meet changing demands.

Resource Efficiency: Docker containers are lightweight and use fewer resources compared to traditional virtual machines, making them more efficient.

Consistency: Docker containers ensure that the application runs consistently across different environments, reducing the risk of errors and inconsistencies.

Frequently Asked Questions (FAQs)

Q1. How is Docker different from virtual machines?

A1. Docker containers are lightweight and share the same host kernel, while virtual machines require a separate operating system kernel for each instance.

Q2. Can Docker run on Windows and macOS?

A2. Yes, Docker can run on Windows and macOS using Docker Desktop, which provides a native Docker experience on these platforms.

Q3. How can I share my Docker images with others?

A3. You can push your Docker images to a public or private Docker registry, such as Docker Hub or Amazon ECR, and share the image tag with others.

Q4. How can I debug my Docker containers?

A4. You can use Docker’s logging and debugging features, such as docker logs and docker exec, to diagnose and fix issues with your containers.

Q5. How can I ensure the security of my Docker containers?

A5. You can follow Docker’s best practices for container security, such as limiting container privileges, using trusted base images, and regularly updating your Docker images and containers.

Install docker and portainer

Docker is a popular platform for building, shipping, and running distributed applications. Docker Compose is a tool for defining and running multi-container Docker applications. Portainer is a management tool for Docker that makes it easy to manage your containers, images, networks, and volumes. In this article, we’ll show you how to install these tools on a Linux server.

Prerequisites

Before we get started, make sure that you have a Linux server set up and that you have administrative access to that server.

Updating the Package Index

Before installing Docker, it is important to update the package index on your server. You can do this by running the following command:

sudo apt-get update

Installing Docker CE

Next, we’ll install Docker CE (Community Edition) by running the following command:

sudo apt-get install docker-ce

Starting the Docker Daemon

Once the installation is complete, we need to start the Docker daemon by running the following command:

sudo systemctl start docker

Installing Docker Compose

To install Docker Compose, we need to download the latest version of the binary and make it executable. We can do this by running the following commands:

sudo curl -L "https://github.com/docker/compose/releases/download/1.27.4/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose

Verifying the Docker and Docker Compose Installations

To verify that the Docker and Docker Compose installations were successful, we can run the following commands:

docker --version
docker-compose --version

Installing Portainer

To install Portainer, we can run the following command:

docker run -d -p 9000:9000 -v /var/run/docker.sock:/var/run/docker.sock portainer/portainer

This command will download the Portainer image and run a container based on that image, exposing Portainer on port 9000.

Accessing Portainer

Once the Portainer container is running, we can access the Portainer web interface by opening a web browser and navigating to http://your_server_ip:9000. We should see the Portainer login screen.

Conclusion

In this article, we showed you how to install Docker, Docker Compose, and Portainer on a Linux server. You can now start using Docker to build, ship, and run your applications, and use Portainer to manage your Docker environment.

I hope you found this article helpful. If you have any questions or comments, please leave them in the comments section below. Thank you for reading!

Chapter 3

syncthing

The following tutorials is all about syncthing.

  • Dropbox Vs Syncthing

    Compare Dropbox and Syncthing on our site to find the ideal file sync tool for you. Discover which has better security, privacy, and pricing. Choose the best solution.

  • Install syncthing on linux

    This will show you how to install synchthing on a Linux computer using apt.

  • Installing Syncthing on windows

    This will show you how to use synctrazor to install syncthing on your windows computer.

Subsections of syncthing

Dropbox Vs Syncthing

In the video below I will explain the differnece between Dropbox and Syncthing. It will explain why I went with syncthing.

Install syncthing on linux

Step 1 add Syncthing repo to apt sources

Syncthing isn’t available to install using the default repo. So the first step is adding syncthing repo to our apt sources so we can install it on our computer. We need to open up a terminal and run the following command.

echo "deb https://apt.syncthing.net/ syncthing stable" | sudo tee /etc/apt/sources.list.d/syncthing.list
adding-syncthing-repo adding-syncthing-repo

Step 2 Installing curl

We must ensure we have curl installed to install the syncthing PGP key. All we need to do is the following command.

sudo apt install curl

If it is already installed, you will get this message

ifcurlinstall ifcurlinstall

If you need to install it, your screen will look like this one.

instaling curl instaling curl

Step 3 – Add syncthing’s PGP Keys

The next step we need to do Is add the synching repo PGP key to our apt keys. Without this, apt will not trust synching repo and will not install syncthing.

curl -s https://syncthing.net/release-key.txt | sudo apt-key add -

You should see the following if you added it correctly.

adding-syncthing-apt adding-syncthing-apt

Step 4 – Update apt’s database

We need to update the download package information from synching and your other sources on your computer. We do that by running the sudo apt update.

sudo apt update

sudo-apt-update sudo-apt-update

Step 5 – Installing Syncthing

We finally get to install Syncthing on Linux. We just need to type the command below and press enter.

sudo apt install syncthing
install-syncthing install-syncthing

Step 6 – Enable the Syncthing service

Now we got syncthing installed; we need to enable syncthing to start at boot using the systemctl command. But make sure you replace the username with your user name in the following order. But please don’t use root. It is a security issue.

sudo systemctl enable syncthing@username.service
enable-syncthing enable-syncthing

Step 7 – Start syncthing service up

Let’s start syncthing up for the first time by running this command below. Make sure you change the user name to your user name.

sudo systemctl start syncthing@username.service
adding-syncthing-apt-key adding-syncthing-apt-key

(Optional) setting syncthing so you can remotely connect to it

If you want to configure syncthing from another computer, you must change one line in the config file to allow access. It would be best if you had an editor. In this example, I am going to be using pico.

sudo pico .config/syncthing/config.xml
picoconfig picoconfig

Need to find 127.0.0.1:8384 It is under the . We need to change it from 127.0.0.1:8384 to 0.0.0.0:8384 (/images/syncthing/linux/changeipaddress.webp)

Then we need to restart the syncthing service by running this command. Make sure you change the username to your username again

sudo systemctl restart syncthing@username.service

Installing Syncthing on windows

To Install Syncthing on Windows there are two ways of installing it. One is with synctrazor which I will walkthrough below. It also comes with the benefit of having a GUI(Graphical User Interface).

1. Download Synctrazor

The first step is to download Synctrazor. You can download it from the following link.

https://github.com/canton7/SyncTrayzor/#installation`

When you go to the page you need to click on Download SyncTrayzorSetup-x64.exe. This will download the executable file.

When you go to that page you need to click on Download SyncTrayzorSetup-x64.exe. (/images/syncthing/windows/download.webp#center)

After you click on that link it will take you to this page and then you will click on SyncTrayzorSetup-x64.exe or SyncTrayzorSetup-x86.exe. Most people will want to use the x64 version if they have a computer with windows7,8, 10, or 11.

2. Install Synctrazor

Just click on the executable file and it will install Synctrazor. It will pop up a warning message. This is because synctrayzorsetup isn’t signed by a known publisher of Microsoft. The software is fine to use but it is not a trusted source. So we need to click on the Yes button. (/images/syncthing/windows/accesscontrol.webp#center)

The rest is just pressing next to you click on finish. If you want to watch me do it you can watch the video above.