1. Install Ubuntu Server 1804
2. Install pip3 & python3-dev
# sudo apt install python3-pip python3-dev
3. update pip
# python3 -m pip install -U pip
4. logout and login
5. Install virtualenvwrapper
# python3 -m pip install --user virtualenvwrapper
6. add variable in .bashrc
export VIRTUALENVWRAPPER_PYTHON=$(which python3)
7. include virtualenvwrapper in .bashrc
Add following in tail of .bashrc
# set ~/.local/bin in PATH
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
# virtualenvwrapper
source $(which virtualenvwrapper.sh)
8. logout & login again
9. create a virtualenv
# mkvirtualenv env1
for APT proxy setting: /etc/apt/apt.conf
Acquire::http::Proxy "http://yourproxyaddress:proxyport";
for pip proxy setting per-user: ~/.config/pip/pip.conf
[global]
proxy = http://127.0.0.1:3128
https://medium.com/@gitudaniel/installing-virtualenvwrapper-for-python3-ad3dfea7c717
個人在學習Linux過程當中的個人筆記,提供個人及有需要的人查閱,若有錯誤歡迎提供指正,謝謝。 This Blog recorded notes about my learning Linux and provides myself and others reference. If there are any incorrect information, welcome to leave a message to correct me, Thanks.
2018年5月18日 星期五
2018年5月16日 星期三
Increase upload file size limit of TestLink
Edit /etc/php.ini file
upload_max_filesize = 100M
max_execution_time = 600
Edit
/var/html/www/testlink/config.inc.php
$tlCfg->import_file_max_size_bytes (config.inc.php): 8192000
$tlCfg->import_max_row (config.inc.php): 100000
$tlCfg->repository_max_filesize (config.inc.php): 8 // MB
restart Apache
service apache2 restart
or
service httpd restart
upload_max_filesize = 100M
max_execution_time = 600
Edit
/var/html/www/testlink/config.inc.php
$tlCfg->import_file_max_size_bytes (config.inc.php): 8192000
$tlCfg->import_max_row (config.inc.php): 100000
$tlCfg->repository_max_filesize (config.inc.php): 8 // MB
restart Apache
service apache2 restart
or
service httpd restart
2018年3月29日 星期四
Use mkvirtualenv of virtualenvwrapper-win to create diffenrent Python version of env
應用Python的virtualenv和virtualenvwrapper可方便建立Python的virtual enviroment,方便在不同的environment切換,各env有獨立的pip list和Python版本
首先要安裝Python (Linux已有內建Python2)
- Windows安裝完後要將PATH設定包含到C:\Python27
- 安裝virtualenv, pip install virtualenv
- 安裝virtualenvwrapper或是virtualenvwrapper-win (Windows版)
- 建立virtualenv
- mkvirtualenv env01
- 查看pip list, pip list
- 跳出env01, deactivate
- 查看目前有多少virtualenv, workon
- 進入virtualenv env01, workon env01
- 若要建立Python3的virtualenv, 先安裝Python3
- 確認Pyhon3的python.exe位置 (C:\Users\Jack_Lin\AppData\Local\Programs\Python\Python35\python.exe), 若是Linux, 可用which python3指令查看
- 建立一Python3的virtualenv
- mkvirtualenv -p C:\Users\Jack_Lin\AppData\Local\Programs\Python\Python35\python.exe python35
- python -V
2018年2月8日 星期四
ipmitool ipmi-raw ipmiutil cmd (icmd) raw command format
ipmitool:
ipmitool -I lanplus -H 192.168.1.123 -U admin -P password raw 0x06 0x01
ipmi-raw:
ipmi-raw -D LAN_2_0 -h 192.168.1.123 -u admin -p password 0x00 0x06 0x01
icmd:
icmd -J 3 -N 192.168.1.123 -U admin -P password 00 20 18 01
ipmitool -I lanplus -H 192.168.1.123 -U admin -P password raw 0x06 0x01
ipmi-raw:
ipmi-raw -D LAN_2_0 -h 192.168.1.123 -u admin -p password 0x00 0x06 0x01
icmd:
icmd -J 3 -N 192.168.1.123 -U admin -P password 00 20 18 01
redfishtool on ubuntu
1. apt-get update
2. apt-get install python python3 python-pip
3. make a file /etc/pip.conf if you need proxy setting for pip
[list]
format=columns
[global]
trusted-host = pypi.python.org
proxy = http://127.0.0.1:3128
4. pip install virtualenvwrapper
5. login with normal user (not root)
6. add one line in tail of .bashrc
source $(which virtualenvwrapper.sh)
7. re-login
8. create a virtualenv of python3
mkvirtualenv -p $(which python3) redfish
9. pip install redfishtool
redfishtool commands:
redfishtool -u admin -p password -r 192.168.1.123 -S Always System
redfishtool -u admin -p password -r 192.168.1.123 -S Always System -a
redfishtool -u admin -p password -r 192.168.1.123 -S Always raw /redfish/v1/xxxx/xxxx
======
For Ubuntu 17.10, before step5
Need to add ~/.local/bin to PATH, edit ~/.bashrc
# set PATH ~/.local/bin
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
2. apt-get install python python3 python-pip
3. make a file /etc/pip.conf if you need proxy setting for pip
[list]
format=columns
[global]
trusted-host = pypi.python.org
proxy = http://127.0.0.1:3128
4. pip install virtualenvwrapper
5. login with normal user (not root)
6. add one line in tail of .bashrc
source $(which virtualenvwrapper.sh)
7. re-login
8. create a virtualenv of python3
mkvirtualenv -p $(which python3) redfish
9. pip install redfishtool
redfishtool commands:
redfishtool -u admin -p password -r 192.168.1.123 -S Always System
redfishtool -u admin -p password -r 192.168.1.123 -S Always System -a
redfishtool -u admin -p password -r 192.168.1.123 -S Always raw /redfish/v1/xxxx/xxxx
======
For Ubuntu 17.10, before step5
Need to add ~/.local/bin to PATH, edit ~/.bashrc
# set PATH ~/.local/bin
if [ -d "$HOME/.local/bin" ] ; then
PATH="$HOME/.local/bin:$PATH"
fi
2018年2月7日 星期三
Install freeipmi on ubuntu
1. Download source from https://www.gnu.org/software/freeipmi/
2. install libgcrypt-dev
# sudo apt-get install libgcrypt-dev
3. compiler
# tar zxvf freeipmi-1.6.1.tar.gz
# cd freeipmi-1.6.1
# ./configure
# make
# sudo make install
4. make the change permanent you can add
https://unix.stackexchange.com/questions/67781/use-shared-libraries-in-usr-local-lib
2. install libgcrypt-dev
# sudo apt-get install libgcrypt-dev
3. compiler
# tar zxvf freeipmi-1.6.1.tar.gz
# cd freeipmi-1.6.1
# ./configure
# make
# sudo make install
4. make the change permanent you can add
/usr/local/lib to /etc/ld.so.conf (or something it includes) and run ldconfig as root.https://unix.stackexchange.com/questions/67781/use-shared-libraries-in-usr-local-lib
2018年1月24日 星期三
docker named volume path
Located at host's /var/lib/docker/volumes/
https://stackoverflow.com/questions/36312699/chown-docker-volumes-on-host-possibly-through-docker-compose/36321403#36321403
https://github.com/CWSpear/local-persist
https://stackoverflow.com/questions/36312699/chown-docker-volumes-on-host-possibly-through-docker-compose/36321403#36321403
https://github.com/CWSpear/local-persist
訂閱:
文章 (Atom)