git apply patch from another repository

$ git --git-dir=../<some_other_repo>/.git format-patch -k -1 --stdout <commit SHA> | git am -3 -k Source: http://stackoverflow.com/questions/6658313/generate-a-git-patch-for-a-specific-commit

August 14, 2016 · SergeM

terminal setup in linux mint

Installation sudo apt-get install tmux Commands In tmux, hit the prefix ctrl+b (my modified prefix is ctrl+a) and then: ###Sessions :new<CR> new session s list sessions $ name session ###Windows (tabs) c create window w list windows n next window p previous window f find window , name window & kill window Panes (splits) % vertical split " horizontal split o swap panes q show pane numbers x kill pane + break pane into window (e....

August 7, 2016 · SergeM

Fix boot record after moving linux mint partitions to another disk

Copying partition is straightforward. Made using gparted. Create bootable USB stick (Startup disk creator in Linux mint), boot from it. Assume we have following partitions: boot /sdb1 (don't really know how it works) root /sdb2 home /sdb3 Do sudo mount /dev/sda2 /mnt ## if you have boot partition: # sudo mount /dev/sda1 /mnt/boot sudo grub-install --root-directory=/mnt /dev/sda Source of GRUB instructions

July 16, 2016 · SergeM

Mount yandex webdav on local dir

apt-get install davfs2 mkdir /mnt/yandex.disk mount -t davfs https://webdav.yandex.ru /mnt/yandex.disk/ # check: df -h /mnt/yandex.disk/

July 16, 2016 · SergeM

how torch stores images

require('image') imgPath = "image.jpg" img = torch.Tensor(1, 3, imgDim, imgDim) img[1] = image.load(imgPath, 3, byte) image is stored as float, conversion is (intensity/255.). stored top->bottom, line by line. format RGB. display require 'gnuplot' gnuplot.figure(1) gnuplot.imagesc(img[1]) Torch<->numpy dictionary https://github.com/torch/torch7/wiki/Torch-for-Numpy-users

June 26, 2016 · SergeM

Installing torch for miniconda

I got the error while installing torch for miniconda. Something like Linking CXX executable mshrable ~/miniconda/envs/py27/lib/libreadline.so.6: undefined reference to `BC' ~/miniconda/envs/py27/lib/libreadline.so.6: undefined reference to `tgetnum' ~/miniconda/envs/py27/lib/libreadline.so.6: undefined reference to `PC' ~/miniconda/envs/py27/lib/libreadline.so.6: undefined reference to `tputs' ~/miniconda/envs/py27/lib/libreadline.so.6: undefined reference to `tgetent' ~/miniconda/envs/py27/lib/libreadline.so.6: undefined reference to `tgetflag' ~/miniconda/envs/py27/lib/libreadline.so.6: undefined reference to `tgoto' ~/miniconda/envs/py27/lib/libreadline.so.6: undefined reference to `UP' ~/miniconda/envs/py27/lib/libreadline.so.6: undefined reference to `tgetstr The same was for python3 and python2 environments. The solution (at least for python 2) was to remove miniconda from path and compile torch with the system python....

June 26, 2016 · SergeM

compile dlib for miniconda

Activate miniconda environment (my environment is called py3): 1 source activate py3 Produce initial steps from the readme: 1 2 3 4 5 cd examples mkdir build cd build cmake .. cmake --build . --config Release inside function build_dlib() of file setup.py add the highlighted code: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 if platform_arch == '64bit' and sys.platform == "win32": # 64bit build on Windows #....

June 25, 2016 · SergeM

Mount windows shares in linux

Use sudo if needed Mount mkdir /mnt/share mount -t cifs //windows_machine_ip/share_name -o username=user,password=urPassword /mnt/share To allow write access one has to specify owning user and group: sudo mount -t cifs //windows_machine_ip/share_name -o uid=$(id -u),gid=$(id -g),user=,password= /mnt/share Unmount umount /mnt/shares

June 19, 2016 · SergeM

deep learning

Rest API example for tensorflow. It works: demo Trained models for tensorflow TF-slim - high-level API of TensorFlow for defining, training and evaluating complex models. Doesn’t work for python 3 (see here) VGG16 and VGG19 in Tensorflow. One more here. And one more Deep learning for lazybones Inception-like CNN model based on 1d convolutions http://arxiv.org/pdf/1512.00567v3.pdf Chat (in russian) http://closedcircles.com/?invite=99b1ac08509c560137b2e3c54d4398b0fa4c175e

June 3, 2016 · SergeM

Autocomplete from the history in terminal

create a file .inputrc in your home directory and put there "\e[A": history-search-backward "\e[B": history-search-forward set show-all-if-ambiguous on set completion-ignore-case on # display possible completions using different colors to indicate their file types set colored-stats On TAB: menu-complete Restart your terminal. Now you can autocomplete from history using Up and Down keys. Source

June 2, 2016 · SergeM