Skip to content

Instantly share code, notes, and snippets.

@joaocc
joaocc / module--contact--include--service--contact.class.php.diff
Created December 3, 2013 16:38
PHPFox 3.7.2: non-official fix for problem in sending mails as-users (module Contact) by HighSkillz
diff --git a/phpfoxdev/module/contact/include/service/contact.class.php b/phpfoxdev/module/contact/include/service/contact.class.php
index 18ed3c9..f65801f 100644
--- a/com-hsz-dev-aux5/src-www/phpfoxdev/module/contact/include/service/contact.class.php
+++ b/com-hsz-dev-aux5/src-www/phpfoxdev/module/contact/include/service/contact.class.php
@@ -72,6 +72,14 @@ class Contact_Service_Contact extends Phpfox_Service
$sText .= Phpfox::getPhrase('contact.profile') . ': ' . Phpfox::getLib('url')->makeUrl(Phpfox::getUserBy('user_name')) . '<br />';
$sText .= '------------------------------------------------------------<br />';
}
+ else
+ {
# run on the VM which will provide the image for the vagrant box
# to save a lot of time and disk space, delete any unwanted snapshots from the VM
# based, almost entirely, on http://www.hurryupandwait.io/blog/in-search-of-a-light-weight-windows-vagrant-box
# rename built-in admin account username and pwd to 'vagrant'
$admin=[adsi]"WinNT://./Administrator,user"
$admin.psbase.rename("vagrant")
$admin.SetPassword("vagrant")
$admin.UserFlags.value = $admin.UserFlags.value -bor 0x10000
$admin.CommitChanges()
#!/bin/bash
#### This script is published by Philipp Klaus <philipp.l.klaus@web.de>
#### on <http://blog.philippklaus.de/2011/05/ipv6-6in4-tunnel-via-hurricane-electric-tunnelbroker-net-automatic-ip-update-on-mac-os-x/>
#### It is originally by freese60 and modified by limemonkey.
#### Found on <http://www.tunnelbroker.net/forums/index.php?topic=287.0>
### Uncomment this line to debug the script:
#set -x

Fixing npm On Mac OS X for Homebrew Users

If you just want to fix the issue quickly, scroll down to the "solution" section below.

Explanation of the issue

If you're a Mac Homebrew user and you installed node via Homebrew, there is a major philosophical issue with the way Homebrew and NPM work together. If you install node with Homebrew and then try to do npm update npm -g, you will see an error like this:

$ npm update npm -g
@joaocc
joaocc / index.html
Last active August 29, 2015 14:19 — forked from Fortyseven/index.html
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>Unity Web Player | %UNITY_WEB_NAME%</title>
%UNITY_UNITYOBJECT_DEPENDENCIES%
<script type="text/javascript">
<!--
var unityObjectUrl = "%UNITY_UNITYOBJECT_URL%";
if (document.location.protocol == 'https:')
# filename: install-nvm-npm-node
# author: Lex Sheehan
# purpose: To cleanly install NVM, NODE and NPM
# dependencies: brew
# references: http://lexsheehan.blogspot.com/2015/04/cleanly-install-nvm-node-and-npm.html
NOW=$(date +%x\ %H:%M:%S)
CR=$'\n'
REV=$(tput rev)
OFF=$(tput sgr0)
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.
@joaocc
joaocc / win2012r2--hyperv.boxst
Last active November 6, 2016 09:40
Deploy--boxstarter--win2012r2
#
# v1.1.5 2015-08-28 HighSkillz Ltd
#
# START http://goo.gl/bVJNzp
# START http://boxstarter.org/package/url?https://bitbucket.org/api/2.0/snippets/highskillz-deploy/KAMLg/files/win2012r2--hyperv.boxst
#
# START http://goo.gl/yVuh3L
# START http://boxstarter.org/package/url?https://gist.githubusercontent.com/joaocc/f61f9a8e59a5575220ce/raw/win2012r2--hyperv.boxst
# ================================================================
#!/bin/bash
if [ "$(id -u)" != "0" ]; then
echo "This script must be run as root" 1>&2
exit 1
fi
cat <<MAXFILES > /Library/LaunchDaemons/limit.maxfiles.plist
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
@joaocc
joaocc / gist:137f6b44ceefb864e0c09b2dcaa28a5f
Created September 10, 2016 11:02
Terraform panic on "terraform state show"
panic: runtime error: invalid memory address or nil pointer dereference
[signal 0xb code=0x1 addr=0x30 pc=0x4bc772]
goroutine 1 [running]:
panic(0x33b5860, 0xc820012090)
/opt/go/src/runtime/panic.go:481 +0x3e6
github.com/hashicorp/terraform/command.(*StateShowCommand).Run(0xc8201ad200, 0xc82000a1c0, 0x0, 0x0, 0xc8202227d0)
/opt/gopath/src/github.com/hashicorp/terraform/command/state_show.go:53 +0x702
github.com/hashicorp/terraform/vendor/github.com/mitchellh/cli.(*CLI).Run(0xc8201ca900, 0xc8202e0360, 0x0, 0x0)
/opt/gopath/src/github.com/hashicorp/terraform/vendor/github.com/mitchellh/cli/cli.go:153 +0x56e