Skip to content

Instantly share code, notes, and snippets.

View nweddle's full-sized avatar
:octocat:

Nathan Weddle nweddle

:octocat:
View GitHub Profile
@bobthecow
bobthecow / tab.bash
Last active November 10, 2023 08:47
Open new Terminal tabs from the command line
#!/bin/bash
#
# Open new Terminal tabs from the command line
#
# Author: Justin Hileman (http://justinhileman.com)
#
# Installation:
# Add the following function to your `.bashrc` or `.bash_profile`,
# or save it somewhere (e.g. `~/.tab.bash`) and source it in `.bashrc`
#
@apsoto
apsoto / chef-ec2.rake
Created September 5, 2011 05:20
Chef EC2 Node Cleanup task
namespace :ec2 do
# setup chef config
#
config = File.join(File.dirname(__FILE__), '..', '.chef', 'knife.rb')
Chef::Config.from_file(config)
load_gem_or_report(%w{aws})
desc 'Delete any ec2-based chef nodes that no longer exist'
task :cleanup_nodes do
@jimbojsb
jimbojsb / gist:1630790
Created January 18, 2012 03:52
Code highlighting for Keynote presentations

Step 0:

Get Homebrew installed on your mac if you don't already have it

Step 1:

Install highlight. "brew install highlight". (This brings down Lua and Boost as well)

Step 2:

@srinivasmohan
srinivasmohan / hipchat_notify.rb
Created April 19, 2012 05:32
Post Nagios alerts to Hipchat
#!/usr/bin/ruby
require 'rubygems'
require 'hipchat-api'
require 'getopt/long'
require 'socket'
require 'erb'
#Do not modify these constants! (after you set these up, of course)
HipApiKey='ABCDEFGHKJHKJHKJHKJH'
Room='Nagios'
@aslakknutsen
aslakknutsen / blog.md
Created April 19, 2012 16:25
Import your project's history in Sonar

When you do your first Sonar run on your project, you get a lot of new quality numbers to play with, but no trends. You only have one data set for comparison, the now picture.

Wouldn't it be nice if you could see the current trend of the project without waiting a couple of month for the 'daily/weekly' Sonar runs to fill up the data? Well, you're in luck! And if you're using git as a version system as well, this is your day. :)

In the Sonar Advanced Parameter documentation you will find a System Property called sonar.projectDate. The property let you tell Sonar when in time the running analysis was ran.

By combining this property and what your version system does best, track changes to source, we can now play back the history of the project as far as Sonar is concerned.

This little Bash script illustrates the concept. To spell out what it does in human readable form:

@seeker
seeker / NET recompile.bat
Created June 21, 2012 11:18
Force a .NET recompile, instead of wating for it to run in the background
C:
cd %WINDIR%\Microsoft.NET\Framework\
for /d %%D IN (*) DO .\%%D\ngen.exe executeQueuedItems
cd %WINDIR%\Microsoft.NET\Framework64\
for /d %%D IN (*) DO .\%%D\ngen.exe executeQueuedItems
pause
@jakeonrails
jakeonrails / Ruby Notepad Bookmarklet
Created January 29, 2013 18:08
This bookmarklet gives you a code editor in your browser with a single click.
data:text/html, <style type="text/css">#e{position:absolute;top:0;right:0;bottom:0;left:0;}</style><div id="e"></div><script src="http://d1n0x3qji82z53.cloudfront.net/src-min-noconflict/ace.js" type="text/javascript" charset="utf-8"></script><script>var e=ace.edit("e");e.setTheme("ace/theme/monokai");e.getSession().setMode("ace/mode/ruby");</script>
@willurd
willurd / web-servers.md
Last active July 23, 2024 17:12
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@scarolan
scarolan / AWS_Unixify_Windows
Last active June 7, 2018 15:02
This gist will create a new user with Administrator rights on a Windows server AWS instance, install Cygwin and SSHD, and open port 22 so that you can access the machine using SSH. This makes using Windows *much* more tolerable for the Unix administrator. Simply use the script below in your "User Data" field when deploying a new instance. The <p…
<powershell>
# First we add our administrative user, replace username and password with your own
$computer=$env:ComputerName
$user="username" ## Change this!
$password='password' ## And change this too!
$objOu = [ADSI]"WinNT://$computer"
$objGroup = [ADSI]"WinNT://$computer/Administrators,group"
$objUser = $objOU.Create("User", $user)
$objUser.setpassword($password)
@kaloprominat
kaloprominat / macos: manage add list remove login items apple script
Last active July 22, 2024 20:55
macos: manage add list remove login items apple script
# applescript
# add login item
osascript -e 'tell application "System Events" to make login item at end with properties {name: "Notes",path:"/Applications/Notes.app", hidden:false}'
# delete login item
osascript -e 'tell application "System Events" to delete login item "itemname"'
# list loginitems
osascript -e 'tell application "System Events" to get the name of every login item'