User:Ctag/Notes

From ArchWiki
Jump to navigation Jump to search

Overview

My notes for installing and maintaining GNU/Linux instances, working with personal computer hardware, etc.

Naming Schemes

My computers are named after fictional spacecraft. I do this because I think it sounds nice, like USS-Alabama is the naming scheme for United States Ships. The one exception to this rule is my main desktop, which isn't named after anything else.

General Program Notes

SVG path to OpenSCAD

Make everything a path. Go to extensions > modify path > flatten bezier. Save as DXG R14.

Import in openscad and be done.

Also covers the warning "WARNING: Unsupported DXF Entity `SPLINE'"

http://www.inkscapeforum.com/viewtopic.php?t=12841

General Archlinux Notes

Systemctl Timed Out

Error:

$systemctl enable whatever.service
[...]
Failed to execute operation: Connection timed out

Cause: lvm2 is broken.

Fix: I just uninstalled lvm2 on this machine, as it was unneeded.

https://github.com/systemd/systemd/issues/3353

GPG and Duplicity

If you get an error about not being able to use the signing keys or ioctl, make sure you've got something set up in .bashrc like this:

# For duplicity
export GPG_TTY=$(tty)
echo "UPDATESTARTUPTTY" | gpg-connect-agent > /dev/null 2&>1

For some reason the pinentry dialog won't show up without it.

https://www.gnupg.org/documentation/manuals/gnupg/Invoking-GPG_002dAGENT.html

bns-anarch

2013 Installation Notes

Notes copied as they were found from an old piece of paper.

Install date: 15-12-2013

  • Followed Beginner Guide on archwiki.
  • Network: Default dhcpcd.service, IP set by MAC on router.
  • Disk:
    • 1Gig 'ef' (ef00) partition for /boot
    • 110Gig ext4
  • NFS:
    • Installed nfs-utils
    • Enable rpc-statd.service
    • fstab won't mount on boot without x-systemd.automount flag
    • rpc-gssd.service totally kills NFS!
  • Yeti USB:
    • Must not be plugged into USB 3.0 port!
    • To list modules: 'aplay -l'
    • Set Yeti as default device, edit /etc/modprobe.d/alsa.conf
options snd slots=snd_usb_audio,snd_hda_intel
options snd_usb_audio index=0
options snd_hda_intel index=1
  • nVidia Driver:
    • Packages: nvidia, nvidia_libgl, nvidia-utils, opencl-nvidia, nvidia-cg-*, libcl, lib32-opencl-nvidia, libvdpau
    • libvdpau is needed for 'flashplugin' and lib32-flashplugin
    • Setup xorg.conf for a new X screen on each monitor.
  • BIOS
    • Turn on IOMMU, turn off XHCI
  • VPN
    • /etc/dhcpcd.conf: nooption domain_name_servers, domain_name
    • Add DNS to /etc/resolv.conf.head

Thinkpad fan control

I haven't found a good solution for fan control on the x120e, but tpfanco-svn from the AUR works reasonably well. Both lm-sensors and fancontrol were totally awful to configure/use.

Configuration on ArchWiki

youtube-dl stacktrace

youtube-dl fails after I made the python symlinks sane again.

to fix it, edit /usr/bin/youtube-dl and change the first line to use /usr/bin/python3.4

HP J4580 Unrecognized

Symptoms: HP printer that's only good for flatbed scanning is suddenly unrecognized even though hplip is installed.

Steps to reproduce: Try scanning in homework with less than half an hour left on the clock.

It fucking works, just uncomment 'hpaio' at the end of /etc/sane.d/dll.conf

Slic3r HTTPS API

Received this error in Slic3r when connecting to octoprint via HTTPS only:

I wasn't able to connect to OctoPrint (501 Protocol scheme 'https' is not supported (LWP::Protocol::https not installed)). Check hostname and OctoPrint version (at least 1.1.0 is required).

Solution: install perl-lwp-protocol-https from the official repos.


ReText

To make the icons appear, you have to set the icon theme name in ReText.conf

http://www.svenbit.com/2012/05/fix-missing-toolbar-icon-in-retext/

MATLAB

To install, I had to go get the following packages:

lib32-libxmu
lib32-libxp
lib32-libxtst
lib32-ncurses5-compat-libs
bin32-jre6
wmname

/usr/share/applications/matlab.desktop

#!/usr/bin/env xdg-open
[Desktop Entry]
Type=Application
Icon=/usr/share/icons/matlab.png
Name=MATLAB
Comment=Start MATLAB - The Language of Technical Computing
Exec=cd /home/berocs/Documents/uah && wmname LG3D && env MATLAB_JAVA=/usr/lib32/jvm/java32-6-jre/jre matlab -desktop -nosplash -glnx86
Categories=Development;
MimeType=text/x-matlab;

The 'cd /home/berocs/Documents/uah' portion of the .desktop file makes MATLAB use my uah directory as its default, which makes navigating class project files much easier.

I recently had to use 'fdatool' for a class, and the sub-windows wouldn't render any contents. To fix this I migrated from jre8 to jre6.

Licensing

Matlab checks the mac address of "eth0" for license validation. There isn't an eth0 on Archlinux, so we'll have to spoof it.

Manually

To create a dummy0 device, load the 'dummy' module

ip a # No dummy0 device
sudo modprobe dummy
ip a # dummy0@NONE should exist

Next, we need to turn the dummy device into a fake eth0 and assign it the MAC address that matlab is looking for.

sudo ip link set dev dummy0 name eth0
sudo ip link set dev eth0 address e8:9a:8f:00:00:00
Automatically

Edit /etc/modules-load.d/dummy.conf to have

dummy

Now the dummy0 device will appear on boot.

Next we need to create a systemd service that will assign the eth0 name to the dummy device.

/etc/systemd/system/matlab.licensing.service

[Unit]
Description=Dummy network interface for MATLAB
Requires=systemd-modules-load.service
After=systemd-modules-load.service

[Service]
Type=oneshot
ExecStart=/usr/bin/ip link set dev dummy0 name eth0
ExecStart=/usr/bin/ip link set dev eth0 address e8:9a:8f:8d:79:84

[Install]
WantedBy=multi-user.target

Steam

Upon receiving the error

libGL error: unable to load driver: nouveau_dri.so

I found [1] and ran the command

rm ~/.local/share/Steam/ubuntu12_32/steam-runtime/i386/usr/lib/i386-linux-gnu/libstdc++.so.6

to solve the problem.

Battle of Wesnoth

From the installation package:

==> If you experience sound problems try setting your SDL_AUDIODRIVER environment variable to "dma"
==> eg. export SDL_AUDIODRIVER="dma" ; wesnoth
==> If "dma" doesn't work,other options are: dsp,alsa,artsc,esd,nas try to find the right output.

Coyote Raspberry Pi's

Wireless AP

Set up a network for SSH access or webserving.

Just network: wpa_supplicant, dnsmasq, hostapd.

Webservice: nodejs, authbind, rpi-monitor.

Set wlan0 to a static IP:

# /etc/dhcpcd.conf
# Append to file:
interface wlan0
static ip_address=192.168.0.1/24
static routers=192.168.0.1

Setup /etc/dnsmasq.conf:

# Append to end of /etc/dnsmasq.conf
# disables dnsmasq reading any other files like /etc/resolv.conf for nameservers
no-resolv
# Interface to bind to
interface=wlan0
# Specify starting_range,end_range,lease_time
dhcp-range=192.168.0.50,192.168.0.150,12h
# dns addresses to send to the clients
server=8.8.8.8
server=8.8.4.4
# Route all requests to this machine
address=/#/192.168.0.1

You may have to create /etc/hostapd/hostapd.conf:

# /etc/hostapd/hostapd.conf
ssid=YourWiFiName
wpa_passphrase=Somepassphrase
interface=wlan0
#bridge=br0
auth_algs=3
channel=7
driver=nl80211
hw_mode=g
#logger_stdout=-1
#logger_stdout_level=2
max_num_sta=5
rsn_pairwise=CCMP
wpa=2
wpa_key_mgmt=WPA-PSK
wpa_pairwise=TKIP

Serving site on port 80:

Configure authbind:

# touch /etc/authbind/byport/80
# chown user /etc/authbind/byport/80
# chmod 755 /etc/authbind/byport/80

To run a site:

$ authbind --deep node app.js

Links

http://elinux.org/RPI-Wireless-Hotspot

http://serverfault.com/questions/351108/using-dnsmasq-to-resolve-all-hosts-to-the-same-address

https://wiki.archlinux.org/index.php/Software_access_point

http://blog.sip2serve.com/post/48420162196/howto-setup-rtl8188cus-on-rpi-as-an-access-point

Backups

Noncritical

Non critical computers are those with unencrypted hard disks. These are things like 3d print servers or irc clients. If I take the time to encrypt a system, then I'll also encrypt the backups.

Backup Script in /opt/backup.sh

#!/bin/bash
# Backup either home or root
duplicity --no-encryption /home/berocs file:///mnt/bkup/${BNS-SYSTEM}/duplicity

Systemd Service /etc/systemd/system/backup-{root,home}.service

[Unit]
Description=Backs up /home/berocs to bns-readynas:/bkup/bns-daedalus/duplicity

[Service]
Type=Simple
ExecStart=/opt/backup.sh

Systemd Timer in /etc/systemd/sytem/backup-{root,home}.timer

[Unit]
Description=Timer for backup-{home,root}.service

[Timer]
OnCalendar=Monthly

[Install]
WantedBy=timers.target

cron line


RPi Notes

Failed to start Load Kernel Modules

On a Raspberry Pi.

Error:

$dmesg
[...]
Failed to start Load Kernel Modules.
[...]

Fix: edit /etc/modules-load.d/raspberrypi.conf and remove "bcm2708-rng" because it has changed to bcm2835-rng.

Debian Notes

On the servers I kept receiving the following error and bootup took almost 15 minutes.

Fri May  1 11:52:20 2015: Starting NFS common utilities: statd idmapd.
Fri May  1 11:56:33 2015: mount.nfs: Connection timed out
Fri May  1 12:00:46 2015: mount.nfs: Connection timed out
Fri May  1 12:04:58 2015: mount.nfs: Connection timed out
Fri May  1 12:09:11 2015: mount.nfs: Connection timed out

The problem ended up being nonexistant IP addresses in /etc/fstab due to the move from 10.10.x.x at Nick's house to 192.168.x.x at home. Fixing the fstab returns the servers to a fast boot.