Skip to content

Miscellaneous

Luke Chen edited this page Jul 9, 2021 · 1 revision

apt proxy

sudo vi /etc/apt/apt.conf
Acquire::http::proxy "http://<proxy_srv>:<port>/";
Acquire::https::proxy "http://<proxy_srv>:<port>/";
Acquire::ftp::proxy "http://<proxy_srv>:<port>/";

# Acquire::http::Proxy "false";

Python3

http://ubuntuhandbook.org/index.php/2017/07/install-python-3-6-1-in-ubuntu-16-04-lts/

Setup default python

sudo update-alternatives --install /usr/bin/python python /usr/bin/python3 1
sudo update-alternatives --install /usr/bin/python python /usr/bin/python2.7 10
sudo update-alternatives --config python

Switch between python3 versions

sudo update-alternatives --config python3

Set default "python"

vi ~/.bashrc
vi ~/.bash_aliases
alias python=python3

Chrome

Syncing

Windows

Open RegEdit
Navigate to HKEY_LOCAL_MACHINE\SOFTWARE\Policies\Google\Chrome
Change SyncDisabled to 0
Change RestrictSigninToPattern to "" (empty string: don't include quotes)

Linux

Go to /etc/opt/chrome/policies/managed/master_preferences.json

Setup tightvnc

https://www.digitalocean.com/community/tutorials/how-to-install-and-configure-vnc-on-ubuntu-18-04

vncserver
vncserver -kill :1
ls ~/.vnc/xstartup

Install gcc-5 on Ubuntu 20.04

echo "deb http://old-releases.ubuntu.com/ubuntu zesty main" | sudo tee /etc/apt/sources.list.d/zesty.list
sudo apt-add-repository -r universe
sudo apt update
sudo apt install gcc-5

To install build essential

sudo apt-get install cmake
sudo apt-get install build-essential
sudo apt-get install libprotobuf-dev protobuf-compiler mosquitto-dev libmosquittopp-dev libjsoncpp-dev uuid-dev

ag

Search by file name pattern

ag -G '\.ts$' '\-\-'
ag -G 'view-descriptor\.json$' '\"id\".*-'

Search by extension

ag --js '\-\-'

Search in a path:

ag QT_HMI pas_debug_log.txt

QML text with rich text tags

text: qsTr("<font color=\"#00FF00\">Add Phone</font>")

Check if java is 64 bits

java -version -d64

check symbols

nm -s -D libfreetype.so.6.17.1 |grep FT_Get_Var_Design_Coordinates

kill sigsegv

kill -sigsegv PID

/dev/null, stdout 1 and stderr 2

https://linuxhint.com/what_is_dev_null/

Check folder size

du --human-readable --apparent-size

Clone this wiki locally