星期一, 7月 18, 2022

CFRS

 / 

<input type="hidden" name="csrf" value"djaskl;fhasdkjkfhasd"/>


lighttpd.conf.template

setenv.add-response-header += ("set-Cookie" => "X-XSRF-TOKEN=sdfasdfasdf; SameSite=Strict; Secure; HttpOnly; Path=/")


星期一, 6月 27, 2022

CSRF web test

 https://edricteo.com/how-to-test-for-csrf/

https://security.love/CSRF-PoC-Genorator/

星期一, 5月 30, 2022

YOLOv4-tyny 42fps

 

https://edgenoon-ai.github.io/edge-devices/jetson-tx2-yolo-v3-v4-benchmark/

YOLOv3-tyny-prn4163.533.1%57.0
YOLOv4-tyny4166.940.2%42.0

AWS Embedded FOTA/Shadow

 



AWS IoT Over-the-air Update  v3.0.0
https://aws.github.io/aws-iot-device-sdk-embedded-C/202103.00/libraries/aws/ota-for-aws-iot-embedded-sdk/docs/doxygen/output/html/index.html#ota_memory_requirements

AWS IoT Device Shadow   v1.1.1
https://aws.github.io/aws-iot-device-sdk-embedded-C/202108.00/libraries/aws/device-shadow-for-aws-iot-embedded-sdk/docs/doxygen/output/html/shadow_design.html

 Embedded C 的 AWS IoT 裝置 SDK

https://docs.aws.amazon.com/zh_tw/iot/latest/developerguide/iot-sdks.html

星期三, 4月 20, 2022

Git to make release note

 #Git to make release note

1. git log --pretty=oneline --no-merges > rel.txt

2. cat rel.txt | awk '{"git describe --always $1" |& getline $1} {print}'

3. cat rel.txt | awk '{system("git describe --always "$1)} {print $0}'

星期四, 4月 14, 2022

pe42423 nrf52833 AOA AOD

 pe42423

https://devzone.nordicsemi.com/f/nordic-q-a/85732/antenna-switching-for-bluetooth-direction-finding

nwp_036.pdf

https://www.mouser.tw/datasheet/2/297/nRF52833_SoC_Product_Brief-1815256.pdf

https://infocenter.nordicsemi.com/index.jsp?topic=%2Fstruct_nrf52%2Fstruct%2Fnrf52833.html


星期日, 3月 27, 2022

How to install pytorch in tx2

 

 nvcc --version

nvcc: NVIDIA (R) Cuda compiler driver

Copyright (c) 2005-2021 NVIDIA Corporation

Built on Sun_Feb_28_22:34:44_PST_2021

Cuda compilation tools, release 10.2, V10.2.300

Build cuda_10.2_r440.TC440_70.29663091_0


cuda_10.2
python3.6

PyTorch for Jetson - version 1.10 now available

  • PyTorch v1.7 - torchvision v0.8.1

Install jetson pytorch: 
https://forums.developer.nvidia.com/t/pytorch-for-jetson-version-1-10-now-available/72048

--------------------------
pytorch
wget https://nvidia.box.com/shared/static/p57jwntv436lfrd78inwl7iml6p13fzh.whl -O torch-1.10.0-cp36-cp36m-linux_aarch64.whl sudo apt-get install python3-pip libopenblas-base libopenmpi-dev pip3 install Cython  pip3 install torch-1.7.0-cp36-cp36m-linux_aarch64.whl

---------------------
$sudo apt-get install libjpeg-dev zlib1g-dev libpython3-dev libavcodec-dev libavformat-dev libswscale-dev$
$git clone --branch v0.12.0 https://github.com/pytorch/vision torchvision # see below for version of torchvision to download
$ cd torchvision $ export BUILD_VERSION=0.8.1 # where 0.x.0 is the torchvision version $ python3 setup.py install --user
$ cd ../ # attempting to load torchvision from build dir will result in import error
$pip install 'pillow<7' # always needed for Python 2.7, not needed torchvision v0.5.0+ with Python 3.6

------------------

sudo apt-cache show nvidia-jetpack
It will show something like:

Package: nvidia-jetpack
Version: 4.4-b144
Architecture: arm64
Maintainer: NVIDIA Corporation

-------------------------------------

cuda version

$ cat /usr/local/cuda/version.txt

CUDA Version 10.2.300

-----------------------------------------

查看cudnn版本

ls /usr/local/cuda*
cat /usr/local/cuda/include/cudnn.h | grep CUDNN_MAJOR -A 2-------------------------------------workable pytorch in TX2 w/ python3.6 CUDA 10.2, jetpack 4.4https://developer.nvidia.com/embedded/downloads
----------------------------------

pip3 install --no-deps torchvision Collecting torchvision Using cached https://files.pythonhosted.org/packages/fb/01/03fd7e503c16b3dc262483e5555ad40974ab5da8b9879e164b56c1f4ef6f/torchvision-0.2.2.post3-py2.py3-none-any.whl Installing collected packages: torchvision Successfully installed torchvision-0.2.2.post3



星期一, 3月 07, 2022

CA intermediate ssl certificate

 https://www.thesslstore.com/blog/root-certificates-intermediate/



https://aboutssl.org/install-ssl-certificate-on-lighttpd-server/

星期六, 3月 05, 2022

斐波那契數列 Dynamic Programming

 

斐波那契數列 

Dynamic Programming

https://ithelp.ithome.com.tw/articles/10271832

Mutual Information Python

 


https://www.codeleading.com/article/31721058116/

  1. from sklearn import metrics as mr
  2. from scipy.misc import imread
  3. import numpy as np
  4. img1 = imread('1.jpg')
  5. img2 = imread('2.jpg')
  6. img2 = np.resize(img2, (img1.shape[0], img1.shape[1], img1.shape[2]))
  7. img1 = np.reshape(img1, -1)
  8. img2 = np.reshape(img2, -1)
  9. print(img2.shape)
  10. print(img1.shape)
  11. mutual_infor = mr.mutual_info_score(img1, img2)
  12. print(mutual_infor)


https://vimsky.com/zh-tw/examples/detail/python-method-sklearn.metrics.mutual_info_score.html