Skip to content

Instantly share code, notes, and snippets.

@bipinu
bipinu / ngx_modsite
Last active April 8, 2021 20:48 — forked from valorad/nginx_modsite
Nginx enable/disable site config by Ghassen Telmoudi from serverfault.com
#!/bin/bash
##
# File:
# nginx_modsite
# Description:
# Provides a basic script to automate enabling and disabling websites found
# in the default configuration directories:
# /etc/nginx/sites-available and /etc/nginx/sites-enabled
# For easy access to this script, copy it into the directory:
#!/usr/bin/env python3
# Simple python code to show how easy it is to generate
# a Bitcoin address using Python.
# Does not store or export the private key!
# Implemented according to https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses
import ecdsa
@bipinu
bipinu / eric_on_lion.txt
Created December 5, 2016 12:47 — forked from jimk/eric_on_lion.txt
Installing the Eric IDE for Python on OS X Lion
You'll find that getting QT to play nicely on Lion is less than intuitive and painful much less getting all of the Eric IDE pre-requisites working, as well. In a effort to ease your pains, here's the steps that I went through:
btw, these instructions are assuming you have an Intel Mac (I doubt Lion supports PowerPC, though).
Xcode
- What developer hasn't installed Xcode on his Mac, yet?!?
- Xcode has the build tools that everything needs so you'll need this.
Python
- I think the OS X version of Python will work but I used python2.7 from Homebrew
@bipinu
bipinu / crontab_wrapper
Created August 19, 2016 08:30 — forked from amsnickw/crontab_wrapper
Safer use of crontab. Add this function to the user's ~/.profile or ~/.bashrc
crontab() {
crontab_usage() {
echo 'Usage:' >&2
echo ' $ crontab -[elr]' >&2
echo ' $ crontab ~/crons # to update your crons' >&2
}
if [ $# -eq 1 ]; then
if [ "$*" = '-' ]; then # worse than crontab -e
crontab_usage
@bipinu
bipinu / le-renew.sh
Created March 2, 2016 14:23 — forked from erikaheidi/le-renew.sh
Auto renewal for Let's Encrypt Apache
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Apache on Ubuntu/Debian
# @author Erika Heidi<[email protected]>
# Usage: ./le-renew.sh [base-domain-name]
# More info: http://do.co/1mbVihI
#================================================================
domain=$1
le_path='/opt/letsencrypt'
le_conf='/etc/letsencrypt'
@bipinu
bipinu / PjaxMiddleware.php
Created February 8, 2016 06:18 — forked from JeffreyWay/PjaxMiddleware.php
Laravel middleware for working with pjax.
<?php
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
use Illuminate\Http\Response;
use Symfony\Component\DomCrawler\Crawler;
class PjaxMiddleware
@bipinu
bipinu / a2ensite
Last active May 21, 2019 05:47 — forked from kevinmesiab/a2ensite
#!/bin/bash
#########################################
#
# This script enables apache virtual hosts
# by creating symlinks in
#
# /etc/apache2/sites-enabled
#
# that point to vhost conf files in
#
@bipinu
bipinu / php-fpm-cli
Last active August 29, 2015 14:19 — forked from muhqu/php-fpm-cli
#!/bin/bash
#
# The MIT License (MIT)
#
# Copyright (c) 2014 Mathias Leppich <[email protected]>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@bipinu
bipinu / compile-php-thread-safe-and-pthreads.sh
Last active May 10, 2018 16:30 — forked from Divi/compile-php-thread-safe-and-pthreads.sh
Linux: Build Thread Safe PHP with PHP5-FPM
#!/usr/bin/env bash
# PARAMETERS
# ----------
# PHP
# ---
PHP_TIMEZONE="UTC"
PHP_DIRECTORY="/etc/php5ts"
PHP_VERSION="5.6.5"
@bipinu
bipinu / .gitconfig
Last active June 22, 2020 15:47 — forked from oli/gist:1637874
[user]
name = [name for commits]
email = [email for commits]
[github]
user = [GH username]
token = [API token from https://github.com/account/admin]
[color]
ui = auto
interactive = auto
[push]