Compare commits

..

10 Commits

9 changed files with 231 additions and 48 deletions

View File

@ -26,32 +26,44 @@ The chronology should never branch.
If `gitea` can use three different types of database, the documentation should simply pick one and continue instructions from there. If `gitea` can use three different types of database, the documentation should simply pick one and continue instructions from there.
Repetition works better than a reference - if a database requires three commands to set up, it's better to repeat those three commands for every program that requires a database than to just link to another file which discusses databases. Repetition works better than a reference - if a database requires three commands to set up, it's better to repeat those three commands for every program that requires a database than to just link to another file which discusses databases.
### Closing
Introductory documents should show anything required to cleanly uninstall a program, without leaving bulky configuration files behind.
## Three Input Types ## Three Input Types
There are three types of examples: There are three types of examples:
Fixed input: Fixed input:
> ls ```bash
ls
Arbitrary Input shows the non-fixed input in italics:
> ls *myFile.txt*
Output shows as unformatted text:
``` ```
LK img
Mail kn Anything with arbitrary input should be shown as a variable.
Projects music
```bash
ls $FILE
``` ```
Non-commands (e.g. output) should be shown as quoted text:
> LK img
> Mail kn
> Projects music
# Example # Example
``` ```
How to see which websites you're actively accessing: How to see which websites you're actively accessing:
> ss -tr dst :443 ` ` `bash
ss -tr dst :$PORT
` ` `
> State Recv-Q Send-Q Local Address:Port Peer Address:Port Process
> ESTAB 0 0 192.168.0.14:42476 149.154.167.91:https
> ESTAB 0 0 192.168.0.14:43644 104.17.90.199:https
``` ```
@ -76,5 +88,5 @@ This started as a few personal notes, and will probably continue to look like th
It's a bit of a mess. It's a bit of a mess.
Systemd is taken as a default. Systemd is taken as a default.
Non-systemd commands we relegate to their respective distros, e.g. runit for Void Linux. Non-systemd commands are mentioned when required for a distro, e.g. runit for Void Linux.

8
data/base_16.md Normal file
View File

@ -0,0 +1,8 @@
---
title: "Base 16"
tags: [ "Documentation", "Data" ]
---
```bash
printf "%x" $NUMBER
```

30
distros/void/jenkins.md Normal file
View File

@ -0,0 +1,30 @@
---
title: "jenkins"
tags: [ "void", "build" ]
---
# Jenkins on Void
Jenkins is janky.
## Start
Start the service file.
```bash
sudo ln -s /etc/sv/jenkins /var/service
sudo sv start jenkins
```
Then visit the web interface with `$BROWSER localhost:8080`.
If it's not working, try running the command from the run file the first time:
```bash
chpst -u jenkins java -jar /opt/jenkins/jenkins.war
```
## Updating
Jenkins will not work if out of date.
You will be prompted to update by downloading a `jenkins.war` file.
Download it, then stop the service, and move the file to `/opt/jenkins/jenkins.war`, then start the service again.

13
distros/void/void-background.sh Executable file
View File

@ -0,0 +1,13 @@
#!/bin/sh
# get the void linux logo from wikipedia
wget https://upload.wikimedia.org/wikipedia/commons/thumb/0/02/Void_Linux_logo.svg/256px-Void_Linux_logo.svg.png?20170131170632
# rename it, and resize it (the standard size is too small for most wallpapers)
convert -resize 200% '256px-Void_Linux_logo.svg.png?20170131170632' void-logo.png
# download a pretty wallpaper
wget http://wallpapercave.com/wp/Wlm9Gv0.jpg
# put the void logo on all *jpg and *png images
for x in *.jpg
do
composite -compose multiply -gravity Center void-logo.png "$x" "$x"
done

44
networking/servers/dns.md Normal file
View File

@ -0,0 +1,44 @@
---
title: "dns"
tags: [ "networking", "host" ]
---
| Record | Type | Example |
|:-----------:|:--------------------|:---------------------------------------|
| A Record | IPv4 Address | "$domain".com |
| AAAA Record | IPv4 Address | "$domain".com |
| CNAME | Alternative Address | "$domain".rs, "$subdomain.$domain".com |
| NS | Nameserver | ns1.fastname.com |
| MX | Email server | "$domain".com |
| TXT | Literally anything,including ownership of a domain | |
| | | |
Query a host with the `host` command.
```bash
host $domain.$tld
```
```bash
host $domain.$tld 9.9.9.9
```
> dmz.rs has address 77.105.27.232
> dmz.rs mail is handled by 10 kralizec.dmz.rs.
> dmz.rs mail is handled by 20 splint.rs.
This shows the MX record has a secondary handler, called splint.rs.
You can also add a specific nameserver:
Request a specific record type (`CNAME`, `TXT`, et c.):
```bash
torsocks host -T -t $RECORD_TYPE $domain
```
## Troubleshooting
The `host` command uses UDP.
You can change to TCP by using `host -T`.

View File

@ -4,14 +4,7 @@ tags: [ "Documentation", "Networking", "Torrenting" ]
--- ---
# Torrench # Torrench
Torrench searches for torrents. Search for a torrent, e.g. 'sita sings the blues'.
It breaks a lot, so if it's not working, the problem is probably in the program.
Search for 'sita sings the blues' with:
```bash
torrench 'sita sings the blues'
```
Copy the magnet link. Copy the magnet link.
It looks like this: It looks like this:
@ -20,7 +13,7 @@ It looks like this:
But you only need this bit (up until the `&` character): But you only need this bit (up until the `&` character):
`magnet:?xt=urn:btih:05547db7c0c5fbbe50f00212ee43e9cec5b006fa` > magnet:?xt=urn:btih:05547db7c0c5fbbe50f00212ee43e9cec5b006fa
# Transmission # Transmission
@ -93,3 +86,53 @@ Next, find the torrent's number. You can use multiple numbers, separated with a
transmission-remote -t 3,5,8 --move /home/alice/music transmission-remote -t 3,5,8 --move /home/alice/music
``` ```
## Change Default Location
The `transmission` user has a home configuration file, like any other user, with all the transmission settings.
```bash
cd /var/lib/transmission/.config/transmission-daemon/
$EDITOR settings.json
```
Change the `download-dir` value to wherever you want the torrents to go.
# Creating Torrents
Transmission always needs the full path to every file, and the daemon will need permission to view the file.
When it doubt, just place the files in `transmission`'s home directory.
Create a torrent of file or directory `Memes` with:
```bash
sudo chown -R :transmission Memes
transmission-create $(pwd)/Memes
```
Add a tracker to the torrent, to make sure others can find you easily:
```bash
transmission-create --comment 'My Memes collection' -t 'udp://tracker.publicbt.com:80' -t 'udp://tracker.openbittorrent.com:80' --anonymize Memes
```
Without the `--anonymize` flag, the torrent file output will have a 'created by' and 'created date'.
## Open Trackers
- udp://tracker.opentrackr.org:1337/announce
- udp://opentracker.i2p.rocks:6969/announce
- https://opentracker.i2p.rocks:443/announce
- udp://tracker.openbittorrent.com:6969/announce
- http://tracker.openbittorrent.com:80/announce
- udp://9.rarbg.com:2810/announce
- udp://open.demonii.com:1337/announce
- udp://exodus.desync.com:6969/announce
- udp://tracker.moeking.me:6969/announce
- https://tracker.tamersunion.org:443/announce
- udp://tracker1.bt.moack.co.kr:80/announce
- udp://tracker.bitsearch.to:1337/announce
- udp://p4p.arenabg.com:1337/announce
- udp://explodie.org:6969/announce
- https://tracker.gbitt.info:443/announce
- http://tracker.gbitt.info:80/announce

27
new.sh Executable file
View File

@ -0,0 +1,27 @@
#!/bin/sh
echo Select a category
category="$(find . -type d -printf '%P\n' | fzy)"
[ ! -d "$category" ] && mkdir "$category"
echo Select a name
read name
filePath="$category/$(echo $name | sed 's/ /_/g').md"
tagsList="$(echo \"$category | sed 's#\/#", "#g')\""
[ -e "$filePath" ] && $EDITOR $filePath && exit 0
echo "---
title: \"$name\"
tags: [ $tagsList ]
---
" > "$filePath"
$EDITOR "$filePath"

View File

@ -8,22 +8,24 @@ tags: [ "documentation", "virtualization", "xen" ]
xe vm-list xe vm-list
``` ```
Start, stop, et c. all done with `xe`: Start, stop, et c. with `xe`:
```bash ```bash
xe vm-start vm=*TTS* xe vm-start vm=$TARGET_VM
``` ```
```bash ```bash
xe vm-shutdown vm=*Bob* xe vm-shutdown vm=$TARGET_VM
``` ```
Destruction requires the uuid. Destruction requires the uuid.
```bash ```bash
xe vm-destroy uuid=*243b1165-14aa-37f6-496f-44879d05b3f2* xe vm-destroy uuid=$TARGET_UUID
``` ```
Autocompletion works well with all of these commands.
# Shut Down VM # Shut Down VM
List VMs. List VMs.
@ -33,17 +35,17 @@ xe host-list
``` ```
```bash ```bash
xe vm-list resident-on=*<uuid_of_host>* xe vm-list resident-on=$HOST_UUID
``` ```
```bash ```bash
xe vm-shutdown uuid=*<UUID from step 3>* force=true xe vm-shutdown uuid=TARGET_VM force=true
``` ```
If this doesn't work, try: If this doesn't work, try:
```bash ```bash
xe vm-reset-powerstate uuid=*<UUID from step 3>* force=true xe vm-reset-powerstate uuid=TARGET_VM force=true
``` ```
Get the id: Get the id:
@ -55,16 +57,14 @@ list_domains
And destroy the domain: And destroy the domain:
```bash ```bash
/opt/xensource/debug/xenops destroy_domain -domid *<DOMID from step 7>* /opt/xensource/debug/xenops destroy_domain -domid $DOM_ID
``` ```
# Error: `Internal error:xenopsd internal error: Storage_interface.Illegal_transition` in XenServer # Problem Solving
## Symptoms or Error > Error: `Internal error:xenopsd internal error: Storage_interface.Illegal_transition` in XenServer
After a failed “Move VM”, “Copy VM”, or “Export VM” operation, the Virtual Machine (VM) being operated cannot start. Following is the error message displayed: After a failed “Move VM”, “Copy VM”, or “Export VM” operation, the Virtual Machine (VM) being operated cannot start.
`User-added image`
## Solution ## Solution
@ -85,32 +85,34 @@ This is the UUID of the Control Domain. The Control Domain is a privileged Virtu
Run the following command to obtain the UUID of the VBD (Virtual Block Device) object linking the Control Domain: Run the following command to obtain the UUID of the VBD (Virtual Block Device) object linking the Control Domain:
```bash ```bash
xe vbd-list vm-uuid=*<uuid of the Control Domain>* xe vbd-list vm-uuid=$CONTROL_DOMAIN_UUID
``` ```
Run the following commands to unplug and destroy the VBD: Run the following commands to unplug and destroy the VBD:
```bash ```bash
xe vbd-unplug uuid=*<uuid of the vbd>* xe vbd-unplug uuid=$VBD_UUID
``` ```
```bash ```bash
xe vbd-destroy uuid=*<uuid of the vbd>* xe vbd-destroy uuid=$VBD_UUID
``` ```
## Make a local iso repository # Make a local iso repository
```bash ```bash
xe sr-create name-label=LocalISO type=iso device-config:location=/var/opt/xen/ISO_Store device-config:legacy_mode=true content-type=iso xe sr-create name-label=LocalISO type=iso device-config:location=/var/opt/xen/ISO_Store device-config:legacy_mode=true content-type=iso
``` ```
This creates a UUID for the new directory: This creates a UUID for the new directory, e.g.:
`e94e25bb-bcdc-801b-b62a-b51b686a3bdc` > e94e25bb-bcdc-801b-b62a-b51b686a3bdc
# Import # Import
xe vm-import filename=*/mnt/blah.xva* ```bash
xe vm-import filename="$FILENAME".xva
```
# USB # USB
@ -151,11 +153,10 @@ xe sr-list
# Exporting and Exporting VMs # Exporting and Exporting VMs
```bash ```bash
xe vm-export vm=*<Name>* filename=*/full/path.xva* xe vm-export vm=$VM_NAME filename="$FULL_PATH".xva
``` ```
```bash ```bash
xe vm-import vm=*<Name>* filename=*/full/path.xva* xe vm-import vm=*<Name>* filename="$FULL_PATH".xva
``` ```

View File

@ -4,17 +4,22 @@ tags: [ "Documentation", "xe", "virtualization", "volume" ]
--- ---
# Make a local iso repository # Make a local iso repository
```bash ```bash
mkdir -p */var/opt/xen/ISO_Store* STORE_PATH=/var/opt/xen/ISO_Store
``` ```
```bash ```bash
xe sr-create name-label=*LocalISO* type=iso device-config:location=*/var/opt/xen/ISO_Store* device-config:legacy_mode=true content-type=iso mkdir -p $STORE_PATH
```
```bash
xe sr-create name-label="$STORAGE_NAME" type=iso device-config:location=$STORE_PATH device-config:legacy_mode=true content-type=iso
``` ```
This creates a UUID for the new directory: This creates a UUID for the new directory:
`e94e25bb-bcdc-801b-b62a-b51b686a3bdc` > e94e25bb-bcdc-801b-b62a-b51b686a3bdc
# Main Console # Main Console