start new:
tmux
start new with session name:
tmux new -s myname
# Ways to execute a shell script in Ruby | |
# Example Script - Joseph Pecoraro | |
cmd = "echo 'hi'" # Sample string that can be used | |
# 1. Kernel#` - commonly called backticks - `cmd` | |
# This is like many other languages, including bash, PHP, and Perl | |
# Synchronous (blocking) | |
# Returns the output of the shell command | |
# Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111 |
// pre-render d3 charts at server side | |
var d3 = require('d3') | |
, jsdom = require('jsdom') | |
, fs = require('fs') | |
, htmlStub = '<html><head></head><body><div id="dataviz-container"></div><script src="js/d3.v3.min.js"></script></body></html>' | |
jsdom.env({ | |
features : { QuerySelector : true } | |
, html : htmlStub | |
, done : function(errors, window) { |
function cd_dir_history() | |
{ | |
OLDPWD="$PWD" | |
echo "# $(date) $USER -> $@" >> "$HISTFILE" | |
command cd "$@" | |
# If this directory is writable then write to directory-based history file | |
# otherwise write history in the usual home-based history file. | |
touch "$PWD/.dir_bash_history" 2>/dev/null \ |
# vim:ft=zsh ts=2 sw=2 sts=2 | |
# | |
# agnoster's Theme - https://gist.github.com/3712874 | |
# A Powerline-inspired theme for ZSH | |
# | |
# # README | |
# | |
# In order for this theme to render correctly, you will need a | |
# [Powerline-patched font](https://gist.github.com/1595572). | |
# |
#!/bin/sh | |
if [ "$1" == "" ]; then | |
echo "Usage: $0 <folder to compress>" | |
exit | |
fi | |
NAME=`basename $1` | |
tar -c --use-compress-program=pigz -f $NAME.tar.gz $NAME |
#!/bin/sh | |
if [ "$1" == "" ]; then | |
echo "Usage: $0 <file to uncompress>" | |
exit | |
fi | |
pigz -dc $1 | tar xf - |
This issue is so infuriating that I'm going to take some time to write about it.
MOST IMPORTANT. Your local development server must be bound to IP address 0.0.0.0. Some do this by default, but many don't. You need to make sure that you run your local server with correct IP bindings. You may need to provide additional flags to your serve commands e.g. polymer serve --hostname domain.local
, hugo serve --bind 0.0.0.0
. If you use a named domain like domain.local
, it has to be defined in /etc/hosts
and pointing at 0.0.0.0.
My Parallels setting is using Shared Network, nothing special there.
Open macOS Terminal and type ifconfig
. Look for the value under vnic0
> inet
. It is typically 10.211.55.2
.