Skip to content

Instantly share code, notes, and snippets.

@devSarry
devSarry / 0_reuse_code.js
Created June 26, 2016 18:25
Here are some things you can do with Gists in GistBox.
// Use Gists to store code you would like to remember later on
console.log(window); // log the "window" object to the console
@devSarry
devSarry / gist:43e8a0321484fa5633b4781b79ffaf2c
Last active October 31, 2016 20:27 — forked from seanmcn/gist:62a021a765ad4f8e593b
The Perfect Web Server - Nginx, Ajenti, Ubuntu
#Insall Ajenti
apt-get update
wget http://repo.ajenti.org/debian/key -O- | apt-key add -
echo "deb http://repo.ajenti.org/ng/debian main main ubuntu" >> /etc/apt/sources.list
apt-get update
apt-get install ajenti
service ajenti restart
# Uninstall Apache2
sudo apt-get autoremove && sudo apt-get remove apache2*
@devSarry
devSarry / deploy.sh
Created January 27, 2017 13:45 — forked from jeroenherczeg/deploy.sh
Zero Deployment script for my Laravel project
#!/bin/sh
# Author : Jeroen Herczeg <jeroen@herczeg.be> HASSELT, LIMBURG, BELGIUM, EUROPE, EARTH
#
# Hello. My name is Jeroen Herczeg and I can help you or your team with my broad knowledge
# of frontend & backend web technologies and tools. I'm an eager learner and easily adapt to
# new environments. Work remotely? I like that. Need me on location? I'm sure we'll figure something out!
#
# http://herczeg.be
# Stop the script if there is an error
@devSarry
devSarry / post-receive
Created February 8, 2017 18:42 — forked from cedricziel/post-receive
Uberspace Laravel 5.2 Zero downtime deployments as a post-receive hook.
#!/bin/bash
source ~/.bash_profile
VERSION=$(date +%Y%m%d%H%M%S)
BASE_DIRECTORY=/var/www/virtual/foxyzor/html/application
SOURCE_ROOT=$BASE_DIRECTORY/versions/$VERSION
SHARED_FOLDER=$BASE_DIRECTORY/shared
STORAGE_FOLDER=$BASE_DIRECTORY/shared/storage
CURRENT_LINK=$BASE_DIRECTORY/current
@devSarry
devSarry / post-receive.sh
Created February 8, 2017 18:44 — forked from s4wny/post-receive.sh
Git hooks/post-receive
#!/bin/bash
WORKSPACE=/var/www/html/
echo "Post-receive"
git --work-tree=$WORKSPACE checkout -f
cd $WORKSPACE
@devSarry
devSarry / SetupServer.md
Created February 8, 2017 18:44 — forked from mkhlil1288/SetupServer.md
Setup server ( Ubuntu 16 - LEMP - GitHooks - ... )

Setup My Server

sudo apt-get update
sudo apt-get install git
sudo apt-get install nodejs
sudo ln -s /usr/bin/nodejs /usr/bin/node
sudo apt-get install npm
sudo npm install --global gulp
@devSarry
devSarry / LEMP.sh
Created January 11, 2018 13:43 — forked from hiendnguyen/LEMP.sh
CentOS 7 LEMP
# Install Nginx
sudo yum install epel-release
sudo yum install nginx
sudo systemctl start nginx
sudo systemctl enable nginx
# Install MySQL (MariaDB)
sudo yum install mariadb-server mariadb
sudo systemctl start mariadb
sudo systemctl enable mariadb
@devSarry
devSarry / dev_setup.ps1
Last active January 23, 2018 20:55 — forked from thitemple/dev_setup.ps1
A PowerShell script for installing a dev machine using Chocolatey.
function Add-Path() {
[Cmdletbinding()]
param([parameter(Mandatory=$True,ValueFromPipeline=$True,Position=0)][String[]]$AddedFolder)
# Get the current search path from the environment keys in the registry.
$OldPath=(Get-ItemProperty -Path 'Registry::HKEY_LOCAL_MACHINE\System\CurrentControlSet\Control\Session Manager\Environment' -Name PATH).Path
# See if a new folder has been supplied.
if (!$AddedFolder) {
Return 'No Folder Supplied. $ENV:PATH Unchanged'
}
# See if the new folder exists on the file system.
@devSarry
devSarry / deploy-laravel-2.sh
Created March 7, 2018 08:41 — forked from triswan/deploy-laravel-2.sh
Laravel Deployment
#!/bin/sh
#
## store the arguments given to the script
read oldrev newrev refname
## Where to store the log information about the updates
LOGFILE=./post-receive.log
# The deployed directory (the running site)
DEPLOYDIR=/home/swamedia/source/portal-elogistics
@devSarry
devSarry / boxstarter.ps1
Last active April 18, 2020 13:45 — forked from jessfraz/boxstarter.ps1
Boxstarter Commands for a new Windows box.
# Description: Boxstarter Script
# Author: Jess Frazelle <jess@linux.com>
# Last Updated: 2017-09-11
#
# Install boxstarter:
# . { iwr -useb http://boxstarter.org/bootstrapper.ps1 } | iex; get-boxstarter -Force
#
# You might need to set: Set-ExecutionPolicy RemoteSigned
#
# Run this boxstarter by calling the following from an **elevated** command-prompt: