2018年6月21日 星期四

Robotframework 變數檔案

使用-V 參數

# robot -V vars.yaml a.robot

vars.yaml內容
BMC_IP: 172.16.1.16

For using "Library    Dialogs"
apt-get install python3-tk
pip intall tkinter

2018年5月18日 星期五

Setup Python3 develop environment on Ubuntu Server 1804

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

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

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)

  1. Windows安裝完後要將PATH設定包含到C:\Python27
  2. 安裝virtualenv, pip install virtualenv
  3. 安裝virtualenvwrapper或是virtualenvwrapper-win (Windows版)
  4. 建立virtualenv
    1. mkvirtualenv env01
  5. 查看pip list, pip list
  6. 跳出env01, deactivate
  7. 查看目前有多少virtualenv, workon
  8. 進入virtualenv env01, workon env01
  9. 若要建立Python3的virtualenv, 先安裝Python3
  10. 確認Pyhon3的python.exe位置 (C:\Users\Jack_Lin\AppData\Local\Programs\Python\Python35\python.exe), 若是Linux, 可用which python3指令查看
  11. 建立一Python3的virtualenv
    1. mkvirtualenv -p C:\Users\Jack_Lin\AppData\Local\Programs\Python\Python35\python.exe python35
    2. 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

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

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 /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