hw-1

osx install torch and fast neural style

###osx install torch and fast neural style

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
<br /> lua/5.1/hdf5/ffi.lua:56: ')' expected near '_close' at line 1478

Edit ffi.lua line 44,
change
local process = io.popen("gcc -E " .. headerPath) -- TODO pass -I
to
local process = io.popen("gcc -D '_Nullable=' -E " .. headerPath) -- TODO pass -I.

luarocks install hdf5
brew install hdf5@1.8


export LDFLAGS="-L/usr/local/opt/hdf5@1.8/lib"
export CPPFLAGS="-I/usr/local/opt/hdf5@1.8/include"


hdf5._config = { HDF5_INCLUDE_PATH = "/usr/local/opt/hdf5@1.8/lib", HDF5_LIBRARIES = "/usr/local/opt/hdf5@1.8/lib/libhdf5.dylib;/usr/local/lib/libsz.dylib;/usr/lib/libz.dylib;/usr/lib/libdl.dylib;/usr/lib/libm.dylib" }


// wget http://msvocds.blob.core.windows.net/coco2014/train2014.zip
// wget http://msvocds.blob.core.windows.net/coco2014/val2014.zip
wget http://images.cocodataset.org/zips/train2014.zip
wget http://images.cocodataset.org/zips/val2014.zip

jar xvf train2014.zip
jar xvf val2014.zip

python scripts/make_style_dataset.py \
--train_dir train2014 \
--val_dir val2014 \
--output_file data/ms-coco-256.h5

iPhone USB tethering working on raspberry

iPhone USB tethering working on raspberry

1
2
3
4
5
6
7
8
9
sudo apt -o Acquire::http::proxy="http://172.24.1.149:8118"  install -y ipheth-utils libimobiledevice-dev libimobiledevice-utils usbmuxd ipheth-utils gvfs
idevicepair unpair && idevicepair pair

ifuse
sudo apt-get install gvfs ipheth-utils
sudo apt-get install libimobiledevice-utils gvfs-backends gvfs-bin gvfs-fuse
sudo apt-get install ifuse

ifconfig -s

ubuntu install nginx and srs

ubuntu install nginx and srs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
//for Ubuntu
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update -y
sudo apt-get install -y gcc-5 g++-5
sudo update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-5 60 --slave /usr/bin/g++ g++ /usr/bin/g++-5


git clone https://github.com/ossrs/srs.git
cd srs/trunk
./configure --with-nginx
make

./objs/srs -c conf/http.hls.conf

for((;;)); do \
ffmpeg -re -i /home/ubuntu/Rogue\ One\ -\ A\ Star\ Wars\ Story\ -\ Trailer\ 2.mp4 \
-vf scale=360:-2 -c:v libx264 -acodec copy \
-f flv -y rtmp://172.104.12.1:1935/live/livestream; \
sleep 1; \
done

CgBI file format

The CgBI file format, thus named for its extra header, is Apple’s proprietary extension to the PNG[1] image format.

1
2
3
4
5
6
Encoding
Apple's modified pngcrush (xcrun -sdk iphoneos pngcrush -iphone)
pincrush
Decoding
Apple's modified pngcrush (xcrun -sdk iphoneos pngcrush -revert-iphone-optimizations)

How to use your iPhone’s internet connection on your Ubuntu machine via USB

How to use your iPhone’s internet connection on your Ubuntu machine via USB

1
2
sudo apt install ipheth-utils libimobiledevice-dev libimobiledevice-utils
idevicepair unpair && idevicepair pair

Then unplug your phone and plug it back in. When you plug it back in, a notification should pop up (on your Ubuntu system) saying it has connected to a wired network. (If the notification does not appear, make sure Personal Hotspot is enabled on your phone.)

frida-cycript install osx

frida-cycript install osx

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
pip3 install meson
brew install ninja

dx command not found?
brew tap caskroom/cask
brew cask install android-sdk

sdkmanager --update
sdkmanager "platforms;android-25" "build-tools;25.0.2" "extras;google;m2repository" "extras;android;m2repository"
sdkmanager --licenses

link dx to /usr/bin/dx


node module error?
sudo port install npm3

git clone https://github.com/nowsecure/frida-cycript.git
cd frida-cycript
git submodule init
git submodule update

meson build
ninja -C build

caffe error

caffe error

1
2
3
4
5
erro datum_channels > 0 (0 vs. 0) #5114
create db with A total of 0 images.

channel mistch
picture gray or RGB ?

osx 10.13.6 install caffe

osx 10.13.6 install caffe

1
2
3
4
5
6
7
8
9
10
11
12
13
14
osx caffe install
sudo port clean all
sudo port install py27-protobuf @2.6.1_2
//boost 1.67.0_1
brew install boost@1.67 hdf5@1.10

git clone https://github.com/BVLC/caffe.git
cd caffe
cp Makefile.config.example Makefile.config

CPU_ONLY := 1
INCLUDE_DIRS := $(PYTHON_INCLUDE) /usr/local/include /opt/local/include
LIBRARY_DIRS := $(PYTHON_LIB) /usr/local/lib /usr/lib /opt/local/lib
OPENCV_VERSION := 3