Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am gregschoen on github.
  • I am gregschoen (https://keybase.io/gregschoen) on keybase.
  • I have a public key ASAEjJ1PrB_4lzxfDu0EGS3zlvv8L-evSYD5lFb7RdbTogo

To claim this, I am signing this object:

@gregschoen
gregschoen / shots.php
Created January 9, 2016 06:40
Quick and dirty script to keep my Screenshot folder clean and properly named.
#!/usr/bin/php
<?php
date_default_timezone_set("America/Chicago");
$who = trim(`whoami`);
$base = "/Users/{$who}/Dropbox/Screenshots/";
$files = glob("{$base}*.png");
foreach($files as $file)
{
@gregschoen
gregschoen / index.md
Last active August 29, 2015 14:22
Ending the SSL security warning for VDP's vdp-configure page in 5.8 and 6.0. I'm not sure if this works in 5.5, but I would assume it does.

Signing VDP's SSL Certificate

VDP generates a self-signed certificate without a proper common name (CN), there are two things that need to be done to make the VDP SSL connection green. First, the certificate needs the proper FQDN and second, the certificate must be signed by a trusted CA.

Most of these commands were pulled out of the VDP SHA256 hotfix script and documentation on signing tomcat keys.

If anything goes wrong, you can delete the tomcat key, run the self-signed certificate command without modification and restart the webapp to get the system back to a default state.

Delete the current tomcat key:

@gregschoen
gregschoen / qwarkeeResizeUIView.m
Last active December 17, 2015 08:09
Blog Gists
- (void) updateFrameSize
{
CGPoint orgPoint = self.frame.origin;
CGSize orgSize = self.frame.size;
scaleX = orgSize.width/sizeOfBounds.width;
scaleY = orgSize.height/sizeOfBounds.height;
self.frame = CGRectMake(self.frame.origin.x, self.frame.origin.y, sizeOfBounds.width, sizeOfBounds.height);
self.transform = CGAffineTransformScale(self.transform, scaleX, scaleY);
  • A ninja once received a Hollywood star, he made the handprint when the cement was dry
  • Bullets can't kill a ninja. Even 1 million bullets can not kill a ninja.
  • Bullets dodge ninjas
  • In an average living room there are 1,242 objects ninjas could use to kill you, including the room itself.
  • Ninja always land on their feet. If they don't have feet they will land on their nubs.
  • Ninja always move to America when making a new start as a non-assassin.
  • Ninja can breath underwater anytime they want.
  • Ninja can change complete wardrobes in less than 1 second.
  • Ninja can crush golf balls with 2 fingers, any two fingers.
  • Ninja don't eat or drink very much, and they never have to go to the bathroom.
@gregschoen
gregschoen / Git-Cheatsheet.md
Last active April 5, 2022 14:35
Cheatsheets

Git Reference

Configure Local Branch to have Proper User Credentials

git config user.name "Your Name Here"
git config user.email your@email.com

Branch feature1 set up to track remote branch refs/remotes/origin/master.

@gregschoen
gregschoen / QuitTime
Created February 22, 2012 18:46
When smokers quit
2012-02-22 08:00:00
@gregschoen
gregschoen / wifi_disable.php
Created February 22, 2012 03:42
Wifi Application Disable (Mac)
<?php
// Check current Wifi Network and Disable Applications
$ssid_string = exec("networksetup -getairportnetwork en1");
$my_ssid = "OpenWrt";
preg_match("/^Current Wi-Fi Network: (?P<ssid>[^\W]+)$/", $ssid_string, $match);
if($match['ssid'] != $my_ssid)