Linux Notes

GitHub SSH Keys

There are two ways to import GitHub SSH Keys - manually, using the ssh-import-id python script - alternatively, load the keys dynamically using the AuthorizedKeysCommand in the sshd config.

This latter approach is packaged for Debian.

Logitech K400

Press the Fn key and the left mouse button to toggle between touch tap disable and enabled. You can also press the left mouse click button at the top-left of the keyboard to perform a click or comfortable two-handed navigation. You can also tap the touchpad surface to perform a click.  

Use nala from local install

nala is an improved from end for the apt package manager in Debian and ubuntu. If installed in a user directory, use

sudo -E
and a qualified name.

pip3 install --user git+https://github.com/volitank/nala
sudo -E .local/bin/nala

Download from both a torrent and HTTP mirror

An occasionally useful feature of the

aria2c
downloader:

aria2c -Ttest.torrent "http://host1/file" "ftp://host2/file"

Disable Suspend

For systems which should never attempt any type of suspension, these targets can be disabled at the systemd level with the following:


sudo systemctl mask sleep.target suspend.target hibernate.target hybrid-sleep.target

How to Fix "Authentication is required to create a color profile/managed device"

from https://devanswers.co/how-to-fix-authentication-is-required-to-create-a-color-profile-managed-device-on-ubuntu-20-04-20-10/

The safest fix to get rid of these popups is to create a new configuration file in /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf.

sudo nano /etc/polkit-1/localauthority.conf.d/02-allow-colord.conf

Paste in the following:

/etc/polkit-1/localauthority.conf.d/02-allow-colord.conf

polkit.addRule(function(action, subject) {
 if ((action.id == "org.freedesktop.color-manager.create-device" ||
 action.id == "org.freedesktop.color-manager.create-profile" ||
 action.id == "org.freedesktop.color-manager.delete-device" ||
 action.id == "org.freedesktop.color-manager.delete-profile" ||
 action.id == "org.freedesktop.color-manager.modify-device" ||
 action.id == "org.freedesktop.color-manager.modify-profile") &&
 subject.isInGroup("{users}")) {
 return polkit.Result.YES;
 }
});

Save and exit (press CTRL + X, press Y and then press ENTER)

This tells Polkit to continue without requiring the authentication prompt over RDP.

Now reboot Ubuntu and try logging in again over RDP / Windows Remote Desktop and the popups should be gone.

Configuring a monitor with non-standard resolutions

First, use gtf to calculate the mode line

gtf 1024 600 60

Then, create a new mode, add it to the output device, and activate it.

xrandr --newmode "1024x600_60.00"  48.96  1024 1064 1168 1312  600 601 604 622  -HSync +Vsync
xrandr --addmode HDMI-A-0 "1024x600_60.00"
xrandr --output HDMI-A-0 --mode "1024x600_60.00"

Mirroring from s3 to ftp

USB HDMI capture

ClamAV from source

Cisco AnyConnect VPN

sudo nmcli general logging level TRACE
journalctl -u NetworkManager --since '2 minutes ago'

FoxyProxy config

Enable Bluetooth at boot

 # Set bluetooth power up
ACTION=="add", KERNEL=="hci0", RUN+="/usr/bin/hciconfig hci0 up"

Fix crackling audio on HDMI

# add tsched=0 to udev-detect
load-module module-udev-detect tsched=0

Awesome CLI tools

Old awesome commands

Openvpn

sudo apt install network-manager-openvpn network-manager-openvpn-gnome

Need to reboot!

Grepping for user cron

journalctl | grep --line-buffered -Ei "cron\[[0-9]*\]:\s*\($USER\)"

use --line-buffered to avoid double-buffer delay.

Conferences

https://kansaslinuxfest.org/

Old Crunchbang notes

CrunchBang, at crunchbang.org was a [[Debian]]-based [[Linux]] distribution.

It is built with low overhead in mind, making it ideal for modest PCs such as [[netbooks]].

At it's core, it is really just a debian install with good defaults for

[[OpenBox]] - window manager

[[tint2]] - panel

[[conky]] - system info dashboard - Crunchbang lists the OB shortcuts

A eulogy to CrunchBang, the Linux distro that time passed by | PCWorld

Creating USB

Default "Create startup USB" in ubuntu did not worked, installed unetbin, which did.

Set up on laptop. Flash and wireless worked out of box.

Iceweasel

SSD Notes

Since using an ssd, I did not install a swap partition.

Wlan tweak

Added wlan0 status to conkyrc:

 ESSID: $alignr ${wireless_essid wlan0} ${wireless_link_qual_perc wlan0}%

Wallpaper Hack

~/bin/rotate2 is a script for switching desktops

     #/bin/sh
     DIR=${1:-~/images/wallpapers}
     FILE=$DIR/$(ls -1tr $DIR | head -n 1)
     touch "$FILE"
     nitrogen --set-zoom-fill "$FILE"

nitrogen is obviously the command which does the desktop

It is invoked by conky:

${execi 222 ~/bin/rotate2}

10/28 : Need this line for conky for fixing background problems.

own_window_argb_visual yes

Also added battery meter.

Minor stuff

Notes from Setting up desktop

Setting up SSD was major pain in the ass, BIOS was defaulting to IDE emulation and the drive was failing inconsistently eg ldconfig failures (Invalid ELF; missing magic bytes) and and segfaulting iceweasel, flash, vim, xterm, everything.

Went through several reinstalls to get it working right. Trick was to switch it to AHCI.

Fstab editing

Because I wanted to still use my old hard drive, two problems came up:

  1. mount it automatically to ~/prev-drive

  2. have #! use the HDD swap partition instead of the SSD

Both are accomplished by adding the devices to fstab along with mount points.

Since the last time I did this, things have changed, now you refer to drives by UUID, which you can get out of blkid

Grub Editing

Also, GRUB added all the old drives Ubuntu entries to the the list, there was ~30 of them. To get rid of them I commented them out from /boot/grub/grub.cfg; and to make sure they don't come back, I removed execute permission from /etc/grub.d/30_os_probe

sudo chmod -x /etc/grub.ed/30_os_probe

There might be a better way to do this. Also, I had to run the grub update script once with os probing to get settings for windows, which I then copied into a diff file (40_win)

###Mcabber

This didn't seem to work until installing TLS libraries.

###Latex

To install Lecture Notes in CS Springer style, unzip llncs2e.zip to

/usr/share/texlive/texmf-dist/tex/latex/llncs2e/

and then rebuild the style database:

$sudo mktexlsr

I installed the uclathes template there similiarly, by git clone-ing it into the above directory and rebuilding.

###SSH Shared Keys

first, generate the key

$ ssh-keygen

then, add it to ssh-agent

$ ssh-add

check that it is there

$ ssh-add -L

finally, send it on over

$ ssh-copy-id remote

Make sure that .ssh is chmod 700 and .ssh/id_rsa is chmod 66

Make sure public key auth is turned on in /etc/ssh/sshd_config

Text Utils

A couple utils I like for text:

Stripping shoutcast streams

 git://src.thregr.org/fIcy

make and then copy to ~/bin

Old SUSE Notes

Start with server text only install

Follow these:

http://l3net.wordpress.com/2013/04/24/lightweight-opensuse-lxde-desktop-from-scratch/

# zypper install xorg-x11 xorg-x11-server
# startx

# zypper install openbox

need Mesa-GL, x drivers for ati and evdev, xorg-video-drivers

http://en.opensuse.org/SDB:Administer_with_sudo

# zypper in sudo
# visudo
// add line %sudo ALL=(ALL) ALL
# groupadd sudo
# usermod -a -G sudo neal

I don't have man pages, wtf

sudo zypper in --no-recommends man

apparently man reccomends ghostscript, which is not needed right now.

zypper ar http://download.opensuse.org/repositories/X11:/lxde/openSUSE_12.3/X11:lxde.repo

zypper in slim

 ? reccommends ImageMagic ??

zypper in yast2-sysconfig yast2-runlevel

edit /etc/logins.def, remove offending LASTLOG_ENAB

in yast2-runlevel, enable xdm


however, changing systemd default runlevel is a bit more involved:

ln -sf /usr/lib/systemd/system/multi-user.target \
   /etc/systemd/system/default.target

zypper in pulseaudio pavucontrol

zypper in MozillaFirefox
zypper in flash-player


zypper in mercurial
zypper in hg-git

http://susestarter.blogspot.com/2011/03/get-yer-subpixel-hinted-fonts.html

htop
mutt abook
newsbeuter
lynx
moc

ranger from rpm

conky

vlc from videolan.org
libdvdcss from community repo

make
stow from rpm

ncurses-devel

yast2-sshd

autoconf automake

dependencies for st:
libX11-devel fontconfig-devel freetype2-devel libXft-devel libXext libXext6 liberation2-fonts


enable ssh : http://en.opensuse.org/SDB:Configure_openSSH#SSHD_.E2.80.93_The_server
 and firewall in yast

patch

screen with caption patch and 256 color patch

install zathura from github manually, + girara and poppler plugin

install libwebkit, compile tabbed and surf

install R from tumbleweed, install colorout

did a dist upgrade to tumbleweed

Make a motd

hostname | figlet | boxes | sudo tee /etc/motd

Old Notes

Revisiting How We Put Together Linux Systems

Why do we use the Linux kernel's TCP stack? - Julia Evans

vmtouch - the Virtual Memory Toucher

Portable file system cache diagnostics and control --- Hoytech

Linux devices manager for the Logitech Unifying Receiver. --- Solaar

How to switch to Compton for beautiful tear free compositing in XFCE: duncanlock.net

How to Boot Linux ISO Images Directly From Your Hard Drive

smxi sgfxi svmi :: How to Install the Scripts

IMO Power user = knowledge of differences between consumer distros, desktop ricing, and exotic scripts for like media control or home automation Sysadmin = could do the above but more likely just drinks in between deployments/ fires/ paychecks --- How to tell the level of a Linux book? : linux

The Definitive Guide to Linux System Calls

Links

A broad overview of how modern Linux systems boot

Theme generator - wpgtk

WebDAV

WebDAV is a read/write extension to HTTP.

To mount a WebDAV share on linux, download the davfs2 package and run:

$ mount -t davfs http://example.com /mnt/dir

https://github.com/pimutils/vdirsyncer

GNOME

Set an Always on Top keyboard shortcut on GNOME desktop

from https://www.linuxuprising.com/2020/12/how-to-use-keyboard-shortcut-to-toggle.html

GNOME doesn't have a default keyboard shortcut for Always on Top any more (it used to have Alt + Space, then t), but there is an option to set your own keyboard shortcut for this window feature. The option is not exposed in Settings - > Keyboard Shortcuts though.

Dconf Editor Always on Top

To access the option that allows setting a keyboard shortcut for Always on Top, open Dconf Editor and go to /org/gnome/desktop/wm/keybindings. There, set a keyboard shortcut for always-on-top in this form (example): ['1'], ['2'], ['a'] and so on, but obviously, set it to what you want to use for this. Disable the "Use default value" toggle to be able to enter a shortcut.