Skip to content

Instantly share code, notes, and snippets.

View garretttaco's full-sized avatar

Garrett Tacoronte garretttaco

View GitHub Profile
@garretttaco
garretttaco / internal_redirect.md
Last active January 25, 2017 21:08
View localhost website from another device, with the internal ip address

The setup I am using, is I have a Node.js, express server that is listening on port 1337 using the host 127.0.0.1. I then have Webpack dev server running on port 3000 and it proxies all traffic from 3000 to 1337, the server. Webpack dev server runs as a default on host 127.0.0.1 and for security reasons, other computers internally cannot access any server from that host. As a fix, I had to change the (default) host to 0.0.0.0 in order to then access the internal ip and port (http://192.168.100.54:3000).

References:

http://stackoverflow.com/a/30712750

@garretttaco
garretttaco / convert.sh
Created October 20, 2016 23:06
Convert git repo clone from https to ssh
#/bin/bash
#-- Script to automate https://help.github.com/articles/why-is-git-always-asking-for-my-password
REPO_URL=`git remote -v | grep -m1 '^origin' | sed -Ene's#.*(https://[^[:space:]]*).*#\1#p'`
if [ -z "$REPO_URL" ]; then
echo "-- ERROR: Could not identify Repo url."
echo " It is possible this repo is already using SSH instead of HTTPS."
exit
fi
@garretttaco
garretttaco / .bash_profile
Last active April 15, 2017 00:08
This is my ever improving bash_profile/bashrc file that I use on my computers.
#Add vim to command line
set -o vi
# Random
alias ll='ls -la'
alias apache='sudo apachectl restart'
alias hosts='sudo vi /etc/hosts'
alias mysqlstart='sudo launchctl load -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist'
alias mysqlstop='sudo launchctl unload -F /Library/LaunchDaemons/com.oracle.oss.mysql.mysqld.plist'
alias eip='curl icanhazip.com'
alias iip='ifconfig | grep 192'

DNS_PROBE_FINISHED_BAD_CONFIG chrome fix on mac

Go to system preferences > network

then select the connection type on the left. Click advanced on bottom right for that connection.

Proceed to the dns tab. from there I replaced the current server : 192.168.1.1 with googles dns server ipv4 : 8.8.4.4

drun() {
  if [[ $# -eq 0 ]]
    then
      echo "Which container? Provide 1 argument."
      return 0
  fi

  case "$1" in

'web' )

###Step 1 make sure xdebug is installed and as a zend extension.

sudo apt-get install php5-dev && sudo apt-get install php-pear

sudo pecl install xdebug

sudo apachectl restart

make sure xdebug has an .ini file check if there is one for your whole system or multiple. ( force php and apache to use the same conf.d xdebug.ini file)

@garretttaco
garretttaco / Docker_setup.md
Last active August 29, 2015 14:27
Docker file