cat t.txt | xargs | sed 's/;/\n/g'
Friday, August 12, 2016
How to get print from android makefile
Add below line to get print from android makefile
$(info "I want this print")
Delete single line from multiple files containing specific word
To delete line which contains alsa-lib word from all .xml file, use
for f in *.xml; do sed -i '/alsa-lib/d' $f ; done
How to change linux console/terminal column width
To change linux console/terminal column width use stty, e.g. to change width to 180 column use
stty cols 180
Tuesday, August 2, 2016
Tensorflow on Windows
Get tensorflow installed and working on Windows.
Download docker toolbox for windows from https://www.docker.com/products/docker-toolbox
Use default selections, once installed it will create few shortcuts on your desktop.
Click on "Docker Quickstart Terminal" shortcut on desktop
Now press Windows key + R and type cmd, it will open new command terminal. Enter following in terminal
Start docker using below command
check tensorflow, by typing following
Click "Oracle VM VirtualBox" shortcut on desktop.
Goto Settings-> "Shared Folders"
Click Folder+ Icon
Provide Folder Path, Folder Name, check Automount. e.g. I have folder name as dl_share
Now start docker by mounting share folder dl_share to /home/
docker-machine ssh default
docker run -it b.gcr.io/tensorflow/tensorflow:latest-develIf Its first time it will display following error and download it, which takes some time. Unable to find image 'b.gcr.io/tensorflow/tensorflow:latest-devel' locally latest-devel: Pulling from tensorflow/tensorflow
>>> import tensorflow as tf >>> msg = tf.constant("Hello, World") >>> sess = tf.Session() >>> print sess.run(msg) Hello, World >>>
To use windows shared folder with docker
docker-machine ssh default sudo mkdir /win-share sudo mount -t vboxsf dl_share /win-share docker run -it -v /win-share:/home b.gcr.io/tensorflow/tensorflow:latest-devel
Convert audio from one format to other using ffmpeg
./ffmpeg -i ~/sine_440Hz_2ch.wav -codec dts -strict -2 ~/sine_440Hz_2ch.dts
./ffmpeg -i ~/sine_440Hz_2ch.dts -vn -acodec copy -f matroska ~/sine_440Hz_2ch.mka
ffmpeg -i input.mp4 -vcodec copy -acodec copy output.mkv
./ffmpeg -i ~/sine_500Hz_2ch.wav -acodec ac3_fixed -ab 768k -ar 48000 test.ac3
./ffmpeg -i test.ac3 -vn -acodec copy -f matroska ~/sine_500Hz_2ch-ac3.mka
To grant all permission to android app
To grant all permissions to app, use -g as argument while installing with adb
adb install -g myapp.apk
Cross Compiling Linux kernel for ARM
git clone https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.gitTo get kernel-next branch clone
git clone https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
export PATH=$PATH:/path/to/linaro/binary/linaro/aarch64-unknown-linux-gnu_4.9-2014.05-01/bin
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- O=output defconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- O=output -j8
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- O=output menuconfig
make ARCH=arm64 CROSS_COMPILE=aarch64-unknown-linux-gnu- O=output savedefconfigThis will create defconfig file in output directory. Copy this file to your arch/arm64/configs directory
Subscribe to:
Posts (Atom)