Skip to content

Instantly share code, notes, and snippets.

@barseghyanartur
barseghyanartur / instructions.md
Last active November 3, 2022 09:35
Install virtualenv wrapper on Linux (Ubuntu/Fedora)

Installation instructions

Install required Linux packages

On Ubuntu

sudo apt-get install python3-virtualenv
sudo apt-get install python3-setuptools
@barseghyanartur
barseghyanartur / imagemagick_convert_docx_pdf_odt_to_png.md
Last active March 18, 2021 15:03
ImageMagick convert DocX, PDF or ODT to PNG

DocX

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

PDF

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

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
barseghyanartur / intr.md
Created July 20, 2020 12:02
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
@barseghyanartur
barseghyanartur / convert_mysql_dump_to_postgresql_dump.md
Created June 11, 2020 14:21
Convert MySQL dump to PostgreSQL dump

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 [email protected]:lanyrd/mysql-postgresql-converter.git
@barseghyanartur
barseghyanartur / generate_random_password.md
Created May 26, 2020 10:30
Generate random password
openssl rand -base64 12 | cut -c1-12
@barseghyanartur
barseghyanartur / podman_install_reqs_in_all_running_containers.md
Created May 6, 2020 07:34
Run install reqs in all running containers
for cont in $(podman ps -q); do podman exec -it ${cont} /bin/bash -c "pip install django-request-logging"; done
@barseghyanartur
barseghyanartur / django_db_logging.md
Created April 22, 2020 14:52
Patch logging for django.db on the fly from terminal

Patch:

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

Now we can:

@HerrPi
HerrPi / hg-to-git-conversion.md
Last active February 8, 2020 19:18
Mercurial to Git repo conversion (hg-to-git)
@shaypal5
shaypal5 / .travis.yml
Last active November 28, 2023 19:45
Comprehensive Python testing on Travis CI
language: python
# ===== Linux ======
os: linux
dist: xenial
python:
- 2.7
- 3.6
- 3.7
- 3.8
- 3.9