Skip to content

Instantly share code, notes, and snippets.

View cjohnson496's full-sized avatar

Charles Johnson cjohnson496

View GitHub Profile
@rroemhild
rroemhild / gist:190970
Created September 22, 2009 10:16
simple shell script log function
# Vars for log()
LOGGER="/usr/bin/logger" # Path to logger
FACILITY="LOCAL4" # Syslog facility
PROG="´basename $0´" # Program name
SYSLOG="YES" # Write to Syslog? (YES/NO)
VERBOSE="NO" # Write to STDOUT? (YES/NO)
# Function: log()
# Usage: log priority "message"
log()
#!/bin/bash
# SPDX-License-Identifier: MIT
## Copyright (C) 2009 Przemyslaw Pawelczyk <przemoc@gmail.com>
##
## This script is licensed under the terms of the MIT license.
## https://opensource.org/licenses/MIT
#
# Lockable script boilerplate
@KartikTalwar
KartikTalwar / Documentation.md
Last active May 9, 2024 12:59
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
@waylan
waylan / creating-project-pages-using-git-subtree.md
Last active March 8, 2022 09:30
Use subtree to merge commits from a project subdir (i.e., 'docs/') to gh-pages branch.

Creatings Project Pages using git-subtree

Many projects maintain their documentation within a subfolder of their repository (for example docs/). That way, as new features are added or existing features are modified, the documentation can be updated in the same commit. The git-subtree command can be an effective tool to merge those changes from the documentation subdirectory of your project to the root of the gh-pages branch.

Setup

According to the author of git-subtree, the command is included with git 1.7.11 and higher. However, it's in the "contrib" subtree for now, so it's not installed by default. Search for "git-subtree" in your system's package manager and install the package if it exists. If not, or if you are using an older version of git, the easiest way is to install git-subtree from the author's repo.

$ git clone https://github.com/apenwarr/git-subtree.git
@Atem18
Atem18 / gist:4696071
Last active April 19, 2024 11:18 — forked from evildmp/gist:3094281
Tutorial to seting up a django website in production.

******************************************************************** Set up Django, Nginx and Gunicorn in a Virtualenv controled by Supervisor********************************************************************

Steps with explanations to set up a server using:

  • Virtualenv
  • Virtualenvwrapper
  • Django
  • Gunicorn
@stojg
stojg / Flowdock.php
Last active January 24, 2018 21:31
<?php
/**
* Send an message to a Flowdock "flow".
*
* # Initialization:
* <code>
* $fd = new Flowdock();
* $fd->setToken('asdadsads');
* </code>
*
@willurd
willurd / web-servers.md
Last active May 24, 2024 13:07
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@pid
pid / keystroke-toggle-linenumbers-settings.json
Created October 21, 2013 20:17
Sublime Text keystroke toggle line numbers show/hide
{
"keys": ["ctrl+alt+l"],
"command": "toggle_setting",
"args": {
"setting": "line_numbers"
}
@stojg
stojg / Flowdock.php
Created November 5, 2013 22:27
Sending a message via php and curl to a flowdock "flow"
<?php
/**
* Send an message to a Flowdock "flow".
*
* # Initialization:
* <code>
* $fd = new Flowdock();
* $fd->setToken('asdadsads');
* </code>
*