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
0xc6c97a1B436890bFe822086eC34fB4DeD02d28db
@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 / ssh-copy-id
Created July 29, 2016 09:22
SSH-COPY-ID for OSX. Copy it to /usr/local/bin/ssh-copy-id
#!/bin/sh
# Shell script to install your public key on a remote machine
# Takes the remote machine name as an argument.
# Obviously, the remote machine must accept password authentication,
# or one of the other keys in your ssh-agent, for this to work.
ID_FILE="${HOME}/.ssh/id_rsa.pub"
if [ "-i" = "$1" ]; then
@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<erika@do.co>
# 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 <mleppich@muhqu.de>
#
# 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