Skip to content

Instantly share code, notes, and snippets.

View zmetcalf's full-sized avatar

Zach Metcalf zmetcalf

View GitHub Profile
@zmetcalf
zmetcalf / vagrant-ssh-node
Created November 2, 2015 23:02 — forked from neilk/vagrant-ssh-node
SSH into a Vagrant VM, such that Node.js can be debugged from a debugger or IDE in the host operating system. For some reason, port forwarding in the Vagrant file does not work. See https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q
#!/bin/bash
# SSH into a Vagrant VM, forwarding ports in a way that allows node within Vagrant to be debugged by a debugger
# or IDE in the host operating system. Don't know why, but Vagrantfile port forwarding does not work.
# (https://groups.google.com/forum/#!topic/vagrant-up/RzPooJ0dp6Q)
/usr/bin/vagrant ssh-config > $TMPDIR/vagrant-ssh-config
ssh -F $TMPDIR/vagrant-ssh-config -L 5858:127.0.0.1:5858 default
rm $TMPDIR/vagrant-ssh-config
@zmetcalf
zmetcalf / increase_swap.sh
Created October 11, 2015 22:55 — forked from shovon/increase_swap.sh
Increasing swap size. Only tested on the ubuntu/trusty64 Vagrant box. CREDIT GOES TO ---> http://jeqo.github.io/blog/devops/vagrant-quickstart/
#!/bin/sh
# size of swapfile in megabytes
swapsize=8000
# does the swap file already exist?
grep -q "swapfile" /etc/fstab
# if not then create it
if [ $? -ne 0 ]; then
@zmetcalf
zmetcalf / gist:180bd29c40635189fcf4
Created October 9, 2015 03:13 — forked from loadx/gist:2934332
vagrant file multiple machines
Vagrant::Config.run do |config|
# debug default is :headless
config.vm.boot_mode = "gui"
# the .box file
config.vm.box = "afa-chef-server"
config.vm.box_url = "/V3/base_debian/with-apt.box"
# ssh config
config.ssh.private_key_path = "afa_private_key"
@zmetcalf
zmetcalf / index.html
Created June 26, 2015 02:31
Up Hail Simple Demo
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>QUnit Example</title>
<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/qunit/1.16.0/qunit.min.css">
</head>
<body>
<div id="qunit"></div>
<div id="qunit-fixture"></div>
@zmetcalf
zmetcalf / LCDServoSwitch.ino
Created December 22, 2013 00:07
Sweeps the servo upon a press of the toggle. Needs a class object to truly work because the delay may cause issues. LCD is just for output of position.
#include <LiquidCrystal.h>
#include <Servo.h>
// initialize the lcd library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
Servo myservo;
const int buttonPin = 7;
int buttonState = 0;
int lastButtonState = 0;
@zmetcalf
zmetcalf / LCDTestToggle.ino
Last active January 1, 2016 01:59
This is just to make sure that a toggle does not make false button presses. LCD is just output. It did show that the toggle would make many signals when pressed.
#include <LiquidCrystal.h>
// initialize the lcd library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int buttonPin = 7;
int count = 0;
boolean updated = true;
void setup() {
@zmetcalf
zmetcalf / LCDServoPhotocell.ino
Created December 19, 2013 03:56
This is an example of using a servo with a photocell controlling it. The LCD simply displays the resistance and degrees. http://arduino.cc/en/Tutorial/Knob
#include <LiquidCrystal.h>
#include <Servo.h>
// initialize the lcd library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
Servo myservo;
int photocellPin = 0;
int photocellReading;
int pos = 0;
#include <LiquidCrystal.h>
// initialize the lcd library
LiquidCrystal lcd(12, 11, 5, 4, 3, 2);
int photocellPin = 0;
int photocellReading;
void setup() {
lcd.begin(16, 2);
}
@zmetcalf
zmetcalf / pulse-theme.txt
Created April 1, 2013 18:13
Instructions on theming in pulse - pulse.torweg.org
Generate a sub-project to get started - http://pulse.torweg.org/site/Pulsar/en_US.CMS.displayCMS.369./set-up-a-sub-project
Copy main.xsl from pulse to the xsl directory off of your sub-project's root directory
Create css directory in the web directory with a simple css file inside.
Add a Core file to your bundles directory.
Copy org.torweg.pulse.component.site.StyleController.xml from the pulse directory /bundles/Core and put it in your Core directory
@zmetcalf
zmetcalf / WebDAVinLinuxForPulse.txt
Last active December 14, 2015 08:39
Connecting to WebDAV Folders in Pulse with Linux
Many of the file managers in the Linux system cut off the trailing '/', which is required to access Pulse's WebDAV folders. One solution is to use the command line program davfs2. Here are the instructions for Ubuntu based systems:
Install davfs2 -
$ sudo apt-get install davfs2
Use of this tool generally requires being a super user, but this will not work because Pulse will not be able to upload the files easily.
Configure davfs2 to allow non-root users to mount the folder -
$ sudo dpkg-reconfigure davfs2