resize2fs: Read-only file system While checking for on-line resizing support

Had a problem with resize2fs not resizing the root partition of Ubuntu. Was giving the following error

resize2fs: Read-only file system While checking for on-line resizing support

The problem is the root partition I was trying to resize was mounted read only. Remounting as read/write fixed the problem

mount -o remount /

Then rerun the resize command to fill up the rest of the free space

resize2fs /dev/sda1

Basic Docker commands

In the following commands, 367c7a1465ec = Docker container ID

Start/stop Docker service

systemctl start docker
systemctl stop docker

Automatically start docker on system boot

systemctl enable docker

List docker containers

sudo docker container list
sudo docker container list
367c7a1465ec        jacobalberty/unifi:latest   "/usr/loca/bin/dock…" 15 minutes ago      Up 14 minutes (healthy) unifi-controller

The bold part is your Docker container ID

List docker images on system

sudo docker images
sudo docker images
jacobalberty/unifi latest baebbe301633 9 days ago 711MB

Stop container

sudo docker stop 367c7a1465ec

Start container

sudo docker stop 367c7a1465ec

Remove/Delete a Docker Image

Need to stop the container first.

sudo docker rmi 367c7a1465ec

Get a Shell on a Docker Container

We can connect to a Docker container with the following, replace DockerContainerName with the Docker container name.

docker exec -it DockerContainerName sh

imapsync bulk copy not copying first account in list

Ran into an issue where it looked like imapsync would fail to connect to the server on the first line when trying to do a bulk move.

mail.maildomain.com;user1@incredigeek.com;password1;mail.incredigeek.com;user2@incredigeek.com;password2

Was able to work around the issue by Adding a comment line to the top of the file. May have to do with how the script I was using handles the lines.

### Email Import list mail.maildomain.com;user1@incredigeek.com;password1;mail.incredigeek.com;user2@incredigeek.com;password2

Script used to copy

#!/bin/sh
# $Id: sync_loop_unix.sh,v 1.6 2015/11/04 18:23:04 gilles Exp gilles $ 
#Example for imapsync massive migration on Unix systems.
#See also http://imapsync.lamiral.info/FAQ.d/FAQ.Massive.txt
#
Data is supposed to be in file.txt in the following format:
host001_1;user001_1;password001_1;host001_2;user001_2;password001_2; … 
#Separator is character semi-colon ";" it can be changed by any character changing IFS=';' in the while loop below.
# Each line contains 6 columns, columns are parameter values for
--host1 --user1 --password1 --host2 --user2 --password2
and a trailing empty fake column to avoid CR LF part going
in the 6th parameter password2. Don't forget the last semicolon.
# You can add extra options after the variable "$@" Use character backslash \ at the end of each supplementary line, xcept for the last one. You can also pass extra options via the parameters of this script since they will be in "$@" The credentials filename "file.txt" used for the loop can be renamed by changing "file.txt" below. echo Looping on account credentials found in file.txt
echo
file="${1}"
{ while IFS=',' read  h1 u1 p1 h2 u2 p2 fake
    do 
        { echo "$h1" | egrep "^#" ; } > /dev/null && continue # this skip commented lines in file.txt
        echo "==== Starting imapsync from host1 $h1 user1 $u1 to host2 $h2 user2 $u2 ===="
         imapsync --host1 "$h1" --user1 "$u1" --password1 "$p1" \
                  --host2 "$h2" --user2 "$u2" --password2 "$p2" \
                  "$@" --delete2
         echo "==== Ended imapsync from host1 $h1 user1 $u1 to host2 $h2 user2 $u2 ===="
         echo
    done 
} < ${file}

Firefox performance improvements for Linux

Bunch of tweaks and enhancements are on the arch wiki

https://wiki.archlinux.org/index.php/Firefox/Tweaks

Two specific ones that can help with performance are enabling OMTC and WebRender

https://wiki.archlinux.org/index.php/Firefox/Tweaks#Enable_OpenGL_Off-Main-Thread_Compositing_(OMTC)

Open up Firefox and about:config

Search for “layers.acceleration.force-enabled”

Enable layers.acceleration.force-enabled

Search for “gfx.webrender.all” and set to true

Enable gfx.webrender.all

Restart Firefox.

Installing LineageOS on Raspberry Pi B+

Download LineageOS

Download the unofficial LineageOS 16 build from the following page

https://konstakang.com/devices/rpi3/LineageOS16.0/

Unzip

Unzip the file with

unzip ~/Downloads/lineage-16.0-20200207-UNOFFICIAL-KonstaKANG-rpi3.zip

Write to SD Card

Either use the instructions on the following link to write it to the SD card

https://www.raspberrypi.org/documentation/installation/installing-images/windows.md

Or use DD

WARNING! Make sure “/dev/mmcblk0” is the correct SD Card. Refer to here if you need to locate the path for the SD Card.

sudo dd if=~/Downloads/lineage-16.0-20200207-UNOFFICIAL-KonstaKANG-rpi3.img of=/dev/mmcblk0 bs=1M status=progress

Plug you SD Card into your Pi and boot it up.

Reset NextCloud admin password – Snap package

The regular command to reset the password for a NextCloud user does not work when NextCloud is installed from a snap package.

$ sudo -u www-data php /var/www/nextcloud/occ user:resetpassword admin
Could not open input file: /var/www/nextcloud/occ

The reason is that NextCloud is located in “/snap/nextcloud”

Unfortunately the occ file is not located in /snap/nextcloud/current/

However, you can run the nextcloud.occ command directly without specifying the path. Change admin to your user.

sudo nextcloud.occ user:resetpassword admin

Type in the new password twice and login.

Alienware fan control in Linux notes

Helpful links

https://wiki.archlinux.org/index.php/Fan_Speed_Control#Dell_laptops
https://bbs.archlinux.org/viewtopic.php?id=248106
https://www.reddit.com/r/Dell/comments/9pdgid/configuring_the_xps_to_play_nice_with_linux

You can use the following commands to “initilize” the fans so the fancontrol can read them.

 sudo modprobe dell-smm-hwmon ignore_dmi=1
sudo sensors-detect

After that is done you should be able to setup a fancontrol config with

sudo pwmconfig

After it is set up you can launch fancontrol to control the fans

sudo fancontrol

If you want to tweak the setting, modify the fancontrol config under

/etc/fancontrol

or run pwmconfig again and replace config.

Sounds like you should be able to add the following to “etc/modprobe.d/dell.conf” to get it to run on boot.

options dell-smm-hwmon ignore_dmi=1