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
Subscribe to:
Posts (Atom)