Skip to content

Instantly share code, notes, and snippets.

View joelhandwell's full-sized avatar

Joel Handwell joelhandwell

View GitHub Profile
> kitchen list -l debug
D [Vagrant command] BEGIN (vagrant --version)
D [Vagrant command] END (0m0.00s)
>>>>>> ------Exception-------
>>>>>> Class: Kitchen::ShellOut::ShellCommandFailed
>>>>>> Message: Expected process to exit with [0], but received '1'
---- Begin output of vagrant --version ----
STDOUT:
STDERR: stdin is not a tty
---- End output of vagrant --version ----
@joelhandwell
joelhandwell / unit.rb
Created March 18, 2017 02:50
php7.1 systemd unit config chef resources
file '/lib/systemd/system/php7.1-fpm.service' do
content <<-FILE
[Unit]
Description=The PHP FastCGI Process Manager
After=network.target
[Service]
Type=simple
PIDFile=/usr/local/var/run/php-fpm.pid
ExecStart=/usr/local/sbin/php-fpm --nodaemonize --fpm-config /usr/local/etc/php-fpm.conf
git clone -b PHP-7.1.3 --depth 1 https://github.com/php/php-src.git
@joelhandwell
joelhandwell / install_go1.7.5.bat
Created February 7, 2017 23:22
batch file to install golang 1.7.5 by creating nupkg from package source
git clone https://github.com/joelhandwell/chocolatey-golang.git --branch 1_7_5
cd chocolatey-golang\golang
cpack
choco uninstall golang
choco install -y golang.1.7.5.nupkg
@joelhandwell
joelhandwell / create_odoo_user_via_api.py
Last active September 7, 2022 11:10
Create Odoo User via API
#!/usr/bin/env python
# reference https://www.odoo.com/forum/help-1/question/how-to-create-a-new-user-and-give-him-access-via-api-96337
import xmlrpclib
url = "http://localhost:8069"
db = "Odoo8TestMac"
username = 'admin'
password = 'admin'
common = xmlrpclib.ServerProxy('{}/xmlrpc/2/common'.format(url))
uid = common.authenticate(db, username, password, {})
@joelhandwell
joelhandwell / gist:6f46541bfca9816d4a5f
Last active March 3, 2016 16:43
nokogiri installation in ubuntu12
sudo apt-get install libxslt-dev libxml2-dev -y
bundle config build.nokogiri --use-system-libraries=true --with-xml2-include=/usr/include/libxml2
bundle install
@joelhandwell
joelhandwell / composer.rb
Created January 27, 2016 22:10
github.com/haapp/w_apache chef composer recipe plan
# metadata.rb line 24
depends 'composer'
# Berksfile line 20
cookbook 'composer'
# recipes/default.rb line 71
include_recipe 'w_apache::composer' if node['w_apache']['composer_enabled']
# recipes/composer.rb line 1
@joelhandwell
joelhandwell / profiling.php
Last active October 21, 2015 14:35
PHP Speed Profile Recording Syslog Example
<?php
function do_something1(){
//speed profiling for A
$beforeA = microtime(true);
executeA();
$afterA = microtime(true);
@joelhandwell
joelhandwell / create_databag_local.log
Created October 16, 2015 23:19
Create encrypted data bag locally with chefdk
$ chef --version
Chef Development Kit Version: 0.6.2
$ openssl rand -base64 512 > /tmp/encrypted_data_bag_secret
$ chef generate repo test_repo
$ cd test_repo
$ mkdir -p data_bags/passwords
$ ls data_bags
README.md example passwords
$ echo "{\n \"id\": \"sql_server_root_password\",\n \"password\": \"learnchef_mysql\"\n}" >> data_bags/passwords/sql_server_root_password.json
$ cat data_bags/passwords/sql_server_root_password.json
username: vagrant
password: vagrant
sudo apt-get update
sudo apt-get install build-essential zlib1g-dev git-core sqlite3 libsqlite3-dev
sudo aptitude install mysql-server mysql-client
sudo nano /etc/mysql/my.cnf
change: