Skip to content

Instantly share code, notes, and snippets.

View peshmerge's full-sized avatar
😸
L0L

Peshmerge peshmerge

😸
L0L
View GitHub Profile
@MohamedAlaa
MohamedAlaa / tmux-cheatsheet.markdown
Last active April 28, 2024 12:29
tmux shortcuts & cheatsheet

tmux shortcuts & cheatsheet

start new:

tmux

start new with session name:

tmux new -s myname
@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():
@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.
@julionc
julionc / 00.howto_install_phantomjs.md
Last active April 26, 2024 09:13
How to install PhantomJS on Debian/Ubuntu

How to install PhantomJS on Ubuntu

Version: 1.9.8

Platform: x86_64

First, install or update to the latest system software.

sudo apt-get update
sudo apt-get install build-essential chrpath libssl-dev libxft-dev
@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
@vasanthk
vasanthk / System Design.md
Last active April 30, 2024 12:30
System Design Cheatsheet

System Design Cheatsheet

Picking the right architecture = Picking the right battles + Managing trade-offs

Basic Steps

  1. Clarify and agree on the scope of the system
  • User cases (description of sequences of events that, taken together, lead to a system doing something useful)
    • Who is going to use it?
    • How are they going to use it?
@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