Archive | Linux RSS feed for this section

Synology Tips

24 Dec

Docker
Prior to installing Docker, create a “docker” shared folder with data checksum disabled, as the Docker install will create a folder (if non-existent) with the checksum enabled, and this feature is not advised for virtual machines.

SABnzbd
Create a /downloads shared folder giving Read/Write access to Local Groups “users”, as this will allow the mapped docker volume to access the local volume:

Create the following folder structure.

/downloads/usenet/complete
/downloads/usenet/incomplete
/downloads/usenet/nzb

Follow these instructions, though ignore the part about creating a separate user:
https://drfrankenstein.co.uk/2021/07/30/setting-up-sabnzbd-in-docker-on-a-synology-nas/
Allow an auto-assigned port and take note as this will be need to be changed later.
Don’t forget to set the environment variables, obtaining PUID and PGID from SSH into NAS and running “id”:

PUID 1026
PGID 100
TZ America/Chicago

After SABnzb installation, map the above folders in the config.
Speed up downloads by setting server SSL Ciphers to AES128.
Note auto-assigned port. Stop container and set it manually, then re-start.

Qbittorent
Create the following folder structure.

/downloads/torrents

Allow an auto-assigned port and take note as this will be need to be changed later.
Don’t forget to set the environment variables:

PUID 1026
PGID 100
TZ America/Chicago
WEBUI_PORT 8080

Per fix https://github.com/qbittorrent/qBittorrent/issues/8095#issuecomment-472740702
Add the following line to qBittorrent.conf

WebUI\HostHeaderValidation=false

Also modify address to match IP and port:

WebUI\Address=192.168.1.20:8080

Note auto-assigned port. Stop container and set it manually, then re-start.
Update router to forward port 6881 to NAS allowing both TCP and UDP.
Warning: the default username is “admin” and the default password is “adminadmin”

Xubuntu 22.04 LTS Linux Install Notes

25 Nov

Initial Install
Install from USB drive with minimal software
Do not download packages when installing
Reboot and attempt login (may get black screen after login due to bad Nvidia drivers).

Nvidia Driver Fix
Boot into safe mode
sudo apt update
sudo apt upgrade
sudo reboot now

Follow instructions for Ubuntu LTS at:
https://docs.nvidia.com/datacenter/tesla/tesla-installation-notes/index.html
sudo reboot now
nvidia-smi

Boot to Console
sudo cp /etc/default/grub /etc/default/grub.backup
sudo vi /etc/default/grub

Uncomment GRUB_TERMINAL=console
Remove “quiet splash”
sudo update-grub
sudo systemctl set-default multi-user.target

Network Config
IPV4: manual
Address: 192.168.1.2
Netmask: 255.255.255.0
Gateway: 192.168.1.1
Nameserver: 192.168.1.1
IPV6: ignore

Update the System
sudo apt update
sudo apt upgrade

Install Custom Shell Scripts
cp .bash_profile ~
cp .bashrc ~
cp .profile ~
cp .vimrc ~
sudo cp .bashrc /root

Directory Permissions
sudo chmod 777 /usr/local/src

Add Library Path to Linker
sudo vi /etc/ld.so.conf.d/usrlocal.conf
add /usr/local/lib
add /usr/local/lib64
sudo ldconfig

Firewall

Printer
sudo apt install system-config-printer
sudo system-config-printer

Search for network printer at 192.168.1.4
Use DirectJet port
Choose driver for Brother HL-5170DN
Use BR-Script3

Sound
sudo usermod -a -G audio username

Setting up NI GPIB-USB-HS under Linux

26 Jul

Mostly stolen from: http://www.cl.cam.ac.uk/~osc22/tutorials/gpib_usb_linux.html

Note unlike the ni_usb_b, this is the ni_usb_hs so no firmware has to be loaded at boot, thus gpib_config can be called directly.

Get latest source code
http://linux-gpib.sourceforge.net/

Typical build in /usr/local/src with
./configure
make
sudo make install

Edit configuration
sudo vi /etc/gpib.conf

board_type = "ni_usb_b"
name = "gpib0"

Add udev rules
sudo vi /etc/udev/rules.d/99-linux_gpib_ni_usb.rules

SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3923", ATTR{idProduct}=="709b", MODE="660", GROUP="username", SYMLINK+="usb_gpib"
SUBSYSTEM=="usb", ACTION=="add", ENV{DEVTYPE}=="usb_device", ATTR{idVendor}=="3923", ATTR{idProduct}=="709b", RUN+="/usr/local/sbin/gpib_config"
KERNEL=="gpib[0-9]*", ACTION=="add", MODE="660", GROUP="username"

sudo udevadm control –reload-rules

Note udev will not run the gpib_config at boot, so add it in rc.local
sudo vi /etc/rc.d/rc.local

#!/bin/sh
/usr/local/sbin/gpib_config
exit 0

sudo chmod +x /etc/rc.d/rc.local
sudo systemctl enable rc-local.service
systemctl status rc-local.service

Tests
Now plug in the adapter and run ibtest
Reboot and run ibtest

Linux Multimedia

19 Jul

Logitech C615 HD Webcam
sudo vi /etc/udev/rules.d/99-webcam.rules

SUBSYSTEMS=="usb", ATTRS{idVendor}=="046d", ATTRS{idProduct}=="082c", MODE:="0666"

sudo udevadm control --reload-rules

Dell XPS 13 Webcam
sudo vi /etc/udev/rules.d/99-webcam.rules

SUBSYSTEMS=="usb", ATTRS{idVendor}=="0bda", ATTRS{idProduct}=="5752", MODE:="0666"

sudo udevadm control --reload-rules

RPM Fusion Repository
sudo yum localinstall --nogpgcheck http://download1.rpmfusion.org/free/fedora/rpmfusion-free-release-$(rpm -E %fedora).noarch.rpm http://download1.rpmfusion.org/nonfree/fedora/rpmfusion-nonfree-release-$(rpm -E %fedora).noarch.rpm

GUVCView Webcam Recording
sudo yum install libwebcam guvcview

Change resolution to 1280×720 on XPS-13

Set sound device to hw:2,0 for Logitech webcam

Screen Recording
sudo yum install gtk-recordmydesktop

Set sound device to DEFAULT for Logitech webcam

May also need to use hw:0,0 (use arecord -l to list input devices)

Video Editing
sudo yum install openshot

Video Playback
sudo yum install vlc

Fedora 35 x86_64 Linux Install Notes

7 Feb

Hardware Configuration
TBD

Hostname
sudo hostnamectl set-hostname tesla

Change to multi-user.target (e.g. runlevel 3)
sudo rm /etc/systemd/system/default.target
sudo ln -s /lib/systemd/system/multi-user.target /etc/systemd/system/default.target

Change GRUB
sudo vi /etc/default/grub and remove rhgb quiet
sudo grub2-mkconfig -o /boot/grub2/grub.cfg

Set XFCE
sudo dnf -y group install "Xfce Desktop"
touch ~/.xinitrc
echo "exec /usr/bin/xfce4-session" >> ~/.xinitrc
startx

Network Config
IPV4: manual
Address: 192.168.1.2
Netmask: 255.255.255.0
Gateway: 192.168.1.1
Nameserver: 192.168.1.1
IPV6: ignore

Update the System
sudo dnf update

<strong>Enable root Account
sudo passwd
</strong

Install Custom Shell Scripts
cp .bash_profile ~
cp .bashrc ~
cp .profile ~
cp .vimrc ~
sudo cp .bashrc /root

Directory Permissions
sudo chmod 777 /usr/local/src

Add Library Path to Linker
sudo vi /etc/ld.so.conf.d/usrlocal.conf
add /usr/local/lib
add /usr/local/lib64
sudo ldconfig

Firewall
sudo /usr/bin/firewall-config
Change default zone to internal
Trust services as required

Printer
sudo dnf install system-config-printer
sudo system-config-printer

Search for network printer at 192.168.1.4
Use DirectJet port
Choose driver for Brother HL-5170DN
Use BR-Script3

Sound
sudo usermod -a -G audio username

nm-applet
The nm-applet gives insufficent permission errors when changing WiFi due to startxfce4 instead of using a display manager. This will fix it:

sudo vi /etc/polkit-1/rules.d/50-org.freedesktop.NetworkManager.rules
polkit.addRule(function(action, subject) {
if (action.id.indexOf("org.freedesktop.NetworkManager.") == 0 && subject.isInGroup("myusername")) {
return polkit.Result.YES;
}
});

(must reboot to take effect)