git init
or
/** | |
* Fancy ID generator that creates 20-character string identifiers with the following properties: | |
* | |
* 1. They're based on timestamp so that they sort *after* any existing ids. | |
* 2. They contain 72-bits of random data after the timestamp so that IDs won't collide with other clients' IDs. | |
* 3. They sort *lexicographically* (so the timestamp is converted to characters that will sort properly). | |
* 4. They're monotonically increasing. Even if you generate more than one in the same timestamp, the | |
* latter ones will sort after the former ones. We do this by using the previous random bits | |
* but "incrementing" them by 1 (only in the case of a timestamp collision). | |
*/ |
################################################################################ | |
# check plugins | |
################################################################################ | |
required_plugins = %w(vagrant-hostmanager vagrant-hosts vagrant-vbguest) | |
plugins_to_install = required_plugins.select { |plugin| not Vagrant.has_plugin? plugin } | |
if not plugins_to_install.empty? | |
puts "Installing plugins: #{plugins_to_install.join(' ')}" | |
if system "vagrant plugin install #{plugins_to_install.join(' ')}" | |
exec "vagrant #{ARGV.join(' ')}" |
So one of the painful points of using docker
on OS X is that you need to run a virtualbox VM, which often suffers from performance issues. With xhyve, a OS X virtualization system, and docker-machine-xhyve you can now have docker
use the native OS X hypervisor to run containers.
No more dealing with virtualbox shenanigans!
In this script, I've also set up a way to autoconfigure terminal sessions to load docker's environment vars (dependent on docker-machine
) so you do not have to run eval $(docker-machine env whatever)
every time you open a new terminal window.
$(document).ready(function() { | |
$('.navigation-main .navigation--entry').off(); | |
$('.navigation-main .navigation--entry').click(function() { | |
if( $(this).hasClass('is--hovered') ) { | |
$(this).removeClass('is--hovered'); | |
$('.advanced-menu .menu--is-active').removeClass('menu--is-active'); | |
return false; | |
} | |
else { | |
$(this).siblings('.is--hovered').removeClass('is--hovered'); |
# Add this to your ~/.provile or ~/.bashrc depending on your system | |
# | |
# watson directory (require watson >= 1.3) | |
# This value is the default on MacOSX | |
WATSON_DIR="$HOME/Library/Application Support/watson" | |
watson_status() { | |
# colors taken from git-aware-prompt | |
# https://github.com/jimeh/git-aware-prompt | |
local txtred="$(tput setaf 1 2>/dev/null || echo '\e[0;31m')" # Red |
<?php | |
namespace App\Tests\Browser; | |
use App\Tests\HasDuskBrowser; | |
class ExampleTest extends \PHPUnit_Framework_TestCase | |
{ | |
use HasDuskBrowser; | |
#!/usr/bin/env bash | |
export DEBIAN_FRONTEND=noninteractive | |
sudo -E -H apt-get install -y software-properties-common rkhunter fail2ban | |
sudo -H apt-add-repository -y -u ppa:ansible/ansible | |
sudo -H apt-get install -y ansible | |
sudo -H ansible-galaxy install dev-sec.os-hardening dev-sec.ssh-hardening 2>/dev/null | |
cat << 'EOF' > hardening-playbook.yml | |
- hosts: localhost |
/Library/Backblaze.bzpkg/bzdata/bzexcluderules_editable.xml
.bzexclusions
tag:<!-- Exclude node_modules. -->
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/node_modules/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
<excludefname_rule plat="mac" osVers="*" ruleIsOptional="t" skipFirstCharThenStartsWith="users/" contains_1="/.git/" contains_2="*" doesNotContain="*" endsWith="*" hasFileExtension="*" />
default['sshd']['sshd_config']['AuthenticationMethods'] = 'publickey,keyboard-interactive:pam' | |
default['sshd']['sshd_config']['ChallengeResponseAuthentication'] = 'yes' | |
default['sshd']['sshd_config']['PasswordAuthentication'] = 'no' |