Skip to content

Instantly share code, notes, and snippets.

View nodesocket's full-sized avatar

Justin Keller nodesocket

View GitHub Profile
BASE_PATH="/srv/www"
REPO_PATH="/srv/www/repo"
GIT_URL="https://github.com/username/repo.git"
if [ -d "$REPO_PATH" ]; then
cd $REPO_PATH || exit 3
git pull --quiet
echo "git pull successfully ran ($(git rev-parse --short HEAD))";
else
cd $BASE_PATH || exit 3
BASE_PATH="/var/www/vhosts/my.photocloudapp.com"
REPO_PATH="/var/www/vhosts/my.photocloudapp.com/webapp"
GIT_URL="https://github.com/photocloud/webapp.git"
if [ -d "$REPO_PATH" ]; then
cd $REPO_PATH
git pull --quiet
echo "git pull successfully ran";
else
cd $BASE_PATH
BASE_PATH="/var/www/vhosts/my.photocloudapp.com"
REPO_PATH="/var/www/vhosts/my.photocloudapp.com/public"
GIT_URL="https://github.com/photocloud/webapp.git"
if [ -d "$REPO_PATH" ]; then
cd $REPO_PATH
git pull --quiet
echo "git pull successfully ran";
else
cd $BASE_PATH

Commando.io. A simpler way to manage servers online. Commando.io; your first DevOps hire!

Install Notes

  • API token secret key - A valid API token secret key. You may create API tokens on the settings page in the Commando.io web interface.
  • Account alias - Your account alias is simply the subdomain that you access Commando.io with. For example the account alias of https://foo.commando.io is foo.
  • Recipe - The recipe you wish to execute. You may find recipe ids in the in the Commando.io web interface.
  • Server - A single server id. You may find server ids in the modal popup when clicking a server in the Commando.io web interface.
  • Groups - A list of group ids seperated by commas. You may find group ids in the modal popup when clicking a group in the Commando.io web interface.
app.post('/oauth/signin', [
oauthLogger,
jsonParser,
function(req, res) {
if(!req.body) {
res.status(400).send({
error: {
status_code: 400,
status: 'Bad Request',
message: 'Missing required body'
@nodesocket
nodesocket / README.md
Last active October 7, 2023 06:30
The perfect Gulp.js

The perfect gulp.js file

Tasks

serve

Runs a connect web server, serving files from /client on port 3000.

uglify-js

@nodesocket
nodesocket / Angular Cliffnotes.md
Last active June 15, 2020 01:39
Angular.js Cliffnotes

Modules

var app = angular.module('app', []);

Using modules in views

 <html ng-app="app"></html>
@nodesocket
nodesocket / gist:7458989
Created November 14, 2013 00:15
Get OS and linux distro
#!/bin/sh
# Detects which OS and if it is Linux then it will detect which Linux Distribution.
OS=`uname -s`
REV=`uname -r`
MACH=`uname -m`
GetVersionFromFile()
{
VERSION=`cat $1 | tr "\n" ' ' | sed s/.*VERSION.*=\ // `
@nodesocket
nodesocket / sublime-text-3-hotkeys.md
Last active December 26, 2015 20:29
Sublime Text 3 Hotkeys

Go to anything

command + p

Go to line

control + G

Go to definition

command + option + down

Go to symbol

git clone git@github.com:balanced/balanced-ruby.git
cd balanced-ruby
git checkout pm
CONFIGURE_OPTS=--without-tk rbenv install 1.8.7-p371
rbenv rehash
rbenv local 1.8.7-p371
gem install bundle
bundle install
rake build gem
gem install balanced-ruby