Pretty git history with branches in command line

Show git history with branches git log --graph --abbrev-commit --decorate --format=format:'%C(bold blue)%h%C(reset) - %C(bold green)(%ar)%C(reset) %C(white)%s%C(reset) %C(dim white)- %an%C(reset)%C(bold yellow)%d%C(reset)' --all Less nice and shorter git log --graph --abbrev-commit --decorate --oneline --all See also: Git cheat sheet

January 28, 2017 · SergeM

Correct way of running long tasks in Flask

Key to the answer is Celery. Good post: Using Celery With Flask Sources See also: Making an asynchronous task in Flask Sharing memory and using multiprocessing along with gunicorn seem to be wrong solutions.

January 23, 2017 · SergeM

Machine learning links

Super harsh guide to machine Learning Super harsh guide to machine learning (reddit) First, read fucking Hastie, Tibshirani, and whoever. Chapters 1-4 and 7. If you don’t understand it, keep reading it until you do. You can read the rest of the book if you want. You probably should, but I’ll assume you know all of it. Take Andrew Ng’s Coursera. Do all the exercises in Matlab and python and R....

January 19, 2017 · SergeM

Image processing in Python

Image search using elastic search Comparison of Image Search Performance using different kinds of vectors Plugin for elastic search Personalizing image search with feature vectors and Lucene (video) Operations on images in python How to set thresholds for Canny edge detector in openCV Zero-parameter, automatic Canny edge detection with Python and OpenCV 1 2 3 4 5 6 7 8 9 10 11 def auto_canny(image, sigma=0.33): # compute the median of the single channel pixel intensities v = np....

January 15, 2017 · SergeM

Set up HP 1020 printer in Linux Mint 18 / Ubuntu

Using open source drivers Follow the instruction from http://foo2zjs.rkkda.com/ or use my clone on git https://github.com/serge-m/foo2zjs.git: Clone the repo git clone https://github.com/serge-m/foo2zjs.git foo2zjs cd foo2zjs Compile: make Get extra files from the web, such as .ICM profiles for color correction, and firmware. Select the model number for your printer: ./getweb 1020 # Get HP LaserJet 1020 firmware file Install driver, foomatic XML files, and extra files: sudo make install Configure hotplug (USB; HP LJ 1000/1005/1018/1020)....

January 9, 2017 · SergeM

Pelican Hints

Articles and pages Format of dates Generate archives per year and month see MONTH_ARCHIVE_SAVE_AS To check out: Adding period archives to Pelican

January 8, 2017 · SergeM

Shell commands (page moved)

Page moved here

January 8, 2017 · SergeM

Add service in ubuntu

Create a file for service your-service touch /etc/systemd/system/your-service.service Let’s assume you want to run docker container there. Put following text in the file: [Unit] Description=YourService After=docker.service Requires=docker.service [Service] TimeoutStartSec=0 Restart=always ExecStartPre=-/usr/bin/docker stop %n ExecStartPre=-/usr/bin/docker rm %n ExecStart=/usr/bin/docker run -d -p 8080:8080/tcp --name %n your_docker_image [Install] WantedBy=multi-user.target Here we first stop and delete the docker container. If it doesn’t exist we continue (there is a “-” in before the command). Run...

January 8, 2017 · SergeM

OpenVPN server in cloud using docker

links: How To Run OpenVPN in a Docker Container on Ubuntu 14.04 OpenVPN for Docker Connection via OPenVPN is slow for https Try the following advice The udp connection is perfect with these parameters (in client config): mssfix 1200 tun-mtu 1200 DNS doesn’t work through VPN Symptoms: Openvpn connects, you can ping web sites by IP address, but you cannot ping them by name (like ping google.com) Solution: This is a bug that’s fixed in upstream NetworkManager....

January 7, 2017 · SergeM

Docker in Scaleway's vc1s Ubuntu Xenial

In ubuntu 16.04 image installed on VC1S server I was unable to install docker. It hangs/fails on installation or on any significant docker command like docker ps The error I got was Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details and level=error msg="devmapper: Unable to delete device: devicemapper: Can't set task name /dev/mapper/docker I switched to “docker” image where docker is preinstalled

January 5, 2017 · SergeM