grief's spellbook

manual for analog artists using debian linux

v2.3 for Debian Bookworm



This is a living document, it's updated almost daily, and it may have incomplete sections. Help us make it better, drop by Atlantic Mills after 2PM on any Saturday, we're in the left tower on the top floor. Connect with us at cancelled.work.


CHAPTERS


QUICK TIPS
  1. MEDIA

  2. FILESYSTEMS

  3. RENAME

  4. DISKS

  5. USEFUL PROGRAMS


SERVER SETUP
  1. INSTALL

  2. ZFS & RAID-Z

  3. FILE TRANSFER

  4. WEBSERVER

  5. JELLYFIN

  6. CUSTOMIZATION

  7. BASIC MAINTENANCE

  8. ADVANCED MAINTENANCE

  9. BUGS


PROJECTS
  1. GRIEFCAM

  2. TAPE PHOTOS

  3. HTML

  4. HARDWARE

  5. SOFTWARE



QUICK TIPS


MEDIA


Import MiniDV Footage from a Camera over FireWire/1394

--autosplit create seperate files when blank frames are detected, --timecode append timecode to filenames, --size 0 unlimited file size, --rewind rewind before recording, -f raw no compression or conversion, --show-status show progress, and output- prefix that will be added to each filename.

dvgrab --autosplit --timecode --size 0 --rewind -f raw --showstatus output-


Use ffmpeg with Nvidia Hardware Acceleration

This requires that you have an Nvidia graphics card with the Nvidia driver installed. Check with sudo lspci -vvv | grep 'nvidia'.

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.dv -c:v h264_nvenc -preset slow -crf 0 output.mkv

Requires downloading the nnedi3.bin file from GitHub and placing it in the same folder the input file is in.

ffmpeg -hwaccel cuda -hwaccel_output_format cuda -i input.dv -map 0:0 -map 0:1 -vf "nnedi=weights=nnedi3_weights.bin" -c:v h264_nvenc -preset slow -crf 0 -c:a aac -b:a 256k output.mkv


Split an Image to Print Large Art

This process takes an image and splits it into Letter paper sized pieces, for printing large physical art to be put together with wheatpaste.

sudo apt install imagemagick
sudo apt install pdfposter

Both commands are set up to be run at the same time; the output of convert and input of pdfposter are both pdf1.pdf. Change the output size by changing -p3x3Let to whatever amount of paper you want; to print 9 pieces of paper wide by 3 pieces of paper tall, type -p9x3Let.

convert image.png -auto-orient pdf1.pdf
pdfposter -p3x3Let pdf1.pdf pdf2.pdf


Add English Subtitles to a Movie

ffmpeg -i input.mp4 -i subtitles.srt -c copy -c:s mov_text -metadata:s:s:0 language=eng output.mp4
ffmpeg -i input.mp4 -itsoffset -0.7 -i input.mp4 -map 0:v -map 0:a -map 1:s -c copy output.mp4


Convert Video to GIF

-ss fast seek to x seconds, -t read x seconds from seek point then stop, -i input file, -f gif output format. .0 is required in -t time argument.

ffmpeg -ss 180.0 -t 5.0 -i arrimotor.dv -f gif arrimotor.gif

Add -vf "transpose=2" to flip the video.

ffmpeg -ss 181.0 -t 4.0 -i arrimotor.dv -f gif -vf "transpose=2" arrimotor.gif


Convert All Music Files in a Folder

for i in *.flac; do ffmpeg -i "$i" "${i%.*}.mp3"; done


FILESYSTEMS

Return to Top


Sync Files From a Remote Folder to Your Computer

-r Sync folders, -P show progress.

rsync -r -P grief@grief.im:/home/grief/art/music/ /home/william/Music/


Remote Sync Advanced

-r sync folders, -P show progress, --ignore-existing ignore existing files, --delete-after delete files from the destination folder that aren't present in source folder, after all files are transferred; good for cleaning up backups.

/ at end of source directory is necessary to be recursive, meaning that the contents will be transferred, instead of the folder itself being placed at the destination.

Replace --ignore-existing and -r with -a to thoroughly sync files, such as changed metadata and text file content.

rsync -r -P --ignore-existing --delete-after grief@grief.im:/home/grief/art/music/ /home/william/Music/


Unzip a File

Replace file with the name of your packaged file.

unzip file.zip


Search for a File

showdown example search, replace with the name of anything you're looking for.

locate showdown


Symlink a Directory/Folder, Creating a Shortcut

You have to create the directory with this command, do not create the directory beforehand. Make sure the directory does not already exist.

File path must be absolute, not ~/ for /home/grief.

ln -s /home/grief/spellbook/spellbook.md /home/grief/redeel.org/spellbook


Mount a CD or .iso File as a Directory

sudo mkdir /media/xp
sudo mount -o loop -t 9660 windowsxp.iso /media/xp


Mount Remote Directory to Behave as Local

sudo apt install sshfs
sudo mkdir /mnt/griefbox
sshfs sprite482@192.168.1.44:/home/grief/ /mnt/griefbox

Made for wief, my home music playing laptop, using read only sprite482 login, /home/wief/.ssh/id_rsa is the name of the identity file, which is also it's own folder in ~/.ssh.

Suggested to remove reconnect to prevent filesystem crashes when connection is lost, best when not using Ethernet.

sudo nano /etc/fstab
sprite482@192.168.1.44:/home/grief/ /mnt/griefbox fuse.sshfs x-systemd.automount,allow_other,default_permissions,noauto,_netdev,IdentityFile=/home/wief/.ssh/id_rsa,reconnect,ServerAliveInterval=15,ServerAliveCountMax=3 0 0
sudo fusermount3 -u /mnt/griefbox


Change Owner and/or Group.

-R selects directories and their contents, william: is owner, :william is group.

sudo chown -R william:william /home/william/music


Make a Filesystem

ext4 is the filesystem type, can also be exfat and others, -L puts a label, /dev/sdx is disk name.

sudo mkfs.ext4 -L labelname /dev/sdx


RENAME

Return to Top


rename allows you to edit batches of files to have cleaner looking filenames. Always start by ensuring that you cd changed directories to the folder you want to edit files in, check with ls. Be careful, there is no undo feature.

The -n flag means the command will have no effect. You must remove -n for the command to actually rename files, but always run rename with the -n flag one time before running it again without. This allows you to check that you're getting the changes you want. Once again, there is no undo!

When you've confirmed that you entered the command correctly, replace -n with -v to show the results.

The first section s/ / of the command is the search section, this is what you want to replace. The second section / /g is what you want to replace the first section with. If you want to include special charectars like a . period, - hyphen, or [ bracket, you must put the  backslash before it to allow rename to recognize it. The command will fail if you don't. The at the end tells rename to apply the command to all files. If you only wanted the command to affect photo files you could replace it with.jpg.


Rename Media Filenames

This is a multi-step example. Below the apt commands is the input filename, and after step 4 is the final result.

sudo apt update
sudo apt install rename

Adventure.Time.S02E06.Butt.mkv

  1. Remove periods and replace with spaces.
rename -n 's/\./ /g' *

Adventure Time S02E06 Butt mkv

  1. Fix file type, replacing mkv with .mkv.
rename -n 's/ mkv/\.mkv/g' *

Adventure Time S02E06 Butt.mkv

  1. Remove the name of the show.
rename -n 's/Curb Your Enthusiasm //g' *

S02E06 Butt.mkv

  1. Insert - character at position 7.
rename -n 's/^(.{7})/$1- /g' *

S02E06 - Butt.mkv


Rename Delete at Certain Character

The periods in /-...../ can be increased of decreased to delete more or less charectars.

rename -n 's/-.....//' *.mkv


Rename Add to Beginning

rename -n 's/^(.{0})/$1S01E/g' *


Rename Delete First 10 Characters

Replace both 10's to adjust how many charectars are deleted.

rename -n 's/^(.{10})/$10/g' *


DISKS

Return to Top


Overwrite a Disk

a shows a quick option, and b shows a secure one.

  1. Wipe signature which identifies the filesystem.

a1. Show signatures on drive sdx.

sudo wipefs /dev/sdx

a2. Delete -a all signatures.

sudo wipefs -a /dev/sdx
  1. Overwrite all data on the disk with zeros.

/dev/zero write all zeros, drive sdx, 64K ideal block size, status=progress show progress.

dd if=/dev/zero of=/dev/sdx bs=64K status=progress


Rescue Data From a Failing Hard Drive

sudo apt install gddrescue

-d direct disk access, -f use a block device instead of a file, which is the default, -r is the number of times it should retry, sdx is the drive you need to rescue, sdy is the blank, healthy drive you're copying to.

rescue.logfile can't be stored on a live bootable Linux, so this was saved to a USB drive.

sudo ddrescue -d -f -r3 /dev/sdx /dev/sdy
/media/mint/gddlogfile/rescue.logfile


PROGRAMS

Return to Top


These are my essential utilities, utilities are another name for programs. apt allows you to install multiple programs at the same time, so I plan to use this list the next time I install Debian on a laptop. This could be useful for a computer that isn't always connected to the internet, because when I need an important utility I won't have to download it.

Do not use use this list to install all these programs on your server at once, randomly installing things is always bad practice, but your server needs to be stable. Install individual programs when you need them. A lot of these programs require a GUI (Desktop), which your server shouldn't have, so it probably won't work anyway.

figlet lolcat tree neofetch smartctl htop vim ffmpeg gddrescue dvgrab lshw dmidecode dmg2img vlc nicotine kid3-qt strawberry audacity kdenlive gimp ghostwriter steam remmina v4l-utils qv4l2

If you're installing any of these programs and apt says that the program was not found, make sure you ran sudo apt update. If that doesn't work check your /etc/apt/sources.list and make sure sure that each of the lines starting with deb has main contrib non-free non-free-firmware listed at the end, add them if not. Each of these are sources, they enable you to download a different set of programs.



SERVER

Return to Top


  1. Install Debian

I set up my first Debian server at the Purple Tower, and repeated this process when I bought my first real desktop server, an HP ProLiant ml310e, for griefbox2 on 03/06/24, which first hosted cancelled.work.

This guide assumes that you're installing Debian on an Intel/AMD 64-bit CPU. If you're not then remember that for later, some things like ZFS Raid-Z don't work on 32-bit CPU's, but it supposedly does on ARM (Raspberry Pi). You'll need to follow a different guide for things like ZFS.

debian.org can be difficult to navigate, look for the section with a Download button and click Other downloads. You'll probably need to find and click Download mirrors. Next, find the section for the stable release, then find the section for DVD/USB. Find and click amd64. Find and download the DVD-1.iso file.

On Windows, I searched for and downloaded BalenaEtcher, then flashed the amd64-DVD-1.iso file to a USB drive.

I've learned that selecting the network mirror option during the setup process usually fills out the /etc/network/interfaces file which allows you to receive an IP address from your Internet Service Provider, and the /etc/apt/sources.list file which allows you to download packages from the Debian repositories. If you don't plug in an Ethernet cable and select the network mirror option you're definitely going to have to fill out these two files manually. You also still might have to do it anyway lol.

Remember what you choose for a hostname, you'll need to look for this in your router's settings later in order to set up ssh and web hosting.

When you're setting your root password and first user's password, make sure to write it down on paper or in your phone, you're going to need both a lot.

The installer will ask you to select a drive, showing a name like Kingston or PNY and a size like 128GB or 512GB. There will probably be an option to select your USB drive which will be a smaller size, do not select your USB drive. Make sure you select the SSD that you are permanently leaving inside your server. If there is more than one SSD inside your server I recommend physically opening the side of your server and checking that the name matches your selection. Even better, turn off the server and remove any SSD that isn't going to be the boot drive.

A separate home directory is very important, this will allow you to mount your user files onto a RAID array later on. LVM allows you to resize your boot drive more easily.

Be careful on this page, you have to use the space bar to uncheck/check the boxes, not the ENTER key. If you accidentally hit ENTER you'll advance and start installing whatever was checked off. Hit the TAB key once you've made the following selections, and then hit the ENTER key.

At this point you need to have connected your server to a router or switch with an Ethernet cable. Do not proceed until you can do so. Please do not try to set up your server using Wi-Fi, it really defeats the purpose of a server.


  1. Log In and Test Important Services

The terminal should display login: after the server restarts and boots up for the first time.

Once you're logged in, let's go ahead and make sure that you can use ssh, sudo, apt, and download other programs.

Debian doesn't automatically link all your programs to the terminal, so programs other than apt and nano may not be accessible even if they're installed. You need to log out and log back in when you adjust your PATH.

PATH=$PATH:/sbin:/usr/sbin

You have to su switch user to root first. sudo stands for "superuser do". Superuser is the Linux term for administrator.

su

Enter your root password.

PATH=$PATH:/sbin:/usr/sbin

It's almost definitely not going to be installed because the installer asks you to enter a root password, which then defaults to not install sudo... for some reason.

su
apt install sudo

You may have encountered an error similar to Media change: please insert the disk labeled....

  1. Try changing your apt sources to use debian.org instead of a DVD.

It's possible to mount the Debian installation USB drive as a virtual disk and install sudo from there but this option doesn't make sense in the context of setting up a web server.

nano /etc/apt/sources.list

a1. Use the arrow keys to navigate to the line listing a DVD, it's probably the first and only line. Comment it out by placing a # in front of it.

Commenting out means to make a line of code unusable. Different coding languages have different methods of commenting out.

Your line might be slightly different depending on when you installed Debian. It may be a different number, or may not be called Bookworm.

#deb cdrom:[Debian GNU Linux 12.8.0 _Bookworm - Official amd64 DVD Binary-1 with firmware 20241109-11:05]/ bookworm main contrib non-free-firmware

a2. Use the arrow keys to move down to the bottom of the document. Hit the ENTER key twice to create two new lines, so there's space between the deb cdrom: line and the one you're on. Type in the following 3 lines.

If your release wasn't called bookworm above, replace bookworm in the next 3 lines with that name instead.

deb http://deb.debian.org/debian bookworm main contrib non-free non-free-firmware

deb http://deb.debian.org/debian-security/ bookworm-security main contrib non-free non-free-firmware

deb http://deb.debian.org/debian bookworm-updates main contrib non-free non-free-firmware

a3. Press the CTRL key and then letter O key to save. nano will ask you to confirm, hit the ENTER key. Press the CTRL key and then the X key to exit.

The keys used to navigate nano are listed at the bottom every time you use the program.

apt update
apt install sudo

You may have encountered the error E: Unable to locate package sudo.

  1. Try changing your network interface configuration. Start by getting info about the available network interfaces.

Look for devices with names starting with en, and eth and write them all down. Ignore devices starting with wl and lo.

-br brief, -c color, a address.

ip -br -c a

b1. Edit your network interfaces configuration.

nano /etc/network/interfaces

b2. Reference the en and eth device names you found with the ip command, and write out the following 2 lines. Replace both instances of eno1 with the first device on your list.

allow-hotplug eno1
iface eno1 inet dhcp

b3. If there's more device names on your list, move to the end of the line and hit ENTER twice to give yourself some space, and write the 2 lines again. Replace both instances of eno1 with the second device on your list. Repeat this process of writing out the paragraph and changing the name for each device on your list.

Be careful, it's really easy to type these device names in wrong. I spent 20 minutes looking for other problems and I was simply missing an 8 in the name of my USB Ethernet adapter.

b4. Restart networking.

systemctl restart networking

If it doesn't succeed go back through steps a and b and make sure you spelled all the addresses in the apt sources correctly, as well as the device names for /etc/network/interfaces.

apt update
apt install sudo

Replace grief with the name of the user you created during setup. -a append, G group, sudo the name of the group you've selected, grief the name of the user you're adding to the group you selected.

Make sure you are stil logged in as root, and that you set your PATH and logged out and in again. If you didn't, run the command PATH=$PATH:/sbin:/usr/sbin, then logout with CTRL D and log back into root with su.

usermod -aG sudo grief
sudo apt update

ssh allows you to remotely control your server from another computer. It's available by default on MacOS, most Linux distributions, and usually on Windows.

If you're not connected to your router and the Internet you won't be able to do this.

Your internal IP address most likely starts with 192.168. Mine is 192.168.1.44

hostname -I
sudo nano /etc/ssh/sshd_config

Search for the line that starts with #PermitRootLogin and remove the #, then add yes.

PermitRootLogin yes

On MacOS, search for and open Terminal.

On Linux, search for terminal. In the KDE desktop for Debian, the terminal is called Konsole.

On Windows, search for open Command Prompt.

Change grief to the name of your primary user. Change 192.168.1.44 to the internal IP address you retrieved with the hostname -I command earlier.

ssh grief@192.168.1.44

If you've entered your password correctly you should now be logged into your server. It should the same as if you were using a mouse and keyboard directly connected to the server.

I recommend using ssh to connect to your server moving forward, but this is especially important when installing ZFS later on. It's a lot easier to be able to copy and paste information into the terminal, than to be restricted to manually typing everything out.


  1. Test Your Hard Drives

Unfortunately this is going to take a long time, 4TB hard drives can take more than 14 hours to test. You should start these tests and pause the setup process to let these run overnight.

If your server has a built-in RAID controller, turn it off completely in your BIOS or UEFI settings. Do not set it to RAID 0.

According to the ZFS manual, using a RAID controller to set each drive as RAID 0, in an attempt to create a passthrough, is bad practice. People have had issues with controllers incorrectly passing information to the operating system.

smartctl allows you to monitor the health of your hard drives, SSD's, and NVMe.

sudo apt update
sudo apt install smartmontools

ls list, blk block devices, another name for drives.

lsblk

Change sda to match each of your connected hard drives. For example, if you're planning to create a raidz2 array you should have connected 4 hard drives. So your system will have at least 5 block devices listed. /dev/sda will most likely be your SSD boot drive, and /dev/sdb will be one of your hard drives. Use the information from lsblk to get the names of the other drives.

If you're not using ssh yet, run sudo smartctl -a /dev/sda | less because smartctl will probably return a lot of data.

less allows you to scroll through information when programs return more than fits on the screen.

sudo smartctl -a /dev/sda

smartctl will return a lot of data about your hard drives, and the amount depends on which brand of hard drive you're using.

The health indicator that I think is best is reallocated sectors. Look for this section each time that you run the smartctl command for each hard drive. Having 0 reallocated sectors is best, but if there's a few it's probably okay. Still, understand that the drive is starting to fail. Unfortunately this is an outcome of buying used hard drives on eBay.

If there's more than 10 reallocated sectors maybe look for a different hard drive.

If your hard drive doesn't have a reallocated sectors section then look for a section that talks about corrected errors and uncorrected errors. If there's a ton of corrected errors that's not great, but it's probably fine. If there's more than a few uncorrected errors the drive is probably bad.

This requires shutting your computer off first. It's easy to accidentally start unplugging and plugging things in when the side of your computer case is off, but doing this will probably make your computer crash.

Remember that restarting your computer may reassign different names to each hard drive, so what was previously /dev/sda might now be /dev/sdb You may need to check the health of every drive again.

Replace sda with the name of each of your hard drives. -t test, long long test, there's also a short option, but that's not appropriate for this situation.

You probably don't need to test your SSD boot drive, but you should at least check to see if it has any reallocated sectors. It's a bit safer for SSD's to have reallocated sectors, although it's still not best practice. I think the SSD of griefbox2 has 23 reallocated sectors, lol.

Reminder that testing is probably going to take a very long time. Take a break and let these run overnight.

sudo smartctl -t long /dev/sda

Once again, check the information on each hard drive for reallocated sectors and uncorrected errors.

sudo smartctl -a /dev/sda

Once you're certain that all of the hard drives you plan to use are seemingly good, move on to creating your RAID-Z array.


ZFS AND RAID-Z

Return to Top


  1. Create a RAID Array

At this point, I strongly recommend using ssh in a terminal from another computer, if you're not already doing so. It's going to be really annoying to manually type in long disk identification numbers soon. If you forgot how to use ssh scroll back up to the end of the First Login section.

ZFS is more efficient than traditional RAID, allowing you to use more space on your hard drives. Additionally, there is automatic corruption detection and correction.

sudo apt update
sudo apt install linux-headers-amd64
sudo apt install -t stable-backports zfsutils-linux

If you receive the notice "E: The value 'stable-backports' is invalid..." then add stable-backports to your /etc/apt/sources.list, this command does it quickly.

codename=$(lsb_release -cs);echo "deb http://deb.debian.org/debian $codename-backports main contrib non-free"|sudo tee -a /etc/apt/sources.list && sudo apt update

If you needed to run the command above, run the first set of commands again.

sudo apt install linux-headers-amd64
sudo apt install -t stable-backports zfsutils-linux
zfs --version

Remember the sdx type names of each of your hard drives, not including your SSD boot drive. Write them down.

lsblk

Check your notes about the sdx names of each of your hard drives, you need this to get further information.

Search the output of this command, looking at the end of each line. For example, the UUID for drive sdd might read scsi-35000c5008599d24b -> ../../sdd or ata-35000c5008599d24b -> ../../sdd.

Extract the scsi- or ata- portion, before the ->, such as scsi-35000c5008599d24b, this is the UUID. If you're using ssh from another computer, you can simply copy and paste these into a text file for later.

Have fun typing in the UUID's manually if you chose not to use ssh from another computer!

ls -l /dev/disk/by-id

I've listed 3 options below, the first is what I recommend. There's more options you can learn about on your own.

You can use raidz-calculator.com to figure out your storage capacity based on the number and size of your hard drives. Remember that 1TB is 1000GB.

  1. Create a raidz2 zpool with 4 hard drives.

Replace the 4 scsi- names with the UUID's of your hard drives.

g2-1 the name of the array, you can choose any name. raidz2 the type of raid, an array that allows you to lose 2 disks before losing any data.

zpool create g2-1 raidz2 scsi-35000c5008599x24x scsi-35000x5008664ff7x scsi-35000ccx2697ax7f4 scsi-35000xca269x6cf14
  1. Create a mirrored zpool with two drives.

g2-mirror the name of the array, mirror the type of raid, an array where data matches on two disks.

It's small, fast, and allows you to lose 1 drive before losing data. I would not use this on my server, but I would consider it for a backup.

zpool create g2-mirror mirror scsi-35000xca2697ab7f4 scsi-35000xca269a6cf14
  1. Create a striped (raid-0) zpool with 3 hard drives.

g2-stripe the name of the array. There's no raidz argument, because leaving this out defaults to a striped array.

This stripes any number of disks together to create an array with no redundancy. It's fast and allows you to use 100% of all 3 devices, but extremely unsafe, if you lose any drive you lose all data.

zpool create g2-stripe scsi-35000x5008599d24b scsi-35000x5008664ff7f scsi-35000xca269a6cf14

This tells you if the zpool is online (healthy) or degraded (damaged). If it's degraded it will briefly explain what's wrong so you can try to fix it.

Each drive is also listed, and there's a section for numbers which shows whether errors were recently corrected. If you check this later and there's a large amount of errors being corrected there may be a problem, you should use smartctl to check the health of that drive and run a long smart test.

zpool status

Replace grief with the name of your first user. If you created any other users run this command with their name as well.

Do not su switch user to root. If you're using ssh you will be logged out after running killall.

If you've done some other activities before setting up ZFS this process may be harder. For example, if you moved some files into your home folder you need to move them out, they are going to become inaccessible once you unmount it.

The mount process is kind of destructive and I'm hoping to figure out a better way to do it. Specifically the process of making a new /home/user folder for your first user feels wrong, you shouldn't have to make a new one, it should just be moved over, or perhaps copied.

killall -u grief
umount /home

If your server refuses to allow you to unmount your home directory, you're going to need to use some tools to figure out why. I can get you started but you may have to do some web searching if this doesn't work.

Start by using lsof to see the names of processes that are using your /home directory.

lsof /home

Then use htop to view, search for, and kill those processes.

apt update
apt install htop
htop
umount /home

Change g2-1 to the name you chose when creating your zpool.

zfs set mountpoint=/home g2-1

Now that you mounted your zpool, you need to stop the original /home directory from mounting at boot by editing /etc/fstab.

Commenting out means to make a line of code unusable, in this case by putting a # before it. Different coding languages have different methods of commenting out.

nano /etc/fstab

On your server, griefbox2 will be replaced by the hostname you chose during setup. This may look different if you chose not to set up LVM.

#/dev/mapper/griefbox2--vg-home /home ext4 defaults 0 2

This attempts to mount everything listed in fstab, it should return blank if you did this correctly. If it returns an error, edit the /etc/fstab file again and make sure to # comment out the line which lists your previous /home directory, and save the file.

mount -a

Moving the mount point of your /home directory deleted the home folders of all your users. We need to recreate them.

Change grief to the name of your first user, and run the command again with the names of any other users you created.

mkhomedir_helper grief

Change grief to the name of your first user, and check for files such as .bashrc which is a configuration for the terminal shell.

ls -lah /home/grief
nano /etc/ssh/sshd_config

Search for the line that starts with PermitRootLogin and change yes to no.

PermitRootLogin no
sudo systemctl restart ssh


TRANSFER

Return to Top


  1. Transfer Files to Your Server

If you have an external hard drive, you can connect it and use rsync to transfer the files to your server. If your files are on another computer, wait until we set up ssh, and you can rsync them to the server.

If your server only has USB 2.0 ports, and you do have a computer with a USB 3.0 port and an Ethernet port or Ethernet adapter, consider waiting until we set up ssh. You can plug that external hard drive into the computer with USB 3.0 ports, and transfer your files over ssh. USB 3.0 ports are often labeled SS (SuperSpeed) and have a blue plastic tab inside, instead of black.

If you don't have any USB 3.0 ports, or another computer you can use, then you should use one of your server's USB 2.0 ports, and expect that it will take significantly longer to transfer.

sudo fdisk -l

This is kind of hard, and you may need to do some web searches if your drive has many partitions.

When you find the new drive, remember it's name, such as /dev/sdg. Look a few lines below this name for a line that says Device, underneath that there should be a partition that starts with a number like /dev/sdg1 or /dev/sdg2, or something else. You need to mount one of these.

Identify which partition you need by looking for the column called Size, you should be able to boot the partition that's largest. Also look for the column named Boot, exclude the partition with the ***** marked on it.

sudo fdisk -l

You can change transfer1 to anything.

sudo mkdir /mnt/transfer1

Change sdg1 to the partition you identified with the fdisk command. Change transfer1 if you changed it in the previous command.

If this doesn't work try doing some web searches or reach out to me for help. Are you trying to mount an internal hard drive that you took out of another computer?

sudo mount /dev/sdg1 /mnt/transfer1

Start using the TAB button to autocomplete and show what files are in each directory. You can hit TAB after typing /mnt/, and as you continue typing the terminal will autocomplete until there's only one option left. It's hard to explain, just try it.

Once again, change transfer1 if you changed the folder name when creating the directory. I'm not going to remind you again, start using the TAB button and ls to help you navigate.

  1. Quickly view files by listing the contents of the main folder.
ls /mnt/transfer1
  1. Change directories to the main folder, and explore.

From here you can cd change directories again as desired.

cd /mnt/transfer1

List files.

ls

Use the output of ls to identify more folders, then cd to them. Don't forget to use TAB while typing.

cd /mnt/transfer1/folder1/folder2

Go up one directory.

cd ..

Change folder1 to the name of the folder you want to transfer, change user to the name of the first user you created during setup.

Don't forget to use TAB and ls!

-r transfer folders, -P show progress.

rsync -rP /mnt/transfer1/folder1 /home/user/


WEBSERVER

Return to Top


  1. Configure Your Router

Change the settings on your router to direct ssh, apache2, and other web services to your server. This section specifically describes how to configure a Verizon router. The exact names of settings and submenus will be different on other brands of routers, but ultimately they all will all have access to static IP and port forwarding settings.

192.168.1.1
  1. Static IP

a1. Change view by clicking Advanced in the top left corner.

a2. Click Network Settings, click IPv4 Address Distribution, and click Connection List.

a3. Find your server using the Host Name column, this is going to be listed as the hostname you chose during setup. Click Edit in the right column, click the checkbox for Static Lease Type and change the last two digits of the IP Address so it reads 192 168 1 44.

You can make the last two digits of this IP address any number you want to, but I like using memorable angel numbers.

From this point on you need to use ssh with this IP address. You were probably using something else previously so log out now, and log in with the new address.

  1. Port Forwarding

b1. Click Security and Firewall, then click Port Forwarding.

b2. At the top, use the Create Rule section to forward ports 22 (SSH), 80 (HTTP), 443 (HTTPS), 8096 (Jellyfin HTTP), and 8920 (Jellyfin HTTPS) to the static IP address you just set for your server.

You will have to fill this out 5 separate times, clicking Add to List each time and waiting for the page to refresh the section.

b3. Each time, under Fwd to Address, click User Defined and enter the Static IP address you selected previously, I chose 192 168 1 44.

b4. The Original Port and Fwd to Port sections should have the same port number. Start by entering port number 22 for both the first time you fill out the Create Rule section.

b5. The Protocol should be Both, and the Schedule should be Always.

Repeat this process for ports 80, 443, 8096, and 8920.


  1. Create Your Website's Framework

To complete this step, you need to have purchased a domain name. Your server should be physically set up in the location where you plan to leave it permanently. You can adjust these settings later, but it could make your website inaccessible.

The cheapest domain names are available from namecheap.com, but I don't trust that website for long term use, the prices are weirdly low. I recommend buying a cheap $11 a year .work domain name from iwantmyname.com. I purchased grief.im from iwantmyname for $30 a year, then later cancelled that and bought two years of redeel.org from Namecheap for a discounted $15. I plan to transfer it to iwantmyname when the discount expires next year.

sudo apache2 -v

If not, install it.

sudo apt update
sudo apt install apache2

In the following steps, replace redeel.org with the domain name you purchased. Replace grief with the name of the user you want to control the website.

If you're making a small static website it's probably fine to create the folder in /var/www/, this will be somewhat faster because it will exist physically on your SSD boot drive. But for cancelled.work and redeel.org, which plan to have large amounts of video content, it makes more sense to place it inside a user's home directory, so it physically exists on the large RAID-Z array.

mkdir /home/grief/redeel.org
sudo nano /etc/apache2/sites-available/redeel.org.conf
<VirtualHost *:80>
ServerAdmin admin@redeel.org
ServerName redeel.org
DocumentRoot /home/grief/redeel.org
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
sudo a2dissite 000-default.conf
sudo a2ensite redeel.org.conf
sudo apache2ctl configtest
sudo systemctl restart apache2


  1. Enable HTTPS by Installing certbot

certbot.eff.org recommends installing certbot on apache2/Linux with snap.

sudo apt update
sudo apt install snapd
sudo snap install core
sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
sudo certbot --apache -d redeel.org
sudo certbot renew --dry-run
sudo systemctl status snap.certbot.renew.timer


  1. Set Up Dynamic DNS

These instructions will be different depending on which website you buy your domain name from.

Most homes don't have static public IP addresses, meaning that Verizon, Cox, or whoever you buy Internet from will eventually change your public IP address. This doesn't happen often, funbox.sh only had their IP address change 3 times over the past 7 years. Setting up Dynamic DNS is also good because if you move your server to a different location, it will automatically update the IP address.

  1. iwantmyname

a1. Use crontab to create a command that runs every 30 minutes.

-e edit, and store the the cronjob under -u user www-data

sudo crontab -e -u www-data

Change the email to the email you use to login to iwantmyname.com, and change Password to the password you use to login. In the URL, change cancelled.work to the domain name you bought from iwantmyname.

*/30 * * * * curl -u "willjconns@gmail.com:Password" "https://iwantmyname.com/basicauth/ddns?hostname=cancelled.work&myip="

a2. Verify by running the curl command in the command line.

It's successful if you get good and your public IP address as a response. Mine is currently 108.34.229.27, yours will be different.

curl -u "willjconns@gmail.com:Password" "https://iwantmyname.com/basicauth/ddns?hostname=cancelled.work&myip="
  1. Namecheap
sudo apt update
sudo apt install ddclient

b1. A command line GUI will open, enter the details it asks for then try -v verifying. If it responds with nothing, there's an error.

ddclient -v

b2. This didn't work for me, I had to get Dynamic DNS passwords from Namecheap and manually change formatting.

I logged in, went to the Dashboard, clicked Manage, went to the Advanced DNS tab, and turned on Dynamic DNS. I then copied the long numeric password to use in place of DNS-Password in ddclient.conf. I did this for each of the 3 domain names I currently own.

This is also an example of how to enter details for servers with multiple domain names. Don't forget to replace redeel.org and the other domain names with the names of the domains you own.

sudo nano /etc/ddclient.conf
# Configuration file for ddclient generated by debconf
#
# /etc/ddclient.conf

#daemon=300
#ssl=yes
use=web, web=dynamicdns.park-your-domain.com/getip
protocol=namecheap
server=dynamicdns.park-your-domain.com

#redeel.org
login=redeel.org
password=DNS-Password
@.redeel.org

#mysterious.skin
login=mysterious.skin
password=DNS-Password
@.mysterious.skin

#atlanticmills.org
login=atlanticmills.org
password=DNS-Password
@.atlanticmills.org


JELLYFIN

Return to Top


  1. Access Your Media with a Graphical User Interface

By this point you should have transferred some files to your server. You can install Jellyfin without any content on your server, but you'll need to come back and set it up later.

curl https://repo.jellyfin.org/install-debuntu.sh | sudo bash
sudo apt install jellyfin
sudo a2enmod proxy proxy_http proxy_balancer lbmethod_byrequests
sudo apache2ctl restart
sudo nano /etc/apache2/sites-available/redeel.org-le-ssl.conf

Add the following lines to the end of your configuration file, inside the VirtualHost block, meaning above the /VirtualHost and /IfModule lines.

# Jellyfin hosted on http(s)://redeel.org/jellyfin
<Location /jellyfin/socket>
ProxyPreserveHost On
ProxyPass "ws://127.0.0.1:8096/jellyfin/socket"
ProxyPassReverse "ws://127.0.0.1:8096/jellyfin/socket"
</Location>
<Location /jellyfin>
ProxyPass "http://127.0.0.1:8096/jellyfin"
ProxyPassReverse "http://127.0.0.1:8096/jellyfin"
</Location>
sudo apache2ctl restart
192.168.1.44:8096
sudo systemctl restart jellyfin
192.168.1.44:8096/jellyfin
redeel.org/jellyfin

When you click the + button to fill out the Folders section remember that you're typing in the location of a folder on your server, not the computer you're using ssh from. For example, on griefbox, my movies folder is /home/grief/movies.

Repeat this process to add multiple sections of content, like music, movies, and television shows.


CUSTOMIZATION

Return to Top


  1. Customize Your Server and Make It Easier to Manage


Create Login Banner for SSH and Terminal

sudo apt install figlet

tee copies the output of figlet to the /etc/motd location where the terminal retrieves the login banner.

figlet griefbox2 | sudo tee /etc/motd


Log In to a Computer Over ssh Without Entering the Password Each Time

ls -al ~/.ssh/id_*.pub

Generate a new one if the previous command returns nothing, or says that the file does not exist. It means you have no ssh keys.

ssh-keygen will ask you to pick a location to save the key, just hit enter to use the default location. It will ask you twice to create a password, I recommend also hitting enter . It will ask twice.

ssh-keygen

Replace grief with the name of a user on the computer you want to log into. Replace redeel.org with the domain name or IP address of the computer you want to log into.

ssh-copy-id grief@redeel.org


SSH Using Nicknames Instead of Usernames and IP Addresses

You can change griefbox to any name, this is a nickname not a server address. redeel.org is the server address, and you should change it to the domain name you're attempting to log in to. Replace grief with the name of a user on that server.

nano .ssh/config
Host griefbox
        hostname redeel.org
        user grief
ssh griefbox


Update apt to Use the Fastest Network Mirror

netselect-apt tests a bunch of network mirrors to find out which one has the fastest download speeds and lowest latency.

netselect-apt recommended I use http://debian.csail.mit.edu/debian which makes since because MIT is in Boston.

sudo apt update
sudo apt install netselect-apt
sudo netselect-apt
sudo nano /etc/apt/sources.list

Remember the URL that netselect-apt recommended. Replace the URL's in the lines with bookworm, bookworm-updates, and if you have it, bookworm-backports. You probably do if you installed ZFS. Do not change the url for bookworm-security.

If you have a newer version of Debian than bookworm, such as sid, testing, or trixie, leave those names alone, do not change it to bookworm.

Like me, you probably have a bunch of sources starting with deb-src, I commented these out because I don't know how to use source repositiories.

deb http://debian.csail.mit.edu/debian/ bookworm main non-free non-free-firmware contrib
#deb-src http://deb.debian.org/debian bookworm main non-free non-free-firmware contrib

deb http://deb.debian.org/debian-security/ bookworm-security main non-free non-free-firmware contrib
#deb-src http://deb.debian.org/debian-security/ bookworm-security main non-free non-free-firmware contrib

deb http://debian.csail.mit.edu/debian/ bookworm-updates main non-free non-free-firmware contrib
#deb-src http://deb.debian.org/debian bookworm-updates main non-free non-free-firmware contrib

deb http://debian.csail.mit.edu/debian/ bookworm-backports main contrib non-free non-free-firmware


Upgrade to the Advanced File Editor neovim

Neovim runs best when using the latest version, and I don't know how to install programs from source files yet so I installed neovim on griefbox2 and my laptop using snap.

LazyVim recommends backing up your current config with mv ~/.config/nvim{,.bak}. I just uninstalled neovim for a fresh start.

sudo snap install --classic nvim
git clone https://github.com/LazyVim/starter ~/.config/nvim

The LazyVim guide recommends doing this but doesn't explain why.

rm -rf ~/.config/nvim/.git

I had to restart my latop to use neovim. I did not have to restart griefbox2.

nvim

LazyVim recommends watching this YouTube video.

:checkhealth


neovim Options


After the plugin menu opens, use the arrow keys to navigate down to the language section and find the lang.markdown line, press the x key on this line to activate it. Don't forget to exit to restart neovim.

:LazyExtras


Diagnostics tell you if something is wrong with your code, but sometimes it's wrong and it clutters the screen.

Disable diagnostics at start by editing the lua config.

sudo nvim ~/.config/nvim/lua/config/options.lua

Add to the bottom of the file.

~/.config/nvim/lua/config/options.lua


Close nvim after installing if it was open.

Doesn't work over ssh, needs solution.

sudo apt install xsel xclip


BASIC MAINTENANCE

Return to Top


Add More certbot Certificates

Main cert is cancelled.work, new cert is imaketypos.com.

certbot asks for verification after this command, I chose 1 for apache2

sudo certbot certonly --cert-name cancelled.work -d cancelled.work,imaketypos.com,atlanticmills.org



When manually adding a redirect, it's very important to include the / at the end of domain name, otherwise it fails to open all webpages.


User Management

-m make home directory.

useradd -m ren
sudo passwd ren

-s set shell, /bin/bash the type of shell, there are other options.

sudo usermod -s /bin/bash ren


Install Programs Offline with Debian DVD Files

Make multiple mount points if you're mounting multiple DVD's, don't forget to change the DVD number to match.

sudo mkdir /media/dvd2

To add multiple DVD's, copy and paste this line in your fstab and change the DVD number.

/home/homedv/Documents/repositories/debian-7.11.0-i386-DVD-2.iso  /media/dvd2 iso9660 loop 0 0
sudo mount -a
sudo nano /etc/apt/sources.list

You might need to change wheezy main contrib based on contents of the iso you're using, explore it using an GUI archive manager or the unzip command.

deb [trusted=yes] file:///media/dvd2 wheezy main contrib
sudo apt update
sudo apt-cache search nvidia


Secure Directory Permissions

For example to stop Femi from seeing my private files while logged into cancelled.work.

o others, meaning users that aren't the user that owns the folder. - remove, r read, w write, x execute, art name of directory.

sudo chmod o-rwx art


Limit How Much Storage Each User Has in ZFS

@peterfuller user peterfuller, =250G specify size 250GB, g2-1 name of RAID-Z array.

sudo zfs set userquota@peterfuller=250G g2-1

Check ZFS storage info.

sudo zfs userspace g2-1


Change Hostname

Change griefbox2 to your desired hostname.

sudo hostname griefbox2
sudo nano /etc/hosts
127.0.0.1 localhost
127.0.1.1 griefbox2


10G Fiber Ethernet Connection

Tried to use isc-dhcp-server to get griefbox2 to supply my laptop with an IP address but it was causing conflict with the Internet provided by the Verizon Router. I ended up just editing the network interface config to have a static IP on both ends of the fiber connection.

Laptop connection in IPv4 tab of KDE network GUI: Address 10.1.1.77, Netmask 255.0.0.0, and Gateway 0.0.0.0.

/etc/network/interfaces on griefbox2:

#port 1 lc infiniband mellanox
allow-hotplug ens3
iface ens3 inet static
        address 10.1.1.44


ADVANCED MAINTENANCE

Return to Top


Resize your LVM root or /home Directory

Check by running sudo lvdisplay, or cat /etc/fstab and check to see if your computer has a line similar to /dev/mapper/griefbox2--vg-root.

Change william to the name of a user on your server. Repeat the command for each user on the server.

killall -u william
umount /home
lvdisplay -m
e2fsck -f /dev/debwill-vg/home

-r resize filesystem, -L size of reduction, -30G 30 gigabytes.

lvreduce -r -L -30G /dev/debwill-vg/home
mount /home
e2fsck -f /dev/debwill-vg/home
vgdisplay debwill-vg
lvextend -r -l +100%FREE /dev/debwill-vg/root


Create Traditional Linux RAID Array with mdadm

lsblk
sudo apt install mdadm
sudo mdadm --create --verbose /dev/md0 --level=1 --raid-devices=2 /dev/sd[b-c]
sudo mkfs.ext4 /dev/md0

Replace grief with the name of a user on your server. Repeat the command for each user.

killall -u grief
umount /home
sudo mount /dev/md0 /home
sudo mdadm --detail --scan | sudo tee -a /etc/mdadm/mdadm.conf
sudo update-initramfs -u
echo '/dev/md0 /home ext4 defaults,nofail,discard 0 0' | sudo tee -a /etc/fstab
sudo mkhomedir_helper grief
  1. Transfer mdadm Between Computers

a1. Get /dev/mdx array info from mdadm config.

Write down the line starting with ARRAY mine looked like ARRAY /dev/md1 metadata=1.2 name=grief:1 UUID=bdc03515:6a8e9fe8:0934442e:94c53549.

cat /etc/mdadm/mdadm.conf

a2. Shut down the computer and physically move all array drives to the new computer.

On griefbox1 this involved simply moving the SAS to SATA splitter from the port on the LSI HBA PCIe card in griefbox1 to the second port on the HBA in griefbox2.

a3. Add the /dev/mdx line from the old server to the new server's mdadm config.

sudo nano /etc/mdadm/mdadm.conf
`ARRAY /dev/md1 metadata=1.2 name=grief:1 UUID=bdc03515:6a8e9fe8:0934442e:94c53549`

a4. Run through previous steps again to permanently save mdadm array, update initramfs, and edit fstab.


BUGS

Return to Top


A Log of How I Fixed Random Errors and Issues


ZFS Drives Faulted, Label Missing Warning (12-04-24)

So first I panicked because I used "zpool status" to check health randomly and it said FAULTED on two drives, but then I looked more closely and it also said LABELS MISSING further up so I started web searching that.

This Proxmox Forum post and other responses suggested simply exporting and importing the RAID-Z array, but specifying to import via UUID. I don't know why this couldn't be automatically done, but ok.

Drives faulted and pool degraded because /dev/sda was reassigned as /dev/sdb, need to export zpool and reimport using UUID.

zpool export g2-1

Failed becuase zpool was busy.

killall -u grief
killall -u ren
killall -u peterfuller
killall -u bignazo
killall -u sprite482
zfs unmount /home
zpool export -f g2-1

Still failed, opened htop in new tab, and ran lsof to get more info.

lsof | grep g2-1

Saw user 999 and command "mongod --bind-ip-all" was being used, tried killing and nothing happened, so I started killing other processes.

sudo systemctl stop snapd
sudo systemctl stop mariadb
sudo systemctl stop docker

Ran lsof and it revealed that mongod went away so I tried exporting again.

zpool export g2-1

It worked, ran import but by UUID instead of /dev/sdx label.

zpool import -d /dev/disk/by-id/ g2-1

zpool status revealed the RAID-Z array was not degraded, and automatically resilvering.


Issue with IPv6 (02-07-24)

Couldn't SSH or SFTP out of Grove Street without specifying service to use IPv4.

Enzo used the -vv option with ssh to see what was happening, and saw that it was trying to connect to an IPv6 address.

The probable issue was that iwantmyname (domain provider) had stored a AAAA (IPv6) record from the Purple Tower, and since Grove Street didn't have a public IPv6 address the automatic crontab (for Dynamic DNS) was not replacing the AAAA record, and so it's likely that services were trying to access the nameserver and getting stuck there.

Enzo also recommended setting my server's nameserver to iwantmyname's, which isn't by default because it could be slower based on location and proliferation time.


PAM/apt Install Error (03-01-24)

File /var/lib/pam/seen was missing.

sudo mkdir /var/lib/pam
touch /var/lib/pam/seen

Ran pamauthupdate and it succeeded, /var/lib/seen had contents like it was supposed to.


fail2ban Issue

Installed but giving error 'allowipv6' not defined in 'Definition'. Using default one" even after updating /etc/fail2ban/jail.d/defaults-debian.conf.

Had to edit /etc/fail2ban/jail.conf and change backend line to backend = systemd.

I read about configuration but didn't change anything, it suggests copying .conf to .locals and editing those, which seem to override the original.


Jellyfin Not Playing

Error reading "This client isn't compatible with the media and the server isn't sending a compatible media format."

It was literally just that I renamed the folders in Music to lowercase "global" versus "Global".

I solved this by going to the Dashboard, and then scrolling down to view recent logs, jellyfin1234.log. I tried to play a song by A.G. Cook and then it appeared in the log saying "could not find file...".


Music Player Laptop SSHFS Issue LMDE

wief had to edit and uncomment 'user_allow_other' in /etc/fuse.conf because login wasn't working. Also had to uncomment sshfs, reboot, then rm -R /mnt/griefbox, change /mnt ownership to wief, then mkdir /mnt/griefbox, I removed noauto from the SSHFS line in fstab, tried creating fuse group then adding wief.


GNOME Desktop Won't Uninstall

Used tasksel to remove all desktop environments, such as GNOME, and install ones such as KDE.

sudo tasksel

Removed GNOME programs before installing a new desktop.

sudo apt purge gnome*


HP Elitebook Nvidia Legacy 340 Driver Setup

Used Debian netboot mini.iso, clicked advanced settings, then Debian sid unstable.

Don't forget to manually add sudo user.

When rebooted it didn't work the first time, needed to install headers before driver.

sudo apt install linux-headers-amd64
sudo apt install nvidia-legacy-340xx-driver


griefbox1 Domain Name Setup (03-08-24)

Set up Dynamic DNS hosting with iwantmyname, running their curl command, and setting up cron to run the command every 30 minutes.

Verified with dig -t A newrecord.grief.im @ns1.iwantmyname.net, but no a record is being shown.

This was probably because enzo's network wasn't directing the public IP to my server. Need to be at home to properly configure iwantmyname, as it points to the router but then isn't accessible because funbox.sh is using the port. Also it's not even sending an IPv4 address. It's sending an IPv6 which doesn't show in the a record when verified with dig.



PROJECTS

Return to Top


GRIEFCAM


griefcam 2

Downloaded main software and drivers from GeoVision website, stored in tools folder on griefbox. Manually installed drivers on channels A and B for audio, 4 installations total.

Started GeoVision software, created username, password, and set to auto login. Turned off signal lost beeping.

Downloaded AverMedia driver from company website, stored it in tools folder on griefbox, installed driver manually.

Used Windows Media Center to setup TV tuner, click no on any services that will need Internet. Select Live TV and go the channel you need, in this case Purple Tower physical channel 9.

Turned off system restore/snapshots, disabled pagefile, moved kernel dump to another drive, disabled hibernation, defragmented internal drives using Windows defragment tool.

Used Piriform Defraggler to defragment again. Use Ultradefrag non-portable, enabled boot time scan, restarted and ran at next boot. Turned hidden files on, and physically deleted pagefile.sys.

Ran Defraggler two more times, fsutil deleted usn journal in Powershell because Command Prompt didn't work. Shrank OS using Windows partition tool.

Used EaseUS partition manager to resize to 100gb. Turned on pagefile after copying OS to new drive.

Tried to run 'fsutil usn createjournal m=0 a=0 in C:' drive and it failed because I probably shouldn't have shrunk it beyond 140gb. I'm trying to dd the drive to a 128gb then factory reset it using the Dell system restore tool.


griefcam

sudo apt install apache2 mariadb-server
sudo su
mariadb
CREATE DATABASE zm;
CREATE USER zmuser@localhost IDENTIFIED BY 'zmpass';
GRANT ALL ON zm.* TO zmuser@localhost;
FLUSH PRIVILEGES;
exit;
exit
sudo apt install zoneminder
mariadb -u zmuser -p zm < /usr/share/zoneminder/db/zm_create.sql
sudo chgrp -c www-data /etc/zm/zm.conf
sudo a2enconf zoneminder
sudo a2enmod cgi
sudo systemctl reload apache2.service
sudo systemctl restart zoneminder.service
sudo systemctl status zoneminder.service
sudo systemctl enable zoneminder.service

White MacBook Pro, laptop charger, Sabrent switchable 4 USB hub, blue Hue HD camera, Enzo's silver bullet camera, black egg-shaped Creative camera, and silver Logitech ball camera.


TAPE PHOTOS

Return to Top


Capture Frames of MiniDV Tape Using Scene Detection

0.1 is good for photos, 0.04-0.07 captures more frames of videos mixed in with photos, and 0.01 captures a very large number of video frames.

-i input, -vf video filter, select frames greater than scene filter with sensitivity from 0 to 1, -vsync vfr the output file will have the same timestamps as the input video track, ./ file name according to frame number, set by three digits, .bmp for no compression.

ffmpeg -i input.dv -vf select='gt(scene\,0.04)' -vsync vfr ./frame%03d.bmp

Cut to specific start time by adding -ss argument.

-ss 00:01:00


Capture the First Frame

I actually don't know what -f force image input/output format is doing here.

ffmpeg -i input.avi -vframes 1 -f image2 output.bmp


Record Digital Files to MiniDV Tape

Convert from MP4 to raw DV. Still needs argument to convert audio, this only removes it.

ffmpeg -i input.mp4 -s 720x480 -pix_fmt yuv411p -r 30000/1001 -c:a copy -c:v dvvideo -an output.avi


HTML

Return to Top


HTML Comment Section on cancelled.work

curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
sudo apt install php php-mbstring php-zip php-gd
wget https://files.phpmyadmin.net/phpMyAdmin/5.2.1/phpMyAdmin-5.2.1-all-languages.tar.gz
tar xvf phpMyAdmin-5.2.1-all-languages.tar.gz
sudo mv phpMyAdmin-5.2.1-all-languages/ /usr/share/phpmyadmin
GRANT SELECT, INSERT, UPDATE, DELETE ON phpmyadmin.* TO 'pma'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON *.* TO 'user'@'localhost' IDENTIFIED BY 'password' WITH GRANT OPTION;

I went to mydomain.com/phpmyadmin, it said I was missing mysqli.

sudo apt install php-mysqli
sudo systemctl restart mariadb
sudo systemctl restart apache2

Followed Dani Krossing tutorial.

CREATE TABLE comments (
 cid int(11) not null AUTO_INCREMENT PRIMARY KEY,
    uid varchar(128) not null,
    date datetime(128) not null,
    message text(128) not null
);


Create Group Ownership of Website Directory

sudo groupadd guild
sudo chgrp -R guild /home/grief/redeel.org
sudo chmod -R g+s /home/grief/redeel.org
sudo chmod -R g+w /home/grief/redeel.org
sudo chown -R :guild /home/grief/redeel.org/
sudo usermod -aG guild femi


HARDWARE

Return to Top


Infiniband Firmware

Infiniband 40G Fiber PCIe card has different modes, the firmware needs to be changed from InfiniBand mode to Ethernet mode in order to function as a normal network interface card in Linux.

sudo apt install install rmda-core, libib-utils, ibverbs-utils, infiniband-diags
sudo apt install libibverbs1 librdmacm1 libibmad5 libibumad3 librdmacm1 ibverbs-providers rdmacm-utils infiniband-diags libfabric1 ibverbs-utils

When I first installed this I only installed rdma-core, ib-utils, and infiniband-diags. I could get info but link status would say INIT instead of ACTIVE. After installing opensm on griefbox it became active on both computers. Also, ibv_devinfo on debwill laptop changed from mlx4_0 to ibp116s0.

sudo apt install mstflint
lspci | grep Mellanox
sudo mstconfig -d 08:00.0 q

This worked on griefbox server, not through the StarTech Thunderbolt to PCIe dock, I took turns switching the modes by swapping the cards between dock/desktop and running mstconfigip.

sudo mstconfig -d 08:00.0 set LINK_TYPE_P2=2
sudo mstconfig -d 08:00.0 set LINK_TYPE_P1=2


Solarflare NIC on MacOS

Solarflare network interface card, inside Thunderbolt 2 PCIe Adapter, needs software adjustments to work in MacOS Monterey.

csrutil disable
csrutil authenticated-root disable

Can't remember if location should be ~ or /, cd to either to confirm.

sudo cp -R /Users/grieftv3/Desktop/SolarFlare10GbE.kext /Libary/Extensions


Use Discrete Nvidia Graphics Card

In the GUI Desktop, right click the program to edit Properties, then go to the Application tab.

__NV_PRIME_RENDER_OFFLOAD=1 __GLX_VENDOR_LIBRARY_NAME=nvidia


SOFTWARE

Return to Top


Brother Printer

unzip linux-brprinter-installer-*.*.*-*.gz
bash linux-brprinter-installer-2.2.3-1 HL-L2360DW


Rockbox Installation on iPod Photo


Activate Windows XP with umskt

unzip UMSKT-linux-x86-static.zip
sudo chmod +x umskt
sudo apt install openssl

If this option isn't available in the initial install, select the activate later option and search for telephone activation after rebooting and logging in.

./umskt -i id


Return to Top