Skip to content

Instantly share code, notes, and snippets.

View synsa's full-sized avatar

Steve Lang synsa

View GitHub Profile
@synsa
synsa / gist:03f304095a6dc138b6df9b06975d6e67
Created October 15, 2016 22:13 — forked from khakimov/gist:3558086
Matrix Effect in you terminal
echo -e "\e[1;40m" ; clear ; while :; do echo $LINES $COLUMNS $(( $RANDOM % $COLUMNS)) $(( $RANDOM % 72 )) ;sleep 0.05; done|awk '{ letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"; c=$4; letter=substr(letters,c,1);a[$3]=0;for (x in a) {o=a[x];a[x]=a[x]+1; printf "\033[%s;%sH\033[2;32m%s",o,x,letter; printf "\033[%s;%sH\033[1;37m%s\033[0;0H",a[x],x,letter;if (a[x] >= $1) { a[x]=0; } }}'
@synsa
synsa / phonehome.php
Created October 16, 2016 20:31 — forked from dweeber/phonehome.php
Phone Home Script
<?php
######################################################################
# Phonehome script to obtain IP of home router
#
# Call with wget from your internal machine
# with the command:
# wget -t 10 http://yourwebsite/phonehome.php?c=1234&cmd=1 -O /dev/null
#
######################################################################
$SY = array();
#!/bin/env sh
lines=$(tput lines)
cols=$(tput cols)
awkscript='
{
letters="abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789@#$%^&*()"
lines=$1
@synsa
synsa / grrr.sh
Created October 21, 2016 08:32 — forked from Bertrand/grrr.sh
merge master into staging and staging into testing
#!/bin/sh
git diff --quiet --exit-code
if [ $? -ne 0 ]; then
echo "Cannot run grrr if you have uncommited changes"
exit -1;
fi
current_branch=`git rev-parse --abbrev-ref HEAD`
if [ "$current_branch" == "HEAD" ]; then
@synsa
synsa / .bash_profile
Created December 12, 2016 17:17 — forked from natelandau/.bash_profile
Mac OSX Bash Profile
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# 4. Searching
# 5. Process Management
@synsa
synsa / intro.markdown
Created December 16, 2016 06:00 — forked from tillsanders/intro.markdown
Laravel: drag-and-drop repositioning with auto-save of DB entries

Laravel: drag-and-drop repositioning with auto-save of DB entries

Use case: Database entries are represented in a table. By grabbing and moving a row up or down the table, you can change the entries' order/position. The changes are submitted automatically via ajax.

  • Uses jQueryUI (custom download: sortable is needed)
  • newly created elements are added to the top (see route /jobs/create)
@synsa
synsa / ssh-agent-auto-add.bat
Created January 19, 2017 02:47 — forked from stavarotti/ssh-agent-auto-add.bat
Automatically add ssh-keys when cmder starts
:: Automatically add ssh keys when cmder starts
::cmder\1.1.4.1\vendor\init.bat
:: Run ssh-agent initialisation
@if "%SSH_AGENT_PID%"=="" (
@bash C:\opt\cmder\1.1.4.1\bin\ssh-agent-init.sh
@call ssh-agent-setter.cmd
@del ssh-agent-setter.cmd
ssh-add %USERPROFILE%/.ssh/20150505_rsa
) else (
@synsa
synsa / Slack.php
Created January 21, 2017 02:40 — forked from rufhausen/Slack.php
A simple class for sending a message to SlackHQ https://slack.com. Config settings in this example are coming from Laravel's Config facade. Requires Guzzle 4.x http://guzzlephp.org.
<?php
use GuzzleHttp\Client;
use Config; //using Laravel's Config facade
/*
|--------------------------------------------------------------------------
| Usage:
|
| $slack = new Slack;
@synsa
synsa / Install-php7.md
Created January 28, 2017 02:00 — forked from hollodotme/Install-php7.md
Installing php7-fpm with phpredis and xdebug extension on Ubuntu 14.04

Install php7.0-fpm

# remove php5 modules
apt-get autoremove --purge php5-*
# add php-7.0 source list by [Ondřej Surý](https://github.com/oerdnj)
add-apt-repository ppa:ondrej/php
# Update index
apt-get update
# Install php7.0-fpm with needed extensions