Documentation

How do I do things?

Software & Applications

Software & Applications

Scanning with the DS-640 and NAPS2

Installing the Necessary Software

The latest version of Not Another PDF Scanner 2 can be downloaded from the NAPS 2 website: https://www.naps2.com/
The scanner driver for the DS-640 scanner can be downloaded from Brother's website:
https://support.brother.com/g/b/downloadtop.aspx?c=us&lang=en&prod=ds640_us_eu_as

Ensure your device is connected to the internet and plug in the DS-640 scanner. Windows will fetch basic drivers to allow the operating system to detect the scanner. The scanner will not function yet. Leave the scanner plugged in and run the NAPS 2 installer. THis should be pretty straight forward and simple, no additional configurations are required yet. When installing the driver from Brother you can uncheck everything except the primary driver software. The extra iPrint and scan is not required to use NAPS 2 (which is far superior to Brother's own software). This may take a few minutes to complete.

 

Configuring Not Another PDF Scanner 2

Once you have the software and drivers installed you need to configure NAPS 2 to use the scanner. Open NAPS 2 and click on the scan button. If this is the first time you have set up the scanner, you will be prompted to configure a new profile. Below is a quick run through of the basic settings needed to scan.

1. Click on the 'Choose device' button to choose the scanner you are going to use.
2. Click on your scanner and click OK. This will populate the 'Display name' field too.
3. Change the display name if you would like but unless you want multiple profiles for different paper sizes, qualities, or scanners, this isn't really necessary. If you are setting up a profile for photos or index cards, you could throw the size or type of the paper in the name to tell it apart from the default letter size.
4. If you will be scanning in a size other than the default US letter, change the size in the drop down under 'Page size'.
5. Select the resolution you would like to scan at. DPI stands for Dots Per Inch. The higher the DPI, the better the scanned document will look, but the file will also be larger and the scan will take longer. 600 or 800 DPI seems to be a good spot for this scanner.
6. If you would like to poke around any of the other settings, you can do so now. If you make a change you don't want you can either change it back or create a new profile and delete the old one.
7. Click on OK. If you haven't loaded the scanner you will get an error that 'No pages are in the feeder.' This is okay and you can simply close it. We will start scanning in the next section.

After you have configured the profile, click on the OCR button in the main window. OCR stands for Optical Character Recognition and is used to take pictures and scanned documents and turn the words within into searchable and copyable text. Select the language you would like to use and click on Download. This may take a few moments.

Once the OCR files download another window will pop up. Check the box to 'Make PDFs searchable using OCR' and then change the OCR mode to 'Best'. If you have a slower machine you may want to use 'Fast' but most modern machines should be able to handle best reasonably well. Leave the 'Automatically run OCR after scanning' box checked if you would like all the documents you scan to be analyzed (this is recommended, your data doesn't go anywhere, that's why it's slow-ish). Click OK.

Scanning with Not Another PDF Scanner 2

Once everything is set up you can feed the first page you would like to scan into the font. Move the slider in the front to the right, stopping at the desired paper size. This will help you keep the document centered on the scan head. The scanner should pull the page in a small amount and you can let go.

In the NAPS 2 software click on the blue Scan button on the top left. Your page should start moving and the bar should fill up once the scan completes. If you configured OCR (which you really should) you will see a little loading bar appear in the bottom right showing that OCR is running. You will also see your page appear in the window. If you have more pages to scan, feed the next page in now and click scan again.

Alternately if you know how many pages you will be scanning you can click on the drop down next to the scan button and select batch scan. Here you can select from several options, the easiest of which is likely the third. You set how many pages you want to scan, how long it should wait between scans, and you click on start. You can feed each page in after the scanner stops moving. Otherwise you may "jam" it and it will stop.

To save your scans simply click on the Save PDF button. This will save each page you currently have in NAPS 2 in the order shown. Choose where to save your PDF and hit enter. Tada! You're done! If you want to delete any pages, simply right click on them and click on delete. If you would like to save as an image instead, you can do that too with the Save Images button.

 

Troubleshooting

If the scanner turns off while it is plugged in, simply press the start/stop button to turn it back on.

To clean the glass the scanner uses you can open the scanner up like a laptop and then use a microfiber cloth to wipe the glass. Do not use any kind of solvents or liquid cleaner.

Software & Applications

Administering Factorio in AMP

Please note: Not every entry below will apply to your account. This guide serves to support both the end-user server manager and the AMP server administrator to ensure that everything necessary to rebuild/set up the servers is documented in one place. Anything that can only be done by the AMP server administrator will have the (administrator) suffix applied to the header.

Basic Factorio Server Management

To start or stop just the server, click on the green Manage Instance button in the Factorio Server Instance's card. On the instance Status page, click on Start, Restart, or Stop to perform the appropriate action on the Factorio server.

Changing Factorio Server Settings

Click on the Manage Instance button for the Factorio Server Instance that you would like configure the settings for and navigate to Configuration -> Factorio. The various settings are explained below. Changing any settings will require a restart of the server to take effect.

Changing Factorio Save Files

The save file in use can be changed by setting the "Save File" setting (as described above) to the name of the save file to use. Multiple save files can exist but only one can be loaded at a time. Changing this field to a name that does not exist will create a new save file with default settings the next time the server starts. If the save file exists, the server will load that save file when it starts.

You can configure the level generation settings prior to starting a new save by editing the configuration as detailed below in 'Configuring the Map Generation Settings'.

Alternatively you can generate the world yourself on your local Factorio game and upload the zip to the server to use. The zip should be uploaded to the saves folder in the File Manager and the Save File setting should be updated to reflect the name of the zip file to use.

Enabling or Disabling Factorio Space Age

Space Age can only be enabled or disabled via the mods\mod-list.json file in the File Manager while the server is stopped.

Note: Ensure you have not progressed in the save file yet. If you have and wish to restart, either delete the save file or set the save file setting to a new name

  1. Stop the Factorio server by managing the Factorio Server Instance and, on the Status page, clicking on Stop.
  2. Navigate to the File Manager on the left and open the mods directory.
  3. Click on the three dots to the right of the mod-list.json file and click on Edit.
  4. Change the following mod entries from "enabled": true to "enabled": false and click Save on the top right:
    1. elevated-rails
    2. quality
    3. space-age
  5. Start the server from the Status page when you're ready.

Configuring the Map Generation Settings

These settings are only read when a save file is first created.

//todo https://wiki.factorio.com/Map_generator

Managing In-Game Admins on the Factorio Server

The admin list can be edited while the server is running but will not take effect until the server is restarted.

  1. Navigate to the File Manager on the left.
  2. Click on the three dots to the right of the server-adminlist.json file and click on Edit.
  3. The list of admins must be in a valid json format (or more specifically, in an array):
    1. For no admins: [] will suffice..
    2. For one admin: ["yourname"] will ensure you are the only admin.
    3. For more than one admin: ["yourname", "yourfriendsname"] will ensure you are all admins. For more admins, ensure that the list is comma separated and that each name is in quotes.
  4. Click the save button in the top right when you're done.
  5. Re/Start the server from the Status page when you're ready to apply these changes..

Creating a Factorio Server Instance (administrator)

From the Instances tab of the AMP control panel, click on Create Instance. Select Factorio from the list, provide a friendly name, and click on Create instance. Once the instance starts, you can see the IP address the instance is listening on, and the port in the instance card. 0.0.0.0 means it is listening on any IP address on the server. If you want to be able to connect via domain name without specifying a port, save this port for later when creating the SRV DNS records.

Configuring DNS SRV Records for a Factorio Server

While typically done by the server administrator, the records don't require any actual configuration on the server so they can be set up by anyone that owns a domain.

Prerequisites:
- You must know the IP address and port of the Factorio server.

Log in to your DNS manager (may be different than your registrar) and create the following two records:

Now you can connect to your server by specifying yourfactorio.domain.com in the 'connect to address' dialog!

- https://wiki.factorio.com/Multiplayer#DNS_SRV_Records

Listing the Factorio Server in the Public Server Browser

Prerequisites: 
- You must have your username & password/token from https://www.factorio.com/profile

Listing the server publicly means that all of the players connecting must own the game via legitimate means. If you want to permit users that do not own the game to join, the server cannot be listed in the public server browser. In these cases you should configure DNS SRV records above to make joining more convenient.

  1. Log in to factorio.com, navigate to your profile, and copy your username and token.
  2. In the AMP portal, manage your Factorio instance and navigate to Configuration -> Factorio.
  3. If available to you, set the Factorio.com Username and Factorio.com Auth Token fields. If these options are not available, contact your server administrator to enable your access to these options or confirm that they have provided their own credentials.
  4. Ensure that Require User Verification is enabled.
  5. Ensure Make Server Visible Publicly is enabled.
  6. Restart the server if any changes were made.

The server should now show up in the public server browser! If not, review the output of the Console or the logs to determine why the server is not being listed (e.g. invalid credentials, missing field, etc.)

Managing Permissions on the Factorio Server (administrator)

Prerequisites:
- A role exists for the user(s) that will manage the Factorio instance.
- The user is assigned to the role.
- The Factorio instance must already be created.
- The role is given permission to the instance in Configuration -> Role Management -> <role name> -> All Instances -> Local Instances -> <Factorio instance>.

The default permissions for a user with "access" to an instance is limited to Start/Stop and Update. All other settings are hidden.

Navigate to the instance you want to grant permissions on and open Configuration -> Role Management. Select the role you want to grant permissions to and configure the following:

Note that this is not changing the settings of the server, only changing whether this role can view these settings to change themselves.

Infrastructure Systems

Infrastructure Systems

How To: Change the IP Address of a Proxmox Clustered Node

If changing entire subnet:

(e.g. 192.168.1.0/24 to 192.168.2.0/24)

# Stop the cluster services
systemctl stop pve-cluster
systemctl stop corosync

# Mount the filesystem locally
pmxcfs -l

# Edit the network interfaces file to have the new IP information
# Be sure to replace both the address and gateway
vi /etc/network/interfaces

# Replace any host entries with the new IP addresses
vi /etc/hosts

# Change the DNS server as necessary
vi /etc/resolv.conf

# Edit the corosync file and replace the old IPs with the new IPs for all hosts
# :%s/192\.168\.1\./192.168.2./g   <- vi command to replace all instances
# BE SURE TO INCREMENT THE config_version: x LINE BY ONE TO ENSURE THE CONFIG IS NOT OVERWRITTEN
vi /etc/pve/corosync.conf

# Edit the known hosts file to have the correct IPs
# :%s/192\.168\.1\./192.168.2./g   <- vi command to replace all instances
/etc/pve/priv/known_hosts

# If using ceph, edit the ceph configuration file to reflect the new network
# (thanks u/FortunatelyLethal)
# :%s/192\.168\.1\./192.168.2./g   <- vi command to replace all instances
vi /etc/ceph/ceph.conf

# If you want to be granular... fix the IP in /etc/issue
vi /etc/issue

# Verify there aren't any stragglers with the old IP hanging around
cd /etc
grep -R '192\.168\.1\.' *
cd /var
grep -R '192\.168\.1\.' *

# Reboot the system to cleanly restart all the networking and services
reboot

# Referenced pages:
# - https://forum.proxmox.com/threads/change-cluster-nodes-ip-addresses.33406/
# - https://pve.proxmox.com/wiki/Cluster_Manager#_remove_a_cluster_node

If changing only the IP:

(e.g. 192.168.1.10/24 to 192.168.1.20/24)

# Stop the cluster services
systemctl stop pve-cluster
systemctl stop corosync

# Mount the filesystem locally
pmxcfs -l

# Edit the network interfaces file to have the new IP information
vi /etc/network/interfaces

# Replace any host entries with the new IP addresses
vi /etc/hosts

# Edit the corosync file and replace the old IPs with the new IPs for any changed hosts
# BE SURE TO INCREMENT THE config_version: x LINE BY ONE TO ENSURE THE CONFIG IS NOT OVERWRITTEN
vi /etc/pve/corosync.conf

# Edit the known hosts file to have the new IP(s)
/etc/pve/priv/known_hosts

# If using ceph, edit the ceph configuration file to reflect the new network
# (thanks u/FortunatelyLethal)
# :%s/192\.168\.1\./192.168.2./g   <- vi command to replace all instances
vi /etc/ceph/ceph.conf

# If you want to be granular... fix the IP in /etc/issue
vi /etc/issue

# Verify there aren't any stragglers with the old IP hanging around
cd /etc
grep -R '192\.168\.1\.' *
cd /var
grep -R '192\.168\.1\.' *

# Reboot the system to cleanly restart all the networking and services
reboot

# Referenced pages:
# - https://forum.proxmox.com/threads/change-cluster-nodes-ip-addresses.33406/
# - https://pve.proxmox.com/wiki/Cluster_Manager#_remove_a_cluster_node
Infrastructure Systems

How To: Mount SMB Shares on a Pi

https://linuxize.com/post/how-to-mount-cifs-windows-share-on-linux/

tl;dr (assuming user/share is set up on freenas)

1. Install cifs-utils and create your mount directory

2. Create a credentials file /etc/win-credentials-app

3. Populate with username= and password= on two lines in plaintext (scary, I know)

4. Chown root: and chmod 600 to have a thin veil of security

5. One-off mount:
sudo mount -t cifs -o credentials=/etc/win-credentials-app,dirmode=0755,uid=1000,gid=1000 //freenas.lan/app /app
Replace win-credentials-app with your credentials file and 1000/1000 with your user's user/group IDs.

6. Auto-mount: (add to /etc/fstab)
//freenas.lan/app /app cifs credentials=/etc/win-credentials-app,file_mode=0755,uid=1000,gid=1000 0 0

7. Will mount automatically on boot. Use sudo mount /app or sudo umount /app to manually mount/unmount with an fstab entry.