Skip to content

Instantly share code, notes, and snippets.

# -*- coding: utf-8 -*-
"""
Search features for :
* :mod:`elasticsearch.elasticsearch`
* :mod:`haystack:haystack`
* :mod:`elasticstack:elasticstack`
:creationdate: 05/11/15 15:05
:moduleauthor: François GUÉRIN <fguerin@ville-tourcoing.fr>
@pombredanne
pombredanne / select_requirements.py
Created August 1, 2014 10:04
Select Python pip requirements files based on os, platform or else
#!/usr/bin/python
# #
# Copyright (c) 2014 by nexB, Inc. http://www.nexb.com/ - All rights reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
# http://www.apache.org/licenses/LICENSE-2.0
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
@jawinn
jawinn / fobi_states.txt
Last active March 27, 2018 08:32
Django FOBI - List of US States and Territories for Select Menu
AK, Alaska
AL, Alabama
AR, Arkansas
AS, American Samoa
AZ, Arizona
CA, California
CO, Colorado
CT, Connecticut
DC, District of Columbia
DE, Delaware
@davit312
davit312 / mk1tv.go
Created September 21, 2018 13:10
Սա օգտագործում եմ films-hy.blogspot.com կայքի ֆիլմերը ավելորդ մասերից մաքրելու համար
package main
import (
"fmt"
"os"
"os/exec"
"strconv"
)
func main() {
@barseghyanartur
barseghyanartur / README.md
Last active December 29, 2019 11:50
Set up working Python dev environment

Set up working dev environment

Install and setup of git and mercurial

Install git:

sudo apt-get install git
@HerrPi
HerrPi / hg-to-git-conversion.md
Last active February 8, 2020 19:18
Mercurial to Git repo conversion (hg-to-git)
@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
@r0mdau
r0mdau / Kibana-readonly.md
Last active July 29, 2020 06:54
Kibana readonly over internet

Kibana Readonly

With this tip, kibana can't be modified. So you can share the uri to anyone on the internet. It's a network method to protect kibana from changes of anonymous.

Quick start

  1. You need to have a working kibana exposed over http on internet
  2. On the same elasticsearch server, install nginx : apt-get install nginx
  3. In the directory /etc/nginx/sites-available, create a new file and edit it, for example : vi /etc/nginx/sites-available/kibana-readonly
  4. Write the following configuration :
@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 / 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