顯示具有 Develop 標籤的文章。 顯示所有文章
顯示具有 Develop 標籤的文章。 顯示所有文章

2019年3月19日 星期二

Build up the AirSlim develop environment based on Unreal Engine

AirSim is a simulator for drones, cars and more, built on Unreal Engine

Requirement:
* NV 1050 TI graphic card
* NVIDIA cuda toolkit
* Windows 8.1 SDK
* Visual Studio 2017 community version
* Disk space: at least 25 GB

GO ...

1. Download and install the Visual Studio 2017 community from MS official website. You must select "Desktop development with C++" item.
2. Download and install the Windows 8.1 sdk from MS official website.
3. Download and install the NVIDIA cuda toolkit from website.

Install Unreal Engine and AsiaSim
1. Download the Epic Games Launcher.
2. Run the Epic Games Launcher, open the Library tab on the left pane.
3. Install the UE latest version.
4. Start  the x64 Native Tools Command Prompt for VS 2017 console on menu
5. Clone the repo: git clone https://github.com/Microsoft/AirSim.git and then go to the AirSim working directory
6. Open the half.h by notepad airsim-master\airlib\deps\eigen3\src\core\arch\cuda\ sub folder
7. Save as the half.h to half.h as Unicode version.
8. Switch to Airsim-master folder
9. Run build.cmd in command line. This will create ready plugin. You can drop up to any UE project.

1. Launch the Unreal Engine Editor shortcut
2. Create the new project in BluePrint tab using Vehicle template. Set up the project name as vehicle_temp
3. Add C++ class on menu bar\ File\ New C++ Class
4. Select the None item, set up the class name as temp
5. Copy AirSim plugins folder from AirSim-Master\ Unreal subfolder to UE project folder.
   # copy air-master\ Unreal\Plugins to C:\Users\%username%\Unreal Projects\vehicle_temp
6. Close the Visual Studio 2017 and then re-open it again.
7. Right click the vehicle_temp UE project file and then select the "Generate Visual Studio project files" item. PS: Select Unreal Engine Version as 4.20 or Double click the UE4 project executable icon
8. UE4 will be launched automatically after compiled.
9. You can see the AirSlim plugin is installed on PlugIn manager.
10. Open your VS solution file by VS 2017
11. Open the xxx.uproject file
12. You can see AirSim is enabled in plugin module.

If AirSim is not enabled, please follow these scenario to edit.
1.Open the vehicle_temp.uproject file adding the following strings.
    In plugins segment:
    {       "Name":"AirSim",       "Enable":"true",     } 
    In Modules segment last line:
"AdditionalDependencies": [
     "AirSim"
]
2. Save the project and then exit.
3. Right click the vehicle_temp UE project file and then select the "Generate Visual Studio project files" item. PS: Select Unreal Engine Version as 4.20 or Double click the UE4 project executable icon

2016年11月9日 星期三

Run Android CTS on Chromebook

[Memo] Run Android CTS on Chromebook

PC: (Ubuntu 16.04 LTS)
1. Download the openjdk-8-jre using
    # apt install openjdk-8-jre
2. Install adb driver
3. Connect to Chromebook over IP with port 22 using commands
   # adb connect [Chromebook IP]:22
4. Check API version using commands
    # adb shell getprop ro.build.version.sdk
5. Check Chromebook architecture using commands
    # adb shell getprop ro.product.cpu.abilist
6. Go to Android CTS Download official website (lnk) and select your Chromebook architecture
    and API version.
    For Example. ARM or x86 
7. Unzip the android CTS and then change to folder "android-cts/ tools"
8. Run CTS without reboot
   # ./cts-tradefed
   # run cts --plan CTS-TF --disable--reboot

Chromebook:
1. Enter to Developer mode and change to root account
2. Go to Browser\ Settings\ Android options
3. Enable Unknown resources in Chrome Settings > App Settings > Security
4. Enable Developer options from Chrome Settings\ Android options\ Developer options
5. Enable Bluetooth/ Location/ Wi-Fi
6. Set up developer features and enable disk-write access for firewall settings changes:
   # /usr/libexec/debugd/helpers/dev_features_rootfs_verification
:  # reboot
7. Connect the internet connection over USB adapter or wireless
8. Get the Chromebook IP address.
9. Install the KeepAwake Plug-in from Chrome Browser extension.

2016年11月8日 星期二

Android 7 CTS (ARM)

[Memo] Record how to setup and run the Android Device environment and Host

0. Download the Android CTS (ARM) version from its official website.
1. apt install -y openjdk-8-jre aapt
2. Insert the external SD card if needs
3. Restore the factory data
4. Enable Development mode
5. Install the CtsAdminApp.apk via adb connection
    # adb install -r -g android-cts/testcases/CtsAdminApp.apk
6. Activate all of  android.deviceadmin.cts.CtsDeviceAdmin from Android Devices\ Settings\ Security\ Select device administrators.
7. Enable Stake awake/ USB debugging/ in the Developer Options.
8. Disable Verify App over USB in the Developer Options
9. Change to Android CTS working directory. android-cts/tools/
10. ./cts-tradefed

Notice:
Don't download android-media-files and copy media files to Android Device manually. 
If you do it, CTS will show error message as 'Not all target preparation steps completed '

## run cts -plan everything 
## help 


2016年9月5日 星期一

Single Root I/O Virtualization (SR-IOV)。SR-IOV為PCI-SIG標準,允許PCIe的I/O裝置以多個實體與虛擬裝置呈現。Physical function (PF)—網路卡的每個實體埠至少會有一個PF。在某些情況下,網路卡的每個實體埠可以分割為四個通訊埠之多。以這個例子來說,每個通訊埠可以有四個PF,或說每個帶有兩個實體埠的網路卡總共可以有八個PF。最關鍵的差異在於PF擁有完整的組態能力。它們與hypervisor息息相關,而且可以像實體裝置一樣被管理。
.Virtual function (VF (VFC))--VF與虛擬機器有關,在I/O資料流的處理上是受限的-主要是在移動資料上。它們不支援實體裝置的管理。支援的VF數量也各不相同,通常每片實體網路卡會有64個VF左右。

雖然SR-IOV標準是套用在網路與儲存裝置的I/O上,但目前與預期的實作執行皆僅止於網路上。對虛擬伺服器會造成影響的效能,大都集中在乙太網路的流量上,一般來說它所產生的I/O需求量最大,且使用最多的伺服器資源。儲存裝置I/O 極少使用在這上面,而且多半都能達到滿載的速度。 (摘錄自http://www.runpc.com.tw/content/content.aspx?id=108644)
實做:
1. 移除現有的 igb driver 
# modprobe -r igb
2. Load driver and then check if the NIC adapter support the SR-IOV function or not
# modprobe igb  
# lspci |grep -i intel | grep -i network
Setup the VFS in the NIC adapter
#modprobe igb max_vfs=64 (Set up the 64 VF)
#modprobe igb max_vfs=0,20,0,20   (Set up the 10 VF at the NIC adapter 1&2 , Port 2)
For vmware esxi server (5.5 or latest version)
# modprobe igbex  max_vfs=0,20,0,20
Check the behavior is valid
# esxcfg-module -g ixgbe
# lspci |egrep -i intel|virtual

2015年8月25日 星期二

How to pack the python source code with data files into one file by Pyinstaller

In your source code, add the res_path(cpath) function as follows:

:fwi.py
def res_path(cpath):
    try:
        base_path = sys._MEIPASS
    except Exception:
        base_path = os.path.abspath(".")
    return os.path.join(base_path,cpath)

[unpack mode]
res_path("app")   => Show the current path with app program 
ex. /opt/app

[After pack]
res_path("app")   => show the _MEIPASS folder path with app program
ex. /tmp/_MEIPASS/app

PS: You must used res_path function with fulled path in your python code. If you want to pack your python code.

Add your data files into fwi.spec files
:fwi.spec 
+ a.datas = [('smartctl','./source/smartctl','DATA'),('hdparm','./source/hdparm','DATA')]

Pack by pyinstaller:
python pyinstaller.py --onefile fwi.spec

2015年7月11日 星期六

Return value from function in shell script -- bash

Note the method to get the return value from function in shell script (bash)

#!/bin/bash 
#function 
func()
{
     num=100
     echo ${num}
}

# main 
res=$(func)    # Execute the function -- func and then get the return value


2011年10月11日 星期二

Android Emulator問題 – 執行avd時出現hint use @foo 訊息

[Linux 筆記] Android Emulator問題 – 執行avd時出現hint use @foo 訊息
使用Android Emulator 模擬器, 創建任一個AVD文件啟動後出現 ..
[2011-10-11 10:24:28 - Emulator] invalid command-line parameter: ROMs\Android\android-sdk-windows\tools/emulator-arm.exe.
[2011-10-11 10:24:28 - Emulator] Hint: use '@foo' to launch a virtual device named 'foo'.
[2011-10-11 10:24:28 - Emulator] please use -help for more information

之前在其他電腦執行都是正常的 ..  後來在網頁看到原因 發現原來是目錄本身不可以存在空格
https://code.google.com/p/android/issues/detail?id=18317
原來是SDK安裝在"Toshiba ROMs"目錄底下,Toshiba跟ROMs中間的空格在作怪。
解決方法:把目錄名稱中的空格拿掉後 重新指向路徑, 就正常了

2011年9月30日 星期五

[Linux 筆記] How to mount the USB storage device


1.          Plug the USB storage device into the Desktop system
2.          Check if the system had detected the storage device [Basic]
dmesg
PS: 在display message 中就會出現類似以上的訊息, 包含容量, 規格, 及分割區訊息
      * Unix or Unix like 的作業系統都會主動把磁碟區位置映設到特定的目錄上頭
         EX: Pen drive 的磁碟機 + 分割區1,  在這可能被識別為 
                /dev/sdb1 [磁碟機名稱 + 分割區號碼]
3.          Check if the system had detected the storage device [Advanced]
ls /dev/disk/by-id /dev/disk/by-path /dev/disk/by-uuid
PS: 除了driver information 可以得到資料外, 我們也可以從/dev/disk 目錄下頭得到storage device相關的資訊
4.          Mount the storage device automatically and then list the folder data
PS: 系統自動掛載的磁碟分割區會被映設在/media/[名字取決於其uuid]  
     目錄內
5.          Mount the storage device into the system manually
PS: 若不知道有幾個分割區, 可以在打完磁碟區後按下Tab 鍵連續兩次, OS就會秀出有幾個分割區可供掛載

6.          Check if the storage device had been mounted
df | tail -1
7.          Un-mount the storage device safely
umount /dev/sdb1
PS: 不建議使用 umount –a 選項去un-mount device, 因為用這方式容易把非相關的裝置一起安全移除XD

2011年9月27日 星期二

[Linux 筆記] zip 壓縮第二層目錄的方法

zip –r [壓縮的檔名.zip] [來源目錄名稱]
ex. zip log.zip First

First
  + ---- Second

[Linux筆記] Configure the Finger Print under Fedora 9

How to configure the Finger Print under the Fedora 9?

1. Connect the Ethernet cable to the system
2. Open the Terminal
3. yum list
4. yum -y install hwbrowser.noarch
5. yum -y install pam_fprint.i386
6. yum -y install fprint_demo.i386
7. :/etc/pam.d/system-auth    (Login Screen setting)
   + auth   sufficient pam_auth.so

[Linux筆記] BT USB Module cannot be loaded automatically [Embedded System]

After plugging the Microsoft IntelliMouse for Bluetooth USB dongle into the USB port 1 of the Intel D955XBK motherboard system, the btusb of kernel module loaded automatically.

The btusb of kernel module CANNOT be loaded automatically.

Therefore, this is the btusb of kernel module does NOT load issue.

How to pass your CEH v11 exam quickly ?

1. You must buy the old CEH v11 exam under the online shopping platform. such as shopee. Select the 1st SEO buyer.  2. Create the practice t...