Skip to content

Instantly share code, notes, and snippets.

View peshmerge's full-sized avatar
😸
L0L

Peshmerge peshmerge

😸
L0L
View GitHub Profile
@igniteflow
igniteflow / gist:4654814
Last active July 30, 2018 07:36
A common use case in a Fabric script is to: 1. Activate the virtualenv 2. cd to the project dir Here is a simple context manager to achieve this with a one line with statement:
"""
A common use case in a Fabric script is to:
1. Activate the virtualenv
2. cd to the project dir
Here is a simple context manager to achieve this with a one line with statement:
"""
# fabconfig.py
def dev():
@ColeMurray
ColeMurray / preprocess.py
Created August 6, 2017 02:05
Preprocess images of faces using dlib
import argparse
import glob
import logging
import multiprocessing as mp
import os
import time
import cv2
from medium_facenet_tutorial.align_dlib import AlignDlib
@hynekcer
hynekcer / post-checkout.py
Last active November 27, 2019 20:14
Git post-checkout hook for Python to remove orphan *.pyc files and empty dir
#!/bin/env python
# This work is licensed under the terms of the MIT license.
# For a copy, see <https://opensource.org/licenses/MIT>.
"""
A hook to git that removes orphan files "*.pyc" and "*.pyo" for "*.py"
beeing deleted or renamed by git checkout. It also removes their empty parent
directories.
Place it to "my_local_repository/.git/hooks/post-checkout" and make it executable.
Nothing is cleaned for .py files deleted manually or by "git rm" etc.
Related to http://stackoverflow.com/q/1504724/448474
@pcostesi
pcostesi / uwsgi-and-nginx.md
Last active December 28, 2019 17:38
uWSGI and NGiNX
@tegansnyder
tegansnyder / Upgrading Elastic Search to 2.3 - Steps I took.md
Last active June 2, 2020 11:58
Upgrading Elastic Search to 2.3 - Steps I took

Details of steps I took on each node in a nine node ES cluster on RHEL7. These steps need to occur one node at a time, i.e. "rolling upgrade")

Step 1: Disable shard allocation

curl -XPUT "http://localhost:9200/_cluster/settings" -d'
{
  "transient": {
    "cluster.routing.allocation.enable": "none"
  }
}'
@morgangiraud
morgangiraud / nvidia-reinstall.sh
Last active December 11, 2020 15:48
Script to reinstall manually nvidia drivers,cuda 9.0 and cudnn 7.1 on Ubuntu 16.04
# Remove anything linked to nvidia
sudo apt-get remove --purge nvidia*
sudo apt-get autoremove
# Search for your driver
apt search nvidia
# Select one driver (the last one is a decent choice)
sudo apt install nvidia-370
anonymous
anonymous / provisioner-php5.5.sh
Created November 20, 2016 13:59
Scotch Box Change PHP Repository
#!/usr/bin/env bash
# Update PHP Repo
sudo rm /etc/apt/sources.list.d/ondrej-php5-5_6-trusty.list
sudo add-apt-repository -y ppa:ondrej/php
sudo apt-get -y update
# Remove PHP 5.6
sudo apt-get --remove purge -y php5 php5-cli php5-curl php5-gd php5-intl php5-mcrypt php5-memcached php5-mysqlnd php5-readline php5-sqlite php5-cgi php5-common php5-fpm php5-imagick php5-json php5-memcache php5-mongo php5-pgsql php5-redis php-pear
sudo apt-get -y autoremove
@fernandoaleman
fernandoaleman / gist:5083680
Last active October 17, 2023 12:02
How to update VirtualBox Guest Additions with vagrant
# Start the old vagrant
$ vagrant init centos-6.3
$ vagrant up
# You should see a message like:
# [default] The guest additions on this VM do not match the install version of
# VirtualBox! This may cause things such as forwarded ports, shared
# folders, and more to not work properly. If any of those things fail on
# this machine, please update the guest additions and repackage the
# box.

Technologies to learn to become a Back End Developer (Python/Django)

  • Linux - be proficient using Ubuntu for example and the CLI and understand how the shell works, what are environment variables, subshells, processes/tasks, etc...
  • Docker (and docker-compose) - what are containers and how they work (conceptually) and how to create and run ones
  • Git - what does version control system mean and how to use Git
  • RDB (relational databases) - what are relational databases, and understand tables, how to create them and make relations between them as needed... also understand that through SQLite and PostgreSQL (preferred) or MySQL
  • Python - how to write Python very well and understand its [OOP] implementation...
  • Virtualenv - And how to create virtual environments for python to isolate it from the system's installed version...
  • Virtualenvwrapper to manage virtual environments easily
@ziadoz
ziadoz / install.sh
Last active April 20, 2024 10:18
Install Chrome, ChromeDriver and Selenium on Ubuntu 16.04
#!/usr/bin/env bash
# https://developers.supportbee.com/blog/setting-up-cucumber-to-run-with-Chrome-on-Linux/
# https://gist.github.com/curtismcmullan/7be1a8c1c841a9d8db2c
# https://stackoverflow.com/questions/10792403/how-do-i-get-chrome-working-with-selenium-using-php-webdriver
# https://stackoverflow.com/questions/26133486/how-to-specify-binary-path-for-remote-chromedriver-in-codeception
# https://stackoverflow.com/questions/40262682/how-to-run-selenium-3-x-with-chrome-driver-through-terminal
# https://askubuntu.com/questions/760085/how-do-you-install-google-chrome-on-ubuntu-16-04
# Versions
CHROME_DRIVER_VERSION=`curl -sS https://chromedriver.storage.googleapis.com/LATEST_RELEASE`