Skip to content

Instantly share code, notes, and snippets.

View scottstanfield's full-sized avatar
🚀
:wq

Scott Stanfield scottstanfield

🚀
:wq
  • Relativity Space
  • California
  • 07:34 (UTC -07:00)
View GitHub Profile
# vi:ft=zsh
export PATH=$HOME/bin:/usr/local/bin:$PATH:.
export EDITOR=vim
# Setup Antigen
source $HOME/.antigen/antigen.zsh
NPM=/usr/local/lib/node_modules/npm/lib/utils/completion.sh
[[ -e $NPM ]] && source $NPM

How-to setup a simple git push deployment

These are my notes basically. I first created this just as a reminder for myself. Feel free to use this for your project as a starting point.

On the server (example.com)

  1. Create a user on example.com, as which we (the git client) connects (push) to exmaple.com.
sudo useradd -m -s /usr/bin/git-shell git
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Block Hello World</title>
</head>
<body>
<p>Star Wars</p>
<img src="lego.jpg" alt="" />
#!/usr/bin/env python2
# Quick and dirty demonstration of CVE-2014-0160 by Jared Stafford (jspenguin@jspenguin.org)
# The author disclaims copyright to this source code.
import sys
import struct
import socket
import time
import select
" Put this in your .vimrc
" Jump to the last position of the cursor except for git commits
function! PositionCursorFromViminfo()
if !(bufname("%") =~ '\(COMMIT_EDITMSG\)') && line("'\"") > 1 && line("'\"") <= line("$")
exe "normal! g`\""
endif
endfunction
au BufReadPost * call PositionCursorFromViminfo()
#!/bin/sh
# Includes current git branch in tcsh prompt.
#
# EXAMPLE
#
# Your prompt can look like this:
#
# [myhost.com ~/repos/foo (master)]
#
# USAGE:
@scottstanfield
scottstanfield / appendpath.sh
Created June 14, 2011 16:50
Append your path in .cshrc for tcsh
foreach dir ( /opt/local/bin "$HOME/.gem/ruby/1.8/bin" "$HOME/bin" . )
if ( $PATH !~ *$dir* && -d "$dir" ) setenv PATH "${dir}:${PATH}"
end
#!/usr/bin/awk -f
# execute like:
# % git status |& git-prompt.awk
# (Inspiration from http://niczsoft.com/2010/05/my-git-prompt/)
BEGIN { branch = ""; prefix=""; suffix="" }
/# On branch/ { branch = $4; }
/untracked files present/ { prefix = prefix "*"; }
@scottstanfield
scottstanfield / gist:2581041
Created May 2, 2012 22:31
brew formula to compile vim with clipboard for Mac
require 'formula'
class Vim < Formula
homepage 'http://www.vim.org/'
# Get stable versions from hg repo instead of downloading an increasing
# number of separate patches.
url 'https://vim.googlecode.com/hg/', :revision => '70eff6af1158'
version '7.3.462'
head 'https://vim.googlecode.com/hg/'
#!/bin/sh
# Shell script scripts to read ip address
OS=`uname`
case $OS in
Linux)
IP=`ifconfig | grep 'inet addr:'| grep -v '127.0.0.1' | cut -d: -f2 | awk '{ print $1}'`
WANIP=`wget -q -O - checkip.dyndns.org|sed -e 's/.*Current IP Address: //' -e 's/<.*$//'`
;;
FreeBSD|OpenBSD|Darwin)