Skip to content

Instantly share code, notes, and snippets.

View mxrss's full-sized avatar

Michael T Roth mxrss

  • TMZ
  • Temecula, Ca
View GitHub Profile
ssh_authorized_keys:
- "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDL4Y3XQE7SImLeU1W0he0tyZ/dQREgLHRxxss/c/PNgm0AHGOyLQbfGK4Gem2u4egJzz3lx2lfvDMgvFnG0KT4TzPJHZBHo9g
8ly+2ncjSZvwyqWmzsHSD7e/nO+JXhzGVnsiQhgUUYSvwONVOXFB94+vgsARfp6JVENP+B456HvZQSVAbQbuhDaPc4O/YryEpDPXuWCq17rgWcZHzO2xncfsQwbpI3VcspiRAfNF9i
0Uq2mSkVtajR5z2Bw1fSBYzS9Qkwpu4eQCh+pV84SY6bvbTN8Gwvgs3E/tfegVL+z9Ht+wDeyWhTc1J0sRSJv4+sijfkAZhj+MpgfCnlPh3"
- github:mxrss
- github:mxrss2
hostname: core-host
write_files:
- path: /var/lib/connman/default.config
content: |-
k3os:
password: insecure
@mxrss
mxrss / CouponScrapper
Created November 11, 2013 18:12
Uses powershell to scrape website content for coupon sites using their json api's.
# this grabs offers from stater bros.com
$coupons = $null
$json = Invoke-WebRequest -Uri "http://coupons.staterbros.com/Coupons/Index?pageSize=600&currentPage=1&filter=0&sort=1&couponType=4&brandName=AllBrands&_=1383513834477" | select-object -Property Content
$StaterBriosrawObj = ConvertFrom-Json $json.Content
$StaterBriosrawObj.CouponsGrid | Group-Object { $_.Name } | Sort-Object -Descending Count
$staterCoupons = $StaterBriosrawObj.CouponsGrid
$coupons += $staterCoupons | Select-Object @{Name="Brand"; Expression={ $_.Name.tolower() -replace "[^A-Za-z0-9_.\$@ ]","" }}, #-replace [char]174, '' -replace [char]8482, '' } },
@{Name="Category";Expression={ "N/A"}},
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Xml.Linq;
namespace ConsoleApplication1
{
@mxrss
mxrss / Copy-AWSQueue
Last active January 3, 2016 12:39
Powershell script to copy queues over for AWS
#make global to not inure this only once versus multiple times.
$aws_extensions = Get-Module -ListAvailable | where-object { $_.Name -eq "AWSPowerShell" }
<#
.SYNOPSIS
copy-awsqueue will allow you to copy messages from one queue to another without deleting
@mxrss
mxrss / Vagrantfile
Created January 9, 2014 05:27
Vagrant Configuration for redis, es, memcaches and mysql
Vagrant.configure("2") do |config|
config.vm.box = "precise32"
config.vm.provision :shell, :path=> "bootstrap.sh"
config.vm.network "forwarded_port", guest: 3306, host: 3306
config.vm.network "private_network", ip: "192.168.50.4"
config.vm.provider "virtualbox" do |vb|
vb.customize ["modifyvm", :id, "--memory", "2048"]
@mxrss
mxrss / bootscript.sh
Created January 9, 2014 05:19
Use Vagrant
#!/usr/bin/env bash
apt-get update
# install elasticsearch
cd ~
sudo apt-get update
dpkg --get-selections | grep openjdk-7-jre || sudo apt-get install openjdk-7-jre -y
# download key
@mxrss
mxrss / gist:7797301
Created December 4, 2013 23:10
Add API help link to web api.
protected async override System.Threading.Tasks.Task<HttpResponseMessage> SendAsync(HttpRequestMessage request, System.Threading.CancellationToken cancellationToken)
{
var baseHandler = await base.SendAsync(request, cancellationToken);
var content = await baseHandler.Content.ReadAsAsync<ResponseBase>();
if (content != null)
{
var apiDescription = request.GetActionDescriptor().Configuration.Services.GetApiExplorer().ApiDescriptions.Where(x => x.ActionDescriptor == request.GetActionDescriptor()).SingleOrDefault();
if (apiDescription != null)
@mxrss
mxrss / gist:7796283
Created December 4, 2013 21:54
Returns sample
/// <returns>
/// ## Successfull Requests
///
/// Will have information about the User this information is broken down in the following. The return code will
/// be **200 OK**. The following breakdown of user entity information will be provided to the user.
///
/// | Element Name | Friendly Name | Description |
/// | -------------- | ------------- | -------------------------------- |
/// | userName | User Name |The name of the user in the system|
/// | firstName | First Name | The first name of the user in the system (if availble from authentication provider) |
@mxrss
mxrss / gist:7794968
Created December 4, 2013 20:30
Sample Documentation In Remarks with Markdown.
/// <remarks>
/// ## Successfull Requests
///
/// Will have information about the User this information is broken down in the following. The return code will
/// be **200 OK**. The following breakdown of user entity information will be provided to the user.
///
/// | Element Name | Friendly Name | Description |
/// | -------------- | ------------- | -------------------------------- |
/// | userName | User Name |The name of the user in the system|
/// | firstName | First Name | The first name of the user in the system (if availble from authentication provider) |