Skip to content

Instantly share code, notes, and snippets.

barseghyanartur /
Last active Mar 18, 2021
ImageMagick convert DocX, PDF or ODT to PNG


convert -verbose -quality 100 -fill "rgba(255,255,255,1.00)" -density 300 -alpha off test.docx test_docx.png


convert -verbose -quality 100 -fill "rgba(255,255,255,1.00)" -density 300 -alpha off test.pdf test_pdf.png
barseghyanartur / git-pushing-multiple.rst
Created Feb 17, 2021 — forked from rvl/git-pushing-multiple.rst
How to push to multiple git remotes at once. Useful if you keep mirrors of your repo.
View git-pushing-multiple.rst

Pushing to Multiple Git Repos

If a project has to have multiple git repos (e.g. Bitbucket and Github) then it's better that they remain in sync.

Usually this would involve pushing each branch to each repo in turn, but actually Git allows pushing to multiple repos in one go.

If in doubt about what git is doing when you run these commands, just

barseghyanartur /
Created Jul 20, 2020
Show line numbers in nano

Open the nanorc file:

nano ~/.nanorc

Turn on line-numbers feature by pasting the following into the nanorc:

set linenumbers

Prepare database dump using mysqldump:

mysqldump -u [username] -p [databaseName] --compatible=postgresql --default-character-set=utf8 > database.sql

Clone mysql-postgresql-converter project:

git clone
openssl rand -base64 12 | cut -c1-12
for cont in $(podman ps -q); do podman exec -it ${cont} /bin/bash -c "pip install django-request-logging"; done
barseghyanartur /
Created Apr 22, 2020
Patch logging for django.db on the fly from terminal


import logging
logger = logging.getLogger('django.db')
logger.level = logging.DEBUG

Now we can:

HerrPi /
Last active Feb 8, 2020
Mercurial to Git repo conversion (hg-to-git)
shaypal5 / .travis.yml
Last active Aug 7, 2022
Comprehensive Python testing on Travis CI
View .travis.yml
language: python
# ===== Linux ======
os: linux
dist: xenial
- 2.7
- 3.6
- 3.7
- 3.8
- 3.9

Debugging Python within Docker

Often you need to run debugger within docker. It many cases it looks like this:

import pdb; pdb.set_trace()