Skip to content

Instantly share code, notes, and snippets.

View diegofigueroa's full-sized avatar

Diego Figueroa diegofigueroa

View GitHub Profile
@diegofigueroa
diegofigueroa / gh2bb_migrate_cheapass.py
Created July 17, 2018 18:10
Migrate all your private github repos to bitbucket because you're CHEAP.
__author__ = 'schwa'
import os
import subprocess
import glob
from github import Github # pip install PyGithub
from bitbucket.bitbucket import Bitbucket # pip install --user bitbucket-api
GH_USERNAME = 'jwight@mac.com'
GH_PASSWORD = '1234'
@diegofigueroa
diegofigueroa / bitbucket-to-github.rb
Created July 17, 2018 18:05 — forked from rbellamy/bitbucket-to-github.rb
Bulk import Bitbucket repos to Github
#!/usr/bin/env ruby
require 'fileutils'
# Originally -- Dave Deriso -- deriso@gmail.com
# Contributor -- G. Richard Bellamy -- rbellamy@terradatum.com
# 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
require 'rubygems'
require 'rack/oauth2'
client = Rack::OAuth2::Client.new(
:identifier => YOUR_CLIENT_ID,
:secret => YOUR_CLIENT_SECRET,
:redirect_uri => YOUR_REDIRECT_URI, # only required for grant_type = :code
:host => 'rack-oauth2-sample.heroku.com'
)
use Struct.new(:app) {
def call(env)
env["rack.errors"] = $stdout
app.call(env)
end
}
use Rack::Logger, $your_log_level
use Rack::CommonLogger
run YourApp