Skip to content

Instantly share code, notes, and snippets.

View drahamim's full-sized avatar

Daniel Rahamim drahamim

View GitHub Profile
@jeviet
jeviet / self-service-gitlab-migrations.md
Last active July 20, 2026 15:31
Migration from GitLab to GitHub

Self-Service Migration from GitLab to GitHub

Current Status

GitLab to GitHub migrations through gh gl2gh is not yet generally available (GA), so please set your expectations accordingly. It is being built and hardened as a first‑class, self‑serve migration path, but it is currently in private preview, so supported entities and limits may change. The tool supports non-EoL versions of GitLab products.

How the migration works

gh gl2gh is a thin, cross‑platform command‑line wrapper around the GitHub migration APIs. When you migrate a repository, the CLI performs the following sequence for you:

  1. Export - The CLI calls the GitLab project‑export API to produce a .tar.gz archive containing the Git bundle plus project metadata (issues, merge requests, labels, milestones, releases, and so on) as NDJSON.
  2. Stage locally - The archive is downloaded to the machine where you run the command and will be deleted after a successful upload unless --keep-archive is specified.
  3. **Uploa
@obscurerichard
obscurerichard / pull-request-poetry.md
Last active February 20, 2026 21:48
pull-request-poetry.md

Pull request poetry

by Richard Bullington-McGuire richard@obscure.org @obscurerichard on GitHub and Bluesky

Use these as comments in pull requests in order to charm the project owner into taking action on the pull request.

Initial ticklers

lonely pull request
the completist in me pines
for its prompt closure
@markddavidoff
markddavidoff / slack-pagerduty-oncall.py
Last active August 7, 2026 19:18
Updates a Slack User Group with People that are on call in PagerDuty (updated for pagerduty v2 api and pull from env vars instead of KMS). Based on:https://gist.github.com/devdazed/473ab227c323fb01838f
"""
Lambda Func to update slack usergroup based on pagerduty rotation
From: https://gist.github.com/devdazed/473ab227c323fb01838f
NOTE: If you get a permission denied while setting the usergroup it is because theres a workspace preference in slack
that limits who can manage user groups. At the time of writing it was restricted to owners and admins so i had to get
an owner to install the app. First i added them as a collaborator and then had them re-install the app, and got the new
auth token and added that to param store.
@arnauldvm
arnauldvm / .gitconfig
Last active July 13, 2026 08:36
Git sync all local tracking branches with remotes
[alias]
tracking = "!f() { git for-each-ref --format '%(refname:short):%(upstream:short)' 'refs/heads' | egrep -v ':$'; }; f"
is-clean-workdir = "!f() { git diff --stat --exit-code || { echo \"Workdir dirty\"; exit 1; }; }; f"
is-clean-index = "!f() { git diff --stat --cached --exit-code || { echo \"Index dirty\"; exit 2; }; }; f"
is-clean = "!f() { git is-clean-workdir && git is-clean-index; }; f"
co-merge = "!f() { local=\"$1\"; remote=\"$2\"; git checkout \"$local\"; git merge --ff-only \"$remote\"; }; f"
current-branch = rev-parse --abbrev-ref HEAD
sync = "!f() { git is-clean || { echo Aborting sync.; exit 1; }; current=$(git current-branch); git fetch --all; git tracking | while IFS=: read local remote; do echo \"Merging $local with $remote\"; git co-merge \"$local\" \"$remote\"; done 3>&1 1>&2 2>&3 | egrep -i --color 'fatal|$' 3>&1 1>&2 2>&3; git checkout \"$current\"; }; f"
@amarao
amarao / blame-praise.py
Last active May 29, 2026 14:21
Example of argparse with subparsers for python
#!/usr/bin/env python
import argparse
def main(command_line=None):
parser = argparse.ArgumentParser('Blame Praise app')
parser.add_argument(
'--debug',
action='store_true',
help='Print debug info'
data_bag(:users).each do |user|
user_item = data_bag_item('users', user)
user user_item['id'] do
uid user_item['uid']
home user_item['home']
manage_home true
end
end
@spuder
spuder / chef-http-client.rb
Created April 1, 2016 20:43
A working, but ugly way to fetch from a url
ruby_block 'get build' do
block do
require "net/https"
require "uri"
require "json"
uri = URI.parse("http://nexus.example.com/nexus/service/local/repositories/foobar/content/master-5678.zip?describe=info")
http = Net::HTTP.new(uri.host, uri.port)
request = Net::HTTP::Get.new(uri.request_uri)
{
"elasticsearch" : {
"version": "value",
"hash": {
"key1": "value1",
"key2": "value2"
},
"key 3": "value3"
}
}
@devdazed
devdazed / slack-pagerduty-oncall.py
Last active February 11, 2026 20:43
Updates a Slack User Group with People that are on call in PagerDuty
#!/usr/bin/env python
from __future__ import print_function
import json
import logging
from urllib2 import Request, urlopen, URLError, HTTPError
from base64 import b64decode
@vinyar
vinyar / Bootstrapping chef client behind firewall
Created June 25, 2015 18:24
Bootstrapping chef client behind firewall
https://docs.chef.io/knife_bootstrap.html#custom-templates
https://docs.chef.io/install_bootstrap.html
https://docs.chef.io/knife_bootstrap.html
https://github.com/chef/chef/blob/12.2.1/lib/chef/knife/bootstrap/templates/chef-full.erb
https://github.com/chef/chef/blob/11.6.2/lib/chef/knife/bootstrap/chef-full.erb
Blog:
https://www.chef.io/blog/2014/10/28/working-with-chef-behind-your-firewall/
http://www.appneta.com/blog/customizing-chef-bootstrap-templates/
http://www.tomduffield.com/bootstrapping-without-the-internet/