Useful Notes for Mac, Ubuntu and Windows
Outline
- Copy the folder structure without files
- Keyboard
- Ubuntu and windows time
- Create links
- Install matlab .iso file
- Terminator terminal manager
- add a directory to the
$PATH
- Configure Multiple monitors (xrandr)
- 9. Color good for Eyes: (R: 199, G: 237, B: 204)
- Using DPT-RP1 in Ubuntu
- GNOME Shell Extensions
- Environment
- conda base in terminal prompt
conda base in terminal prompt
Set auto_activate_base True or False to control this.
# check
conda config --show | grep auto_activate_base# set it false
conda config --set auto_activate_base False
source ~/.bashrc# set it True
conda config --set auto_activate_base True
source ~/.sourcerc
Environment
List all environment variables
$ printenv
Copy the folder structure without files (inside the original folder):
$ find -type d -links 2 -exec mkdir -p “~/save/to/path/examplefolders/{}” \;
Keyboard:
- Show the full path in the folder browse:
Ctrl + L
; return:esc
- Show/Unshow the hidden files in the folder browse:
Ctrl + H
- Set a window occupying the left/right half of the screen :
Super + ←/→
(Ubuntu 18.04)
Ubuntu and windows time:
Operating systems store and retrieve the time in the hardware clock located on your motherboard.
Linux/Unix/Mac store the time on the hardware clock as UTC by default. UTC time is Coordinated Universal TimeWindows stores the time on the hardware clock as the local time.
Solutions:
Change the time in linux is more reliable and easier. 1. make linux use local time
In Ubuntu 18.04:
$ timedatectl set-local-rtc 1 --adjust-system-clockTo check out if your system uses Local time, just run:
$ timedatectl
Will see the local time zone is in use in the Warning section2. make windows use UTC timecheck here: http://ubuntuhandbook.org/index.php/2016/05/time-differences-ubuntu-1604-windows-10/
Create links
windows:mklink /j C:\Users\yll\Zotero\storage D:\dropbox\ZoteroStorage (latter is the target)mklink /j "C:\Users\yll\Zotero\storage" "D:\Google Drive\ZoteroStorage Mac:ln -s /Users/linglingyang/Dropbox/ZoteroStorage /Users/linglingyang/Zotero/storage
(use absolute path, first is the target)Ubuntu:
ln -s "/Users/linglingyang/Google Drive/ZoteroStorage" /Users/linglingyang/Zotero/storage(use absolute path, first is the target)
Install matlab .iso file
# Create a folder to use as a mount point.
$ sudo mkdir /media/mathworks# Mount the ISO to that folder under root permission
$ sudo mount -t iso9660 -o loop ~/Downloads/R2018b_glnxa64_dvd1.iso /media/mathworks# Run the installer script use sudo
$ sudo /media/mathworks/install# installing..........
# Note: check 'Create symbolic links to MATLAB scripts in: '# mount the second .iso
$ sudo umount /media/mathworks
$ sudo mount -t iso9660 -o loop ~/Downloads/R2018b_glnxa64_dvd2.iso /media/mathworks/
Terminator terminal manager
$ sudo apt-get install terminator
add a directory to the $PATH
Edit .bashrc
in your home directory and add the following line:
$ export PATH="/path/to/dir:$PATH"// examine the value environment variables
echo $PATH
.bashrc
need to be sourced or logout/login (or restart the terminal) for the changes to take effect. To source your .bashrc
, simply type
$ source ~/.bashrc
Configure Multiple monitors (xrandr)
$ xrandr --listmonitors// set DP-5 as the primary display
$ xrandr --output DP-5 --primary // set DP-3 to be right of HDMI-0
$ xrandr --output DP-3 --right-of HDMI-0// turn off the monitor
$ xrandr --output DP-3 --off// turn back the monitor
$ xrandr --output DP-5 --auto
Color good for Eyes:
(R: 199, G: 237, B: 204) (#C7EDCC)
Using DPT-RP1 in Ubuntu
package: https://github.com/janten/dpt-rp1-py
Installation
$ pip3 install dpt-rp1-py
Basic Usage
// register the dpt-rp1 device (only need run once)
$ dptrp1 register
// list all documents on the device
$ dptrp1 list-documents// help
$ dptrp1 -h// get help for the upload command
$ dptrp1 help upload// uploading a document to the reader
$ dptrp1 upload ~/Desktop/scan.pdf
GNOME Shell Extensions
tool Tweaks
add extension using browse or command