Skip to content

Instantly share code, notes, and snippets.

View ejdyksen's full-sized avatar
😎

E.J. Dyksen ejdyksen

😎
View GitHub Profile
@ejdyksen
ejdyksen / patch-edid.md
Last active March 19, 2024 09:53
A script to fix EDID problems on external monitors in macOS

patch-edid.rb

A script to fix EDID problems on external monitors in macOS.

Instructions

  1. Connect only the problem display.

  2. Create this directory structure (if it doesn't already exist):

@ejdyksen
ejdyksen / start-vm.ps1
Created May 13, 2021 22:18
Start a VM from Azure Automation
## Get the Azure Automation Acount Information
$azConn = Get-AutomationConnection -Name 'AzureRunAsConnection'
## Add the automation account context to the session
Add-AzureRMAccount -ServicePrincipal -Tenant $azConn.TenantID -ApplicationId $azConn.ApplicationId -CertificateThumbprint $azConn.CertificateThumbprint
## Get the Azure VMs with tags matching the value '6am'
$azVMs = Get-AzureRMVM | Where-Object {$_.Name -eq 'VM_NAME_HERE'}
## Start VMs
@ejdyksen
ejdyksen / http-test.rb
Last active August 6, 2020 15:02
A simple script to test if a website is responding to HTTP requests
#!/usr/bin/env ruby
loop do
good = 0
bad = 0
for i in 1..100 do
result = system("curl -sS https://www.google.com/ > /dev/null 2> /dev/null")
if result then
@ejdyksen
ejdyksen / gist:53bfdaa72d9fba1644cc
Created January 20, 2015 21:24
Angular on S3 rewrite rules
<RoutingRules>
<RoutingRule>
<Condition>
<HttpErrorCodeReturnedEquals>403</HttpErrorCodeReturnedEquals>
</Condition>
<Redirect>
<HostName>example.com</HostName>
<ReplaceKeyPrefixWith>#/</ReplaceKeyPrefixWith>
<HttpRedirectCode>302</HttpRedirectCode>
</Redirect>
@ejdyksen
ejdyksen / mini-console.html
Last active September 18, 2017 22:13
A tool for getting at a JS console when there is none available.
<div id="consolelog" style="font-family: 'Courier New', Courier, monospace; font-size: 12px; margin: 40px 30px 0px; background-color: white; border: 2px solid black; padding: 10px;"></div>
<input type="text" id="consoleinput" style="margin: 0px 30px; width: 400px;" onkeypress="return evalConsoleInput(event, this.value);" />
<script type="text/javascript">
var appendConsole = function(message, type) {
var color = "black";
if (type === "error") {
color = "red";
} else if (type === "debug") {
@ejdyksen
ejdyksen / arq5.md
Last active April 12, 2016 14:04
mirror of Arq 5 blog post

Arq 5: Massively faster backup and restore

Today we released Arq 5, and we’re really excited about it! We implemented a bunch of the most-requested features, and we worked hard on improving the performance.

Big Price Change

With Arq 5 we’re switching from per-computer licenses to per-user licenses! Buy one license and use it on all your Macs and PCs!

Way Faster

Arq 5 is faster in several ways:

#!/usr/bin/env bash
uninstall() {
list=`gem list --no-versions`
for gem in $list; do
gem uninstall $gem -aIx
done
gem list
gem install bundler
}
require 'sinatra'
require 'openssl'
require 'json'
post '/' do
body = request.body.read
puts "Time : #{Time.now}"
puts "Actual Signature : #{request.env['HTTP_X_CHARGIFY_WEBHOOK_SIGNATURE_HMAC_SHA_256']}"
puts "Computed Signature: #{signature(body)}"

Run VMware Fusion headless at Mac OS system startup.

I heard you like headless VMs on your Mac so I wrote this script for your launchds.

Assumptions

  • Tested on Mac OS X 10.6.4 with VMware Fusion 2.0.5 and 3.1.1.
  • A interactive user automatically logs into the system at startup. I had some issues trying to get this running without an interactive user logged in. I automatically log in for Airfoil Speakers anyway.
  • Your virtual machines live in /Virtual Machines
@ejdyksen
ejdyksen / forcepush.md
Created September 13, 2013 22:42
Recovering from a forced push

Make sure your working tree is clean. Stash or commit anything you're working on.

❯ git status
# On branch features/enrollment_popout
nothing to commit, working directory clean

Fetch the latest changes from the server.