Skip to content

Instantly share code, notes, and snippets.

View nioq's full-sized avatar

Steven Chan nioq

  • Tinkertanker
  • Singapore
View GitHub Profile
@nioq
nioq / migrate-repositories-to-github.sh
Created May 29, 2020 09:28
Migrate Bitbucket repositories to GitHub based on CSV list. From https://github.com/Tinkertanker/bitbucket-github-migration
#!/bin/bash
if [[ ! -f $1 ]]; then echo "$1 file not found"; exit 99; fi
read -p 'GitHub Username (not email): ' GH_USERNAME
read -sp 'GitHub Password: ' GH_PASSWORD
(cat "$1" ; echo) | tail -n +2 | tr -d '\r' | while IFS=, read -r bb_repo bb_org gh_repo gh_org description archive private
do
if [ -z "$bb_repo" ]; then continue; fi # skip empty lines
echo
echo "###### Processing $bb_repo -> $gh_org/$gh_repo. Cloning from Bitbucket..."
@nioq
nioq / list-bitbucket-repositories.sh
Created May 29, 2020 07:54
Generate a CSV list of all Bitbucket repositories you have access to. From https://github.com/Tinkertanker/bitbucket-github-migration
#!/bin/bash
read -p 'Bitbucket Username (not email): ' BB_USERNAME
read -sp 'Bitbucket Password: ' BB_PASSWORD
next_url="https://api.bitbucket.org/2.0/repositories?role=member"
while [ ! -z "$next_url" ]; do
response_json=$( curl -s --user $BB_USERNAME:$BB_PASSWORD "$next_url" )
echo "$response_json" | jq -r '.values | map([.slug, .workspace.slug, .description, .is_private] | @csv) | join("\n")'
next_url=$( echo "$response_json" | jq -r '.next' )
weight = input("What is your weight?")
height = input("What is your height?")
weightnum = float(weight)
heightnum = float(height)
bmi = weightnum / (heightnum * heightnum)
bmistring = str(bmi)
print ("your bmi is " + bmistring)
# square with different colored sides
import turtle

Keybase proof

I hereby claim:

  • I am nioq on github.
  • I am nioq (https://keybase.io/nioq) on keybase.
  • I have a public key ASAtPTxevHj5WGE0-QlhqDYvhXaapXrneVAxd4Tc0_HCrAo

To claim this, I am signing this object: