Skip to content

Instantly share code, notes, and snippets.

View martinisoft's full-sized avatar
🏠
Coding from home

Aaron Kalin martinisoft

🏠
Coding from home
View GitHub Profile
@martinisoft
martinisoft / main.cpp
Created June 8, 2009 04:58
List files in directory recursively
#include <sys/types.h>
#include <dirent.h>
#include <errno.h>
#include <vector>
#include <string>
#include <iostream>
using namespace std;
// getdir - returns vector of files in all directories of directory
@martinisoft
martinisoft / crash.log
Last active October 16, 2020 16:04
Terraform crash log
2020/10/16 10:53:22 [INFO] Terraform version: 0.13.4
2020/10/16 10:53:22 [INFO] Go runtime version: go1.14.9
2020/10/16 10:53:22 [INFO] CLI args: []string{"/usr/local/bin/terraform", "apply"}
2020/10/16 10:53:22 [DEBUG] Attempting to open CLI config file: /Users/martinisoft/.terraformrc
2020/10/16 10:53:22 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/10/16 10:53:22 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/10/16 10:53:22 [DEBUG] ignoring non-existing provider search directory /Users/martinisoft/.terraform.d/plugins
2020/10/16 10:53:22 [DEBUG] ignoring non-existing provider search directory /Users/martinisoft/Library/Application Support/io.terraform/plugins
2020/10/16 10:53:22 [DEBUG] ignoring non-existing provider search directory /Library/Application Support/io.terraform/plugins
2020/10/16 10:53:22 [INFO] CLI command args: []string{"apply"}
2020/10/06 15:45:35 [WARN] Log levels other than TRACE are currently unreliable, and are supported only for backward compatibility.
Use TF_LOG=TRACE to see Terraform's internal logs.
----
2020/10/06 15:45:35 [INFO] Terraform version: 0.13.4
2020/10/06 15:45:35 [INFO] Go runtime version: go1.14.9
2020/10/06 15:45:35 [INFO] CLI args: []string{"/usr/local/bin/terraform", "plan"}
2020/10/06 15:45:35 [DEBUG] Attempting to open CLI config file: /Users/martinisoft/.terraformrc
2020/10/06 15:45:35 [DEBUG] File doesn't exist, but doesn't need to. Ignoring.
2020/10/06 15:45:35 [DEBUG] ignoring non-existing provider search directory terraform.d/plugins
2020/10/06 15:45:35 [DEBUG] ignoring non-existing provider search directory /Users/martinisoft/.terraform.d/plugins
@martinisoft
martinisoft / nginx
Created March 13, 2012 14:00
nginx init.d script
#!/bin/sh
### BEGIN INIT INFO
# Provides: nginx
# Required-Start: $local_fs $remote_fs $network $syslog
# Required-Stop: $local_fs $remote_fs $network $syslog
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: starts the nginx web server
# Description: starts nginx using start-stop-daemon
@martinisoft
martinisoft / gistie.rb
Created September 23, 2008 06:29 — forked from pieter/gistie.rb
command-line posting to gist
#!/usr/bin/env ruby
# Made by Pieter de Bie <frimmirf@gmail.com>
# Based on a "Pastie" task by someone
require "tempfile"
GIST_URL = 'http://gist.github.com/gists'
GIST_LOGIN_URL = 'https://gist.github.com/session'
USERNAME = "martinisoft"
TOKEN = "6ef8395fecf207165f1a82178ae1b984"
@martinisoft
martinisoft / openvz.rb
Created January 28, 2014 18:25
Crazy ohai plugin to re-write network address
provide "ipaddress"
require_plugin "#{os}::network"
require_plugin "#{os}::virtualization"
if virtualization["system"] == "openvz"
network["interfaces"]["venet0:0"]["addresses"].each do |ip, params|
if params["family"] == "inet"
ipaddress ip
end
end
@martinisoft
martinisoft / .powrc
Created October 21, 2013 15:30
rvm friendly powrc
if [ -f "${rvm_path}/scripts/rvm" ]; then
source "${rvm_path}/scripts/rvm"
if [ -f ".rvmrc" ]; then
source ".rvmrc"
elif [ -f ".ruby-version" ] && [ -f ".ruby-gemset" ]; then
rvm use `cat .ruby-version`@`cat .ruby-gemset`
elif [ -f ".ruby-version" ]; then
rvm use `cat .ruby-version`
@martinisoft
martinisoft / nokogiri_fix.md
Last active December 17, 2015 09:19
Fix the WARNING: Nokogiri was build against LibXML 2.7.8, but has dynamically loaded (insert version here) on Mountain Lion

The quick fix

Assuming you have homebrew installed and you use bundler, you can fix this issue by doing the following:

gem uninstall nokogiri libxml-ruby
brew update
brew uninstall libxml2
brew uninstall libxslt
brew install libxml2 --with-xml2-config
@martinisoft
martinisoft / caveatPatchor.js
Last active December 15, 2015 16:49
My (current) Propane hacks via caveatPatchor.js
/**
Sample Propane caveatPatchor.js file based on tmm1's avatar hack.
You'll need at least version 1.1.1 to experiment with this:
http://propaneapp.com/appcast/Propane.1.1.1.zip
Once I'm sure exposing this hack-injection point doesn't cause problems
I'll do an official auto-updating version.
As of version 1.1.1, Propane will load and execute the contents of
@martinisoft
martinisoft / pidcheck.sh
Created January 7, 2013 21:33
Pidcheck script
#!/usr/bin/env bash
function is_process_alive {
set +e
if [ -n $1 ] && kill -0 $1 >/dev/null 2>&1; then
echo "yes"
fi
set -e
}