Skip to content

Instantly share code, notes, and snippets.

View mattkasa's full-sized avatar

Matt Kasa mattkasa

  • GitLab, Inc.
  • Reno, NV
View GitHub Profile
@mattkasa
mattkasa / reinviteusers.rb
Last active August 29, 2015 14:04
Re-send invite to not_invited_users
i = Invite.find('54456520a263be3d05000f07') and (i.user_ids - i.invited_user_ids).each { |u| (puts u if Invite.invite_user(i.id, u, { :is_public => i.inviteable.public? })) if User.find(u).contactable_by?(i.company) }
#!/bin/bash
case "${1}" in
disable)
# Disable chef-client cron job
knife ssh "${2}" 'sudo bash -c "crontab -l | sed -e /^[^#].*\\\\/usr\\\\/bin\\\\/chef-client/s/^/#/ | crontab -"'
;;
enable)
# Enable chef-client cron job
knife ssh "${2}" 'sudo bash -c "crontab -l | sed -e /^#.*\\\\/usr\\\\/bin\\\\/chef-client/s/^#// | crontab -"'
@mattkasa
mattkasa / validate_gems.sh
Created February 5, 2013 21:08
Gem Validator
#!/bin/bash
# Validate your project's gems from your gem cache against rightscale's mirror.
gem query --local --details --all | \
sed -e ':a;N;$!ba' -e 's/\n/#/g' | \
sed -e 's/##/\n/g' | \
sed -ne '/^[^[:space:]]\+ ([^)]\+)#/p' | \
while read line; do
name="${line%% *}"
@mattkasa
mattkasa / .gitconfig
Created January 23, 2013 19:27
GIT Aliases: git st/git stat (git status), git ci (check-in or git commit), git co (git checkout), git br (git branch), git ls (git ls-files), git undo (undo last unpushed commit), git cdiff (commit diff, diff of unpushed commits), git ldiff (last diff, diff of last two HEAD refs, eg. use after a pull to see what was pulled), git pstat and git p…
[alias]
st = status
stat = status
ci = commit
co = checkout
br = branch
ls = ls-files
undo = reset --soft HEAD^
merge = merge --no-commit
cdiff = diff --cached
@mattkasa
mattkasa / Deploy.groovy
Created December 6, 2012 23:50
Grails deploy script
includeTargets << grailsScript("Init") << grailsScript("War")
target(deployWar: "Deploy the project WAR.") {
depends(war)
println "Starting WAR deployment ..."
def warFile = new File(warName)
def warFileName = warFile.getName()
def webappName = "app"