Skip to content

Instantly share code, notes, and snippets.

#!/bin/sh
# http://www.marcusoft.net/2014/03/setting-up-complete-node-development.html
clear
echo "******************************************************************************"
echo "Don't go anywhere - I'm going to need your input shortly.."
read -p "[Enter to continue]"
### Set up dependencies
# Configure sources & repos
@rposbo
rposbo / delete unreferenced images.ps1
Created October 7, 2014 11:57
Delete unreferenced images using Powershell
# cd to your project directory
cd "d:\my luverly project\"
# get all the images
$images = Get-ChildItem "d:\my luverly project\img\" -Exclude "*.config"
# for each image..
foreach($img in $images){
$found = ""
@rposbo
rposbo / bongo.sh
Last active August 29, 2015 14:07 — forked from francoisTemasys/bongo.sh
LOADING=false
usage()
{
cat << EOF
usage: $0 [options] <DBNAME>
OPTIONS:
-h Show this help.
-l Load instead of export
@rposbo
rposbo / hoodieconfig.json
Created October 9, 2014 14:11
hoodiecrow config for many users
{
"plugins": ["ID", "X-GM-EXT-1", "XOAUTH2","STARTTLS", "SASL-IR", "AUTH-PLAIN", "NAMESPACE", "IDLE", "ENABLE", "CONDSTORE", "XTOYBIRD", "LITERALPLUS", "UNSELECT", "SPECIAL-USE", "CREATE-SPECIAL-USE"],
"debug": true,
"secureConnection": true,
"port": 993,
"smtpPort": 465,
"users": [
{"testuser":{
"password": "testpass",
"xoauth2":{
@rposbo
rposbo / hoodiestorage.json
Created October 9, 2014 14:13
hoodiecrow storage
{
"INBOX":{
"messages": [
{"raw": "Subject: hello 1\r\n\r\nWorld 1!", "internaldate": "14-Sep-2013 21:22:28 -0300"},
{"raw": "Subject: hello 2\r\n\r\nWorld 2!", "flags": ["\\Seen"]},
{"raw": "Subject: hello 3\r\n\r\nWorld 3!"},
{"raw": "From: sender name <sender@example.com>\r\nTo: Receiver name <receiver@example.com>\r\nSubject: hello 4\r\nMessage-Id: <abcde>\r\nDate: Fri, 13 Sep 2013 15:01:00 +0300\r\n\r\nWorld 4!"},
{"raw": "Subject: hello 5\r\n\r\nWorld 5!"},
{"raw": "Subject: hello 6\r\n\r\nWorld 6!"}
]
@rposbo
rposbo / sql-batch-execution.ps1
Created October 13, 2014 16:01
Getting past Powershell & SQL’s “Incorrect syntax near ‘GO’ ” message
Param(
[string]$Server,
[string]$DB,
[string]$user,
[string]$Pwd,
[string]$Script
)
$batches = $Script -split "GO\r\n"
@rposbo
rposbo / upload-to-blob-storage.ps1
Created October 16, 2014 06:52
A basic script to upload local files to blob storage, settings ContentType correctly for png and jpeg
Param(
[string]$rootDir,
[string]$storage,
[string]$key,
[string]$container
)
try {
$context = New-AzureStorageContext -StorageAccountName $storage -StorageAccountKey $key
@rposbo
rposbo / ubuntu_setup_statsd_mongodb_elasticsearch.sh
Last active August 29, 2015 14:09
A shell script for setting up statsd, elasticsearch, and a mongodb backend
#!/bin/bash
# Prerequisites
echo "#### Starting"
echo "#### apt-get updating and installing prereqs"
sudo apt-get update
sudo apt-get install screen libexpat1-dev libicu-dev git build-essential curl -y
# Node
echo "#### Installing node"
@rposbo
rposbo / WaitForCondition.cs
Created August 15, 2011 08:51
handy little Selenium helper method to wait for a condition from the server side
/*
Usage:
WaitForCondition(
() => _selenium.GetAttribute(string.Format("//div[@id='{0}']@style", divIdToWatch)).IndexOf("block") >= 0,
5000);
*/
private static void WaitForCondition(Func<bool> condition, int timeoutInMilliseconds)
@rposbo
rposbo / Proxy.asmx
Created September 5, 2011 10:03
the most basic local proxy evah
<%@ WebService Language="C#" Class="Proxy" %>
using System;
using System.Collections;
using System.ComponentModel;
using System.Data;
using System.Diagnostics;
using System.Web;
using System.Web.Services;