sidskipedia transfered to digital garden

This commit is contained in:
Sindre Kjelsrud 2023-12-10 22:52:18 +01:00
parent 643281df3e
commit bbb940669b
8 changed files with 273 additions and 0 deletions

View file

@ -0,0 +1,44 @@
---
title: 'Linux'
description: '🌱 ~ Some info I keep forgetting on Linux lol'
layout: "../../../layouts/Layout.astro"
---
## 📝 Info
...
## ❓ Random
### Remove .DS_Store files
`find . -name ".DS_Store" -print -delete`
### Get & Send files/folders from/to Linux machine
```
Get files/folder from Linux machine:
scp -r sid@10.0.0.1:minecraft-old/ Desktop
Send files/folder to Linux machine:
scp pepenarutorun.png sid@10.0.0.1:~/minecraft-old
```
### How to Format USB using the Terminal (link)
**Step 1: Locate USB Drive**
> Open the terminal and run the following command: ***df***
The terminal prints out a list of all mounted partitions and relevant information: used space, available space, used space percentage, and the path.
Locate the USB in the list and find the corresponding device.
**Step 2: Unmount and Format USB Drive**
> Unmount the USB drives before formatting. To do so, run this command: ***sudo umount {USB_FILESYSTEM}***. After unmounting, format the USB drive using the preferred file system:
> - FAT32 file system: sudo mkfs.vfat /dev/{NAME_OF_DEVICE}
> - NTFS file system: sudo mkfs.ntfs /dev/{NAME_OF_DEVICE}
> - exFAT file system: sudo mkfs.exfat /dev/{NAME_OF_DEVICE}
**Step 3: Verify USB Drive Formatting**
> Confirm the formatting process has completed successfully: ***sudo fsck /dev/{NAME_OF_DEVICE}***. A USB drive with no files indicates successful formatting.

View file

@ -0,0 +1,50 @@
---
title: 'Windows'
description: '🌱 ~ Some info I keep forgetting on Windows lol'
layout: "../../../layouts/Layout.astro"
---
## 📝 Info
...
## ❓ Random
### How do I remove the process currently using a port on localhost in Windows? (link)
**1.** Open up cmd.exe (note: you may need to run it as an administrator, but this isnt always necessary), then run the below command:
```
netstat -ano | findstr :<PORT>
(Replace <PORT> with the port number you want, but keep the colon)
ps: the last column is the PID (process identifier)
```
**2.** Next, run the following command:
`taskkill /PID <PID> /F`
### How to Format a Bootable USB Drive (link)
This is for when you want to restore back your pen drive to its usual condition.
This is done by formatting the pen drive via DiskPart by follwoing the steps under:
**1.** Open Run using the key combination (Win key + R).
**2.** Type cmd to open Command Prompt.
**3.** Type diskpart and run the pop-up winidow that appears. This opens DiskPart.
**4.** Type list disk. This will list all the memory storage devices connected to the PC.
**5.** Type select disk 1. (usually disk 1 if no other storage devices are connected).
The number specifies the drive to be formatted. Drive 0 wil be your internal hard disk. Identify and select your disk correctly.
**6.** Type clean. This wipes data off your pen drive.
**7.** Type create partition primary. This will format the pen drive as FAT.
**8.** Now go to My Computer or This PC, and format the pen drive by right clicking on it and selecting the format option.

View file

@ -0,0 +1,52 @@
---
title: 'Wireguard'
description: '🌿 ~ Some info I keep forgetting lol'
layout: "../../../layouts/Layout.astro"
---
## 📝 Info
[Wireguard](https://www.wireguard.com/) is a VPN service I use to connect to the server at home.
One needs to configure the connection between the machine server and the new device.
## 📋 Different commands
- ***get servers network info***
`ifconfig`
- ***generate private & public keys***
`wg genkey | tee privatekey | wg pubkey > publickey`
- ***change permissions***
`chmod 600 privatekey && chmod 600 wg0.conf`
- ***start and enable wireguard server***
`systemctl start wg-quick@wg0 && systemctl enable wg-quick@wg0`
- ***check status***
`systemctl status wg-quick@wg0`
- ***add client on wireguard server***
`wg set wg0 peer PUBLICKEY_CLIENT allowed-ips ADDRESS_CLIENT && wg-quick show wg0`
- ***wg0.conf***
```
[Interface]
Address = redacted/24
ListenPort = 55555
PrivateKey = redacted
PostUp = iptables -A FORWARD -i wg0 -j ACCEPT
PostUp = iptables -t nat -A POSTROUTING -o SERVER_IFCONFIG_NAME -j MASQUERADE
PostDown = iptables -D FORWARD -i wg0 -j ACCEPT
PostDown = iptables -t nat -D POSTROUTING -o SERVER_IFCONFIG_NAME -j MASQUERADE
```