Skip to content

Instantly share code, notes, and snippets.

View prograhammer's full-sized avatar

David Graham prograhammer

View GitHub Profile
@prograhammer
prograhammer / git-cheat-sheet.md
Last active March 14, 2023 17:44
Git cheat sheet for some useful Git commands and command scenarios.
@prograhammer
prograhammer / media-temple-cheat-sheet.md
Last active May 13, 2018 04:41
A cheat sheet for some common linux commands, CentOS 6.4+ commands, and some commands related to Media Temple servers.

General Linux & CentOS 6.4+ & Media Temple - Cheat Sheet

Add a user and setup SSH passwordless access
# adduser someuser
# passwd  somepass
// Run the visude, it will probably open up in an editor like Vi
# /usr/sbin/visudo

// Look for this comment: Allow root to run any commands anywhere

root ALL=(ALL) ALL

@prograhammer
prograhammer / windows-powershell.md
Last active December 26, 2019 18:13
Windows PowerShell cheatsheet

Windows PowerShell cheatsheet

View version of PowerShell
$PSVersionTable.PSVersion
Update PowerShell 2 to PowerShell 3.0 (Windows 7)

// In cmd prompt:

@prograhammer
prograhammer / osx-cheatsheet.md
Last active December 20, 2015 21:47
OSX cheatsheeet

Shortcuts

Spotlight (quickly find or launch an app):

command + space

Terminal Goodness

Open an app, ie:

@prograhammer
prograhammer / laravel-lumen-5-homestead-win.md
Last active February 13, 2024 16:39
Laravel/Lumen 5.1 Homestead for Windows (includes fixes for shared-folder related slowness, npm install problems, caching, etc)

Laravel / Lumen Homestead for Windows w/fixes

###Initial installation and configuration Install Git for Windows which includes Git Bash.

Install VirtualBox and Vagrant.

Note: These fixes were not originally done for VirtualBox 5.0 and Vagrant 1.7.4. They are for the previous versions instead: VirtualBox 4.3.30 and Vagrant 1.7.3. Some of these fixes may not be needed now. For example, I recently upgraded to VirtualBox 5.0 and Vagrant 1.7.4 and I did not have to alter the Vagrant ruby (.rb) files as shown in part of this Gist below. I'll soon try from a fresh install (not upgrade) and update this Gist accordingly.

In Git Bash (always run as administrator), type cd ~ to

umount: device is busy. Why?
There are several reasons why a file system cannot be unmounted. Here are a few of the reasons.
Working directory or file open of a running process
# umount /mnt/test
umount: /mnt/test: device is busy.
(In some cases useful info about processes that use
the device is found by lsof(8) or fuser(1))
# lsof /mnt/test/
@prograhammer
prograhammer / vagrant_trouble.md
Last active August 29, 2015 14:22
Troubleshooting Vagrant Issues

#Trouble Shooting Vagrant Issues

####Vagrant stuck connection timeout retrying

This can happen if the guest machine is turned off improperly (or perhaps the host machine was rebooted without first doing a vagrant halt). When performing a vagrant up the machine is waiting on a response (probably "enter" key). You can update the vagrant file to have gui set to true but this will require a vagrant destroy. Instead, you can send an "enter" key to the machine. Open up a new terminal window and:

 // Get the list of running VMs
 $ vboxmanage list runningvms

// Will show something like this:

@prograhammer
prograhammer / snowflake.php
Last active November 15, 2016 15:54
80-bit sequential unique identifier (as opposed to a 128-bit UUID)
<?php
/**
* Creates an 80-bit, binary(10) unique identifier.
*
* Smaller, so indexes fit better in memory/RAM and the hex representation
* is still relatively URL friendly. Sequential, so inserts/indexes faster.
* (see https://www.percona.com/blog/2014/12/19/store-uuid-optimized-way/)
*
* 4 bit worker id (supports 16 servers, from 0 to 15)
@prograhammer
prograhammer / bash_profile.md
Created February 17, 2016 19:47 — forked from irazasyed/bash_profile.md
Terminal: Mac OS X Terminal Aliases & How-To - .bash_profile / .profile

Mac OS X Terminal Aliases & How-To

Collection of some of my fav terminal aliases that i use often & collected from the web. This file will be updated with more aliases as i find more. Feel free to comment and share your fav aliases you use :)

###Follow these simple steps to add the following aliases:###


  1. Within the Terminal, run:
// Returns a function, that, as long as it continues to be invoked, will not
// be triggered. The function will be called after it stops being called for
// N milliseconds. If `execAsap` is passed, trigger the function on the
// leading edge, instead of the trailing.
export function debounce (func, threshold, execAsap) {
var timeout
return function debounced () {
var obj = this
var args = arguments