Differences between revisions 4 and 5
Revision 4 as of 2021-02-16 11:55:39
Size: 19089
Editor: bsw388
Comment:
Revision 5 as of 2021-02-16 12:00:34
Size: 19255
Editor: bsw388
Comment:
Deletions are marked like this. Additions are marked like this.
Line 157: Line 157:
{{{
Line 159: Line 159:
Line 160: Line 161:
}}}
Line 161: Line 163:
{{{
Line 162: Line 165:
}}}
Line 163: Line 167:
{{{
Line 164: Line 169:
Line 165: Line 171:
Line 166: Line 173:
   }}}
Line 168: Line 176:
{{{
Line 169: Line 178:
}}}
Line 170: Line 180:
{{{
Line 173: Line 184:
}}}
Line 174: Line 186:
{{{
Line 175: Line 188:
}}}
Line 183: Line 197:
{{{
Line 184: Line 199:
}}}
Line 187: Line 203:
{{{
Line 188: Line 205:
}}}
Line 192: Line 210:
{{{
Line 193: Line 212:
Line 194: Line 214:
}}}
Line 202: Line 223:
{{{
Line 203: Line 225:
}}}
Line 213: Line 236:
}}}
Line 216: Line 240:
}}}
Line 219: Line 244:
}}}
Line 228: Line 255:
   }}}
Line 232: Line 260:
Line 233: Line 262:
Line 236: Line 266:
Line 237: Line 268:
}}}
Line 269: Line 301:
}}}
Line 276: Line 309:
}}}
Line 277: Line 312:
Line 279: Line 315:
}}}
Line 283: Line 320:
}}}
Line 286: Line 325:
}}}

Navigation:

Linux for Science : or How I set up my Dell laptop

Power management

Installed tlp today using

  $ sudo apt install tlp tlp-rdw

Still testing to see if power management improves. I was getting about 7-8h of battery life before. That was OK, but the battery could drain rather quickly when sleeping. It once drained almost completely overnight. The laptop was warm when I pulled it out of the case! I am hoping that tlp will be able to stop or reduce the hibernating power draw.

Verdict: No appreciable change in power draw. Sometimes the laptop sleeps well enough without much power draw, but at other times the draw is significant (20-30% per night!).

Problems with Dell XPS touchpad

Basically, the Synaptics driver made my life a mess. The touch pad was excessively sensitive and the cursor would jump places as I typed. This was untenable.

I removed Synaptics and installed libinput. That worked very well. More on this to follow.

Important

Dell has a solution to the problem

See their description on this page as they talk you through the process of removing Synaptics and installing libinput.

Here is a PDF copy of their instructions.

Multi-touch gestures

Not yet tried this but have a look at http://askubuntu.com/questions/789915/ubuntu-16-04-multitouch-gestures. In particular see the Github wiki at https://github.com/bulletmark/libinput-gestures.

libinput settings

This file is in /usr/share/X11/xorg.conf.d/90-libinput.conf

# Match on all types of devices but tablet devices and joysticks
Section "InputClass"
        Identifier "libinput pointer catchall"
        MatchIsPointer "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput keyboard catchall"
        MatchIsKeyboard "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

Section "InputClass"
        Identifier "libinput touchpad catchall"
        MatchIsTouchpad "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
        Option "Tapping" "true"
        Option "NaturalScrolling" "true"
        Option "ClickMethod" "clickfinger"
        Option "ScrollMethod" "twofinger"
EndSection

Section "InputClass"
        Identifier "libinput touchscreen catchall"
        MatchIsTouchscreen "on"
        MatchDevicePath "/dev/input/event*"
        Driver "libinput"
EndSection

libinput settings can be changed using:

  • xinput --list : to list devices
  • xinput list-props <dev number>

  • xinput set-prop <dev number> <line code> <values>: eg xinput set-prop 12 293 1 0 0

Firewall

Use ufw. Instructions from https://help.ubuntu.com/lts/serverguide/firewall.html

Printers

CUPs

First you need to add yourself to the lpadmin group. In terminal:

sudo usermod -aG lpadmin <username>

Next, restart CUPs. This can be done by typing:

sudo /etc/init.d/cups restart

into the terminal.

To get to the CUPs web interface open up http://localhost:631/ in your web browser. When asked for a user name and password you can use you log-in user-name and password.

If the interface does not open, then CUPs may need to be re/started. First check to see if it is running:

systemctl status cups.service

If not, restart it

systemctl enable cups.service

These commands may need to be sudo'd.

Samsung printers

Before trying to install a Samsung printer, install the PPD files and drivers from Samsung:

  • Download and install Samsung original printer driver. Visit www.samsung.com and under Support -> Printer, enter your printer model name.Scroll down to the drivers section, and download the Linux print driver. It will most likely be uld-something.tar.gz.

  • Open terminal, cd to the download location and untar the file with: tar xvzf uld-something.tar.gz (enter the actual filename) Enter the just unpacked directory (probably uld/) and run: sudo ./install-printer.sh

Problems with a high-res screen

Gnuplot

By default plots were absurdly small and fonts small too. Enlarging the plots was not an option as the graph would get bigger, but line widths, fonts etc. would remain tiny. There is a way of setting up Gnuplot to change defaults so that plots are mostly viewable. You do this by editing the system gnuplotrc file in:

/usr/share/gnuplot5/gnuplot/5.0/gnuplotrc

to include the line:

  • set terminal wxt lw 2 size 1800,1200 fontscale 2

The default graph size was something I had to figure out by trial and error. The rest of the settings should be obvious.

Wireless Network

This worked from the start, but would occasionally not show known networks I had previously connected to. This can be resolved by rescanning for available networks using:

rescan_netowrk.bash

sudo iwlist wlp58s0 scan

Wired Network

I have been using a Cable Matters USB-C to multiport dongle that supports an ethernet port. Some issues:

  • Power consumption is high. This thing puts a stiff load on the battery and should be used only when plugged in.
  • Recently, perhaps after an update to Ubuntu 16.04, it kept resulting in DNS server errors. Here's a solution to the problem taken from the second solution on this page: - Open /etc/NetworkManager/NetworkManager.conf in an editor with root rights. - Delete (or comment out with a hash #) the line that reads dns=dnsmasq. - Restart NetworkManager via sudo service NetworkManager restart.

Zotero

I downloaded and installed the code in $HOME/bin/ and start it from there and leave it running.

One Drive: Syncing with a Windows machine

The information below is now old and things seem to have got much better. Here are new instructions from https://www.maketecheasier.com/sync-onedrive-linux/.

For Ubuntu:

  sudo apt install libcurl4-openssl-dev git

  sudo apt install libsqlite3-dev

If you are using Ubuntu 18.04 or newer, use snap to install dmd:

  sudo snap install --classic dmd && sudo snap install --classic dub

If not:

  sudo wget http://master.dl.sourceforge.net/project/d-apt/files/d-apt.list -O /etc/apt/sources.list.d/d-apt.list

  sudo apt-get update && sudo apt-get -y --allow-unauthenticated install --reinstall d-apt-keyring

  sudo apt-get update && sudo apt-get install dmd-compiler dub

After installing the dependencies, fetch the files with git:

  git clone https://github.com/abraunegg/onedrive.git

And compile and install it:

  cd onedrive
  make
  sudo make install

After you have done this, now you need to authorize onedrive with Microsoft so it can access your account. Simply enter the following in the Terminal:

  onedrive

And it will prompt you to visit the URL to get authorization. Log in to your OneDrive account, and grant the app permission to access your account.

Once this is done, you will be presented with a blank white page. Copy the URL and paste it into the Terminal at the prompt.

This will complete the setting up.

To start synchronizing OneDrive to your local folder, run

  onedrive --sychronize

Onedrive will start downloading all your files in the cloud to your local folder.

Alternatively, you can run:

  onedrive --monitor

to get it to monitor your local folder for changes.

Configuration You can find the “config” file at the onedrive git folder. To make it active, move it to the “~/.config/onedrive/” folder.

  mkdir -p ~/.config/onedrive

  cp ~/onedrive/config ~/ .config/onedrive/config

Open the config file. There are three options that you can configure: “sync_dir” and “skip_files.”

sync_dir: the location to store your OneDrive files. All files placed in/removed from this folder will be synced to the cloud. skip_files: the file type (or file pattern) that won’t be synced. monitor_interval: the time interval between sync operations. Once you have made the changes, save and restart onedrive.

At any time, you can check your configuration with the command:

  onedrive --display-config

Old Instructions follow

I have a Surface tablet and use OneDrive a lot. Luckily you can get OneDrive to sync on a Linux machine too. Here's information about OneDrive on Linux:

The first step to installing onedrive-d is to open a terminal window and clone the source code from git using the following command:

If you don’t have “git” installed, you can install it with the command:

sudo apt-get install git

Now change directory into the onedrive-d folder:

cd onedrive-d

And run the install script:

./inst install

Enter your Ubuntu password if prompted. The installation script will download and install any dependencies via “apt-get”. Accept the list of packages to install.

You will then be asked to accept the permissions for onedrive-d so that it can “Access and edit your OneDrive” and “Access your info anytime.” These are necessary for onedrive-d to perform the sync operations.

Next click on “(None)” in the dropdown box just below where it says “The local folder to sync with your OneDrive.” Click “Other…” and use “Create Folder” on the file open dialog to create a new folder called “OneDrive.” Select the “OneDrive” directory as the sync folder.

To finish, click on “Close” and then on “Yes” to confirm that you want to save your preferences. The onedrive-d daemon doesn’t run automatically at system boot, so you need to start it manually by typing the following in a terminal window:

onedrive-d

There is more information and screen-captures at the link above.

Setting up Compiz

Multiple desktops/workspaces

By default Ubuntu gives you 4 desktops/workspaces. I wanted six. Install Compiz Config setting manager

sudo apt-get install compizconfig-settings-manage

See the site [[http://askubuntu.com/questions/764625/how-to-set-6-workspaces-in-ubuntu-mate-16-04-using-compiz|for details of setting up more than 4 desktops]]. This site [[https://www.maketecheasier.com/tweak-number-workspaces-unity/|tells you more about the Unity Tweak Tool]] that I may have tried.

Stopping the screen flicker on display wake-up

The screen, or some windows in the screen, flickers when the display wakes up. This happens often and is irritating even though it can be stopped by moving between desktops. There is a compiz setting that fixes this issue:

Make sure you have Compiz installed and enable "Don't wait for video sync" and "Force complete redraw on initial damage"

Compiz -> Utility -> Workarounds -> Don't wait for video sync

Compiz -> Utility -> Workarounds -> Force complete redraw on initial damage

Taken from the discussion here.

Python

The basic python modules I need are:

  • matplotlib
  • numpy
  • scipy
  • ipython
  • These (and others) are needed for python2 and python3

Also needed are:

  • Jupyter (for python notebooks)

Jupyter

Information from:

Install Python 2.7, Python Pip, and Python Development:

sudo apt-get -y install python2.7 python-pip python-dev

Something similar will need to be done for python3.x

Installing python2.7 will update to the latest version of Python 2.7, and python-pip will install Pip which allows us to manage Python packages we would like to use. Some of Jupyter’s dependencies may require compilation, in which case you would need the ability to compile Python C-extensions, so we are installing python-dev as well.

To verify that you have python installed:

python2 --version

and, for pip use

pip2 --version

Now install iPython

sudo apt-get -y install ipython ipython-notebook

Now we can move on to installing Jupyter Notebook:

sudo -H pip install jupyter

Python kernel to Jupyter

Jupyter will need a kernel for python2 and python3. This information is from Versions of Python.

Make sure you have ipykernel installed and use ipython kernel install to drop the kernelspec in the right location for python2. Then ipython3 kernel install for Python3. Now you should be able to chose between the 2 kernels regardless of whether you use jupyter notebook, ipython notebook or ipython3 notebook (the later two are deprecated).

Note that if you want to install for a specific Python executable you can use the following trick:

path/to/python -m ipykernel install <options> This works when using environments (venv,conda,...) and the <options> let you name your kernel (see --help). So you can do

conda create -n py36-test python=3.6 source activate py36-test python -m ipykernel install --name py36-test source deactivate And now you get a kernel named py36-test in your dropdown menus, along the other ones.

See Using both Python 2.x and Python 3.x in IPython Notebook which has more recent information.

Information from the above link follows:

Python kernels

The idea here is to install multiple ipython kernels. Here are instructions for anaconda. If you are not using anaconda, I recently added instructions using pure virtualenvs.

Anaconda 4.1.0

Since version 4.1.0, anaconda includes a special package nb_conda_kernels that detects conda environments with notebook kernels and automatically registers them. This makes using a new python version as easy as creating new conda environments:

conda create -n py27 python=2.7 ipykernel
{{{
conda create -n py36 python=3.6 ipykernel
After a restart of jupyter notebook, the new kernels are available over the graphical interface. Please note that new packages have to be explicitly installed into the new enviroments. The Managing environments section in conda's docs provides further information.

'''Manually registering kernels'''

Users who do not want to use nb_conda_kernels or still use older versions of anaconda can use following steps to manually register ipython kernels.

configure the python2.7 environment:
{{{
conda create -n py27 python=2.7
{{{
source activate py27
{{{
conda install notebook ipykernel
{{{
ipython kernel install --user
configure the python3.6 environment:
{{{
conda create -n py36 python=3.6
{{{
source activate py36
{{{
conda install notebook ipykernel
{{{
ipython kernel install --user
After that you should be able to choose between python2
and python3 when creating a new notebook in the interface.

Additionally you can pass the --name and --display-name options to ipython kernel install if you want to change the names of your kernels. See ipython kernel install --help for more informations.


=== Some more kernel suggestions ===
This worked for me on Ubuntu 16.04:

{{{
python2 -m pip install ipykernel

python2 -m ipykernel install --user

AJMPublic/computing/linux (last edited 2021-04-07 13:13:09 by bsw388)