Skip to content

Instantly share code, notes, and snippets.

View rbellamy's full-sized avatar

Richard Bellamy rbellamy

  • Ford Pro
  • Cotati, CA
View GitHub Profile
@rbellamy
rbellamy / bitbucket-to-github.rb
Last active October 8, 2024 14:45
Bulk import Bitbucket repos to Github
#!/usr/bin/env ruby
require 'fileutils'
# Originally -- Dave Deriso -- [email protected]
# Contributor -- G. Richard Bellamy -- [email protected]
# If you contribute, put your name here!
# To get your team ID:
# 1. Go to your GitHub profile, select 'Personal Access Tokens', and create an Access token
# 2. curl -H "Authorization: token <very-long-access-token>" https://api.github.com/orgs/<org-name>/teams
# 3. Find the team name, and grabulate the Team ID
#!/usr/bin/env bash
size=1024 # MB
mount_point=$HOME/tmp
name=$(basename "$mount_point")
usage() {
echo "usage: $(basename "$0") [mount | umount | remount | check | orphan]" \
"(default: mount)" >&2
}
@rbellamy
rbellamy / group-perms.py
Created September 20, 2015 23:10
BitBucket to GitHub
#! /usr/bin/env python
from sys import exit, stderr
from subprocess import Popen, PIPE
import json
import urllib
# Run this on the command line to get an access token
# paste in your OAuth consumer key and secret
# paste in your username and password
@rbellamy
rbellamy / schema_compare.sql
Created May 28, 2015 21:29
Oracle schema comparison
REM
REM schema_compare.sql
REM ===================
REM
REM This script is provided by Database Specialists, Inc.
REM (http://www.dbspecialists.com) for individual use and not for sale.
REM Database Specialists, Inc. does not warrant the script in any way
REM and will not be responsible for any loss arising out of its use.
REM
REM Your feedback is welcome! Please send your comments about this script
@rbellamy
rbellamy / ipmitool-sensor-list.md
Last active August 29, 2015 14:19
IPMI troubleshooting and threshold configuration

Run the command

$ ipmitool sensor list all  
CPU1 Temp        | 0x0        | discrete   | 0x0000| na        | na        | na        | na        | na        | na        
CPU2 Temp        | 0x0        | discrete   | 0x0000| na        | na        | na        | na        | na        | na        
System Temp      | 38.000     | degrees C  | ok    | -9.000    | -7.000    | -5.000    | 75.000    | 77.000    | 79.000    
CPU1 Vcore       | 0.976      | Volts      | ok    | 0.808     | 0.816     | 0.824     | 1.432     | 1.440     | 1.448     
CPU2 Vcore       | 0.920      | Volts      | ok    | 0.808     | 0.816     | 0.824     | 1.432     | 1.440     | 1.448     
CPU1 DIMM        | 1.520      | Volts      | ok    | 1.288     | 1.296     | 1.304     | 1.656     | 1.664     | 1.672     
@rbellamy
rbellamy / 51-kensington-expert-mouse.conf
Last active March 25, 2020 16:16
Kensington Expert Mouse Trackball - ButtonMapping
# Kensington Expert Mouse Trackball
# Run "xinput" to see the id and what it's called
#
#
# Run "xev|grep Button -A 3" to see the actual mappings
# Bottom Right - 1
# Bottom Left - 3
# Upper Left - 2
# Upper Right - 8
@rbellamy
rbellamy / install-vagrant-libvirt.sh
Created April 3, 2015 17:33
How to install vagrant-libvirt on ArchLinux so that ruby-libvirt isn't borked
# in case it's already installled
vagrant plugin uninstall vagrant-libvirt
# vagrant's copy of curl prevents the proper installation of ruby-libvirt
sudo mv /opt/vagrant/embedded/lib/libcurl.so{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4{,.backup}
sudo mv /opt/vagrant/embedded/lib/libcurl.so.4.3.0{,.backup}
sudo mv /opt/vagrant/embedded/lib/pkgconfig/libcurl.pc{,.backup}
CONFIGURE_ARGS="with-libvirt-include=/usr/include/libvirt with-libvirt-lib=/usr/lib" vagrant plugin install vagrant-libvirt
@rbellamy
rbellamy / gnome.sh
Created March 30, 2015 03:59
gnome 3.6.2
# GNOME 3.6.2
# stole fair and square from https://gist.github.com/musinsky/2402448#file-gnome-sh
gsettings set org.gnome.desktop.default-applications.terminal exec 'gnome-terminal --geometry=96x24+0-0'
gsettings set org.gnome.desktop.default-applications.terminal exec-arg '-x'
gsettings set org.gnome.desktop.background picture-options 'none'
gsettings set org.gnome.desktop.background color-shading-type 'vertical'
gsettings set org.gnome.desktop.background primary-color '#3C78B4' # (Red: 60 Green: 120 Blue: 180)
gsettings set org.gnome.desktop.background secondary-color '#1E3C5A' # (Red: 30 Green: 60 Blue: 90)
@rbellamy
rbellamy / show-keybindings.sh
Created March 30, 2015 03:53
Show gnome-shell keybindings
for k in `gsettings list-keys org.gnome.desktop.wm.keybindings`; do echo $k = `gsettings get org.gnome.desktop.wm.keybindings $k`; done
@rbellamy
rbellamy / gist:1b14c7936b8550c6d61e
Last active August 29, 2015 14:08
rst2man2 works with rst file and python2
rbellamy@lamassu i ~/.vim/bundle/powerline % python2 /usr/bin/rst2man2.py CONTRIBUTING.rst
.\" Man page generated from reStructuredText.
.
.TH HOW TO CONTRIBUTE "" "" ""
.SH NAME
How to contribute \-
.
.nr rst2man-indent-level 0
.
.de1 rstReportMargin