Skip to content

Instantly share code, notes, and snippets.

@bclinkinbeard
bclinkinbeard / release.sh
Created November 1, 2011 20:22
Bash script to automate the Git Flow tag/release process
#!/bin/bash
# current Git branch
branch=$(git symbolic-ref HEAD | sed -e 's,.*/\(.*\),\1,')
# v1.0.0, v1.5.2, etc.
versionLabel=v$1
# establish branch and tag name variables
devBranch=develop
@glennblock
glennblock / fork forced sync
Created March 4, 2012 19:27
Force your forked repo to be the same as upstream.
git fetch upstream
git reset --hard upstream/master
@takien
takien / youtubeID.js
Last active May 3, 2024 12:41
Get YouTube ID from various YouTube URL using JavaScript
/**
* Get YouTube ID from various YouTube URL
* @author: takien
* @url: http://takien.com
* For PHP YouTube parser, go here http://takien.com/864
*/
function YouTubeGetID(url){
var ID = '';
url = url.replace(/(>|<)/gi,'').split(/(vi\/|v=|\/v\/|youtu\.be\/|\/embed\/)/);
@plentz
plentz / nginx.conf
Last active May 27, 2025 10:32
Best nginx configuration for improved security(and performance)
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@denji
denji / nginx-tuning.md
Last active June 3, 2025 16:32
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@gregkrsak
gregkrsak / update-submodules
Created February 4, 2014 20:49
A small Bash script to update git submodules.
#!/bin/bash
#
# update-submodules
#
# Updates all submodules of a git project.
# by Greg Krsak <[email protected]>, Feb. 4, 2014
#
read -r -d '' USAGE << EOF
Usage: update-submodules [<options>]
@fredsted
fredsted / ddns-api.php
Last active December 24, 2024 20:16
Virtualmin Dynamic DNS (DDNS) server
<?php
// This script receives DDNS updates via HTTP
// example: http://server/ddns-api.php?name=home = updates home.domain.com to IP of requester
define('DDNS_DATA_FILE', '/home/ddns/ddns.json');
define('DDNS_DOMAIN', 'example.com');
header("Content-type: text/plain");
@TheZ3ro
TheZ3ro / fb_logindialog_hider.user.js
Last active December 23, 2020 00:58
Greasemonkey (Userscript) Hide the Facebook LoginDialog in the bottom part of the page - Press on Raw to install
// ==UserScript==
// @name FB LoginDialog Hider
// @namespace loginhider.thezero.org
// @include https://*.facebook.com/*
// @include http://*.facebook.com/*
// @version 1
// @grant none
// ==/UserScript==
// If you don't have a facebook account or you are not logged in,
@Nilpo
Nilpo / allow
Created September 16, 2016 01:40 — forked from Mteigers/allow
CSF Allow AND Ignore Cloudflare IPv4 IP's.
for i in `curl https://www.cloudflare.com/ips-v4`; do csf -a $i; done
@anriseth
anriseth / atomsetup.sh
Last active March 15, 2023 05:58
Install Atom from source
# Ask admin to install the following packages:
# build-essential git libsecret-1-dev fakeroot rpm libx11-dev libxkbfile-dev libgnome-keyring-dev
# When that is done, you can install everything else locally
# Install Node.js
curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.33.2/install.sh | bash
source $HOME/.bashrc
nvm install v6.10.3
nvm use v6.10.3