Compare commits
No commits in common. "41f4adbd47bb00a2542b6540b80311e886589303" and "33a93135bc4a8a597f5bef882953d852e0b93c0a" have entirely different histories.
41f4adbd47
...
33a93135bc
40
README.md
40
README.md
@ -14,9 +14,18 @@ Host \$HOST_NAME
|
|||||||
|
|
||||||
Now you can just connect using ssh \$HOST_NAME
|
Now you can just connect using ssh \$HOST_NAME
|
||||||
|
|
||||||
|
## Pythons commands
|
||||||
|
|
||||||
|
```bash
|
||||||
|
# Update every packages
|
||||||
|
pip freeze | cut -d = -f 1 | xargs -n1 pip install -U
|
||||||
|
# Uninstall every packages
|
||||||
|
pip freeze | cut -d = -f 1 | xargs -n1 pip uninstall -y
|
||||||
|
```
|
||||||
|
|
||||||
## Docker commands
|
## Docker commands
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
# Remove every images
|
# Remove every images
|
||||||
docker images --format="{{.ID}}" | xargs docker rmi
|
docker images --format="{{.ID}}" | xargs docker rmi
|
||||||
# Remove every containers
|
# Remove every containers
|
||||||
@ -41,7 +50,7 @@ for(lib in .libPaths()) lapply(my_packages$Package, remove.packages, lib = lib)
|
|||||||
|
|
||||||
## Setup Git SSH key
|
## Setup Git SSH key
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
# Generate a SSH key pair
|
# Generate a SSH key pair
|
||||||
ssh-keygen -t rsa -b 4096 -o -a 100 -C "email@example.com" -f ~/.ssh/$KEY_NAME
|
ssh-keygen -t rsa -b 4096 -o -a 100 -C "email@example.com" -f ~/.ssh/$KEY_NAME
|
||||||
ssh-keygen -t ed25519 -a 100 -C "email@example.com" -f ~/.ssh/$KEY_NAME
|
ssh-keygen -t ed25519 -a 100 -C "email@example.com" -f ~/.ssh/$KEY_NAME
|
||||||
@ -54,7 +63,7 @@ ssh -T git@github.com
|
|||||||
git remote set-url origin git@github.com:username/your-repository.git
|
git remote set-url origin git@github.com:username/your-repository.git
|
||||||
# Add key to SSH config file (~/.ssh/config)
|
# Add key to SSH config file (~/.ssh/config)
|
||||||
echo -e "\n\nHost github.com\n\tIdentityFile ~/.ssh/$KEY_NAME" >> ~/.ssh/config
|
echo -e "\n\nHost github.com\n\tIdentityFile ~/.ssh/$KEY_NAME" >> ~/.ssh/config
|
||||||
cat KEY_FILE | ssh REMOTE "cat >> ~/.ssh/authorized_keys"
|
cat KEY_FILE | ssh REMOTE "cat >> ~/authorized_keys"
|
||||||
```
|
```
|
||||||
|
|
||||||
## Font ligature test
|
## Font ligature test
|
||||||
@ -70,7 +79,7 @@ cat KEY_FILE | ssh REMOTE "cat >> ~/.ssh/authorized_keys"
|
|||||||
|
|
||||||
## QEMU cheat sheet
|
## QEMU cheat sheet
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
# Creating the disk image
|
# Creating the disk image
|
||||||
qemu-img create -f qcow2 DISK_NAME.img 15G
|
qemu-img create -f qcow2 DISK_NAME.img 15G
|
||||||
|
|
||||||
@ -86,7 +95,7 @@ qemu-system-x86_64 $DISK_NAME.img \
|
|||||||
|
|
||||||
### IP Host (eth1 has internet, eth0 is remote)
|
### IP Host (eth1 has internet, eth0 is remote)
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
# Enable kernel port forwarding
|
# Enable kernel port forwarding
|
||||||
sysctl -w net.ipv4.ip_forward=1
|
sysctl -w net.ipv4.ip_forward=1
|
||||||
# Enable at reboot
|
# Enable at reboot
|
||||||
@ -106,7 +115,7 @@ iptables -t nat -A POSTROUTING -o eth1 -j MASQUERADE
|
|||||||
|
|
||||||
### IP Remote
|
### IP Remote
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
connmanctl
|
connmanctl
|
||||||
config <eth0> --ipv4 manual 192.168.137.2 255.255.255.0 192.168.137.1 --nameservers <DNS-SERVER>
|
config <eth0> --ipv4 manual 192.168.137.2 255.255.255.0 192.168.137.1 --nameservers <DNS-SERVER>
|
||||||
```
|
```
|
||||||
@ -117,7 +126,7 @@ config <eth0> --ipv4 manual 192.168.137.2 255.255.255.0 192.168.137.1 --nameserv
|
|||||||
|
|
||||||
In Windows you must have _Adobe Digital Editions_ and _Calibre_ using Chocolatey
|
In Windows you must have _Adobe Digital Editions_ and _Calibre_ using Chocolatey
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
choco install -y adobedigitaleditions calibre
|
choco install -y adobedigitaleditions calibre
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -136,7 +145,7 @@ choco install -y adobedigitaleditions calibre
|
|||||||
|
|
||||||
## Loop devices
|
## Loop devices
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
# Create loop device to $BLOCK_PATH of 4G
|
# Create loop device to $BLOCK_PATH of 4G
|
||||||
dd if=/dev/zero of=$BLOCK_PATH bs=1M count=4096
|
dd if=/dev/zero of=$BLOCK_PATH bs=1M count=4096
|
||||||
# Create loop filesystem
|
# Create loop filesystem
|
||||||
@ -153,7 +162,7 @@ rm $BLOCK_PATH
|
|||||||
|
|
||||||
## Install img.xz
|
## Install img.xz
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
xzcat $IMG_FILE | dd of=/dev/$DEVICE bs=64k oflag=dsync status=progress
|
xzcat $IMG_FILE | dd of=/dev/$DEVICE bs=64k oflag=dsync status=progress
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -170,7 +179,7 @@ root hard nofile 64000
|
|||||||
|
|
||||||
## Verify a PGP Signature
|
## Verify a PGP Signature
|
||||||
|
|
||||||
```sh
|
```bash
|
||||||
mkdir /home/$USER/.XDG/data/gnupg
|
mkdir /home/$USER/.XDG/data/gnupg
|
||||||
chmod 700 /home/$USER/.XDG/data/gnupg
|
chmod 700 /home/$USER/.XDG/data/gnupg
|
||||||
gpg --import $PUBLIC_KEY
|
gpg --import $PUBLIC_KEY
|
||||||
@ -178,14 +187,3 @@ chmod 600 /home/$USER/.XDG/data/gnupg/$PUBLIC_KEY
|
|||||||
gpg --verify $SIGNATURE.sig $FILE
|
gpg --verify $SIGNATURE.sig $FILE
|
||||||
```
|
```
|
||||||
|
|
||||||
### Self-signed OpenSSL
|
|
||||||
|
|
||||||
#### interactive
|
|
||||||
```sh
|
|
||||||
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 365
|
|
||||||
```
|
|
||||||
|
|
||||||
#### non-interactive and 10 years expiration
|
|
||||||
```sh
|
|
||||||
openssl req -x509 -newkey rsa:4096 -keyout key.pem -out cert.pem -sha256 -days 3650 -nodes -subj '/C=XX/ST=StateName/L=CityName/O=CompanyName/OU=CompanySectionName/CN=CommonNameOrHostname'
|
|
||||||
```
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user