sudo apt-get install python-setuptools
wget http://downloads.sourceforge.net/project/s3tools/s3cmd/1.5.0-alpha1/s3cmd-1.5.0-alpha1.tar.gz
tar xvfz s3cmd-1.5.0-alpha1.tar.gz
cd s3cmd-1.5.0-alpha1
python setup.py install
s3cmd --configure
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!-- | |
- | |
- The below code will convert a ng-repeat which display 3 column like | |
- 1 | 2 | 3 | |
- 4 | 5 | 6 | |
- 7 | 8 | 9 | |
- 10 | |
- To | |
- | |
- 1 | 5 | 8 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
primary: | |
image: mongo:3.0 | |
volumes: | |
- ./p:/data | |
ports: | |
- "27017:27017" | |
# Our current version of docker-compose doesn't allow extra_hosts which would be the best way | |
# to add curcular dependency container links in this case. We cant upgrade docker-compose | |
# without upgrading docker to 1.7, and we can't do that without upgrading the kernel on our | |
# CentOS VM's. As such we are using the hostname hask below to allow primary and secondary |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
angular.module('app') | |
.controller('ImageUpload', ['$scope', '$log', | |
function ImageUpload($scope, $log) { | |
$scope.upload_image = function (image) { | |
if (!image.valid) return; | |
var imagesRef, safename, imageUpload; | |
image.isUploading = true; | |
imageUpload = { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
#set -x | |
# Shows you the largest objects in your repo's pack file. | |
# Written for osx. | |
# | |
# @see http://stubbisms.wordpress.com/2009/07/10/git-script-to-show-largest-pack-objects-and-trim-your-waist-line/ | |
# @author Antony Stubbs |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var browser = cordova.InAppBrowser.open('http://amazon.com?vitumob_session_id=13279njke12hjhuidhiush124hu', '_blank', 'location=no'); | |
browser.addEventListener('loadstart', function(event) { | |
alert('Began loading this page: ' + JSON.stringify(event)); | |
}); | |
// event fires when the InAppBrowser finishes loading a URL. | |
browser.addEventListener('loadstop', function(event) { | |
// event => {type: 'loadstop', url: 'URL navigated to'} | |
// alert('InAppBrowser Event: ' + JSON.stringify(event)); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Queue class for serializing AJAX calls. | |
// | |
// Inspired by Raynos http://stackoverflow.com/a/4797596/1194060 | |
// | |
// Queue has a public append method that expects some kind of task. | |
// A task is a generic function passed as callback. | |
// Constructor expects a handler which is a method that takes a ajax task | |
// and a callback. Queue expects the handler to deal with the ajax and run | |
// the callback when it's finished |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
server { | |
listen 80; | |
root /var/www/YOUR_DIRECTORY; | |
index index.php index.html index.htm; | |
################################################### | |
# Change "yoururl.com" to your host name | |
server_name yoururl.com; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var AWS = require('aws-sdk'), | |
fs = require('fs'); | |
// http://docs.aws.amazon.com/AWSJavaScriptSDK/guide/node-configuring.html#Credentials_from_Disk | |
AWS.config.loadFromPath('./aws-config.json'); | |
// assume you already have the S3 Bucket created, and it is called ierg4210-shopxx-photos | |
var photoBucket = new AWS.S3({params: {Bucket: 'ierg4210-shopxx-photos'}}); | |
function uploadToS3(file, destFileName, callback) { |
I decided to share this snippet based on seeing what others were doing in this thread: https://www.reddit.com/r/homeassistant/comments/emvk9y/how_do_you_monitor_sensor_battery_levels_looking/
Basically dome device types of battery report the state in different locations and with different string
values that the change node or conditional logic just doesn't work nicely. Using the conditional logic on
this string state value might not be working fully how we think it is or at least didn't for me. When I was
debugging it and getting 10
outputted in a 100
bucket via the gt condition. The best way I've found to
handle these conditions is with a function node.
OlderNewer