Skip to content

Instantly share code, notes, and snippets.

View rkennesson's full-sized avatar
:octocat:
I may be slow to respond.

Richard Kennesson rkennesson

:octocat:
I may be slow to respond.
View GitHub Profile
pandoc --from mediawiki --to gfm+hard_line_breaks --eol=lf asdf.wiki -o asdf.md
pandoc --from gfm --to mediawiki --eol=lf asdf.md -o asdf1.mediawi
server {
listen 80;
listen [::]:80;
root /var/www/example.com/html;
index index.html index.htm index.nginx-debian.html;
server_name example.com www.example.com;
location / {
@rkennesson
rkennesson / get_gists.py
Created May 21, 2018 07:37 — forked from leoloobeek/get_gists.py
Download all gists for a specific user
# first: mkdir user && cd user && cp /path/to/get_gists.py .
# python3 get_gists.py user
import requests
import sys
from subprocess import call
user = sys.argv[1]
r = requests.get('https://api.github.com/users/{0}/gists'.format(user))
#!/bin/bash
# https://github.com/NicolasBernaerts/ubuntu-scripts/
# --------------------------------------------
# Install extension from Gnome Shell Extensions site
#
# See http://bernaerts.dyndns.org/linux/76-gnome/345-gnome-shell-install-remove-extension-command-line-script
# for installation instruction
#
# Revision history :
# 13/07/2013 - V1.0 : Creation by N. Bernaerts
@rkennesson
rkennesson / withsqlite.py
Created July 30, 2017 16:00 — forked from miku/withsqlite.py
Simple sqlite3 context manager for Python.
#!/usr/bin/env python
import sqlite3
class dbopen(object):
"""
Simple CM for sqlite3 databases. Commits everything at exit.
"""
def __init__(self, path):
self.path = path
@rkennesson
rkennesson / sprunge
Last active July 26, 2017 01:57
sprunge paste
#!/bin/bash
# requires xclip to paste into xsession clipboard otherwise
# print to terminal
if hash xclip 2>/dev/null; then
echo "sending url to clipboard";
curl -s -F 'sprunge=<-' http://sprunge.us | xclip -selection c;
else
curl -s -F 'sprunge=<-' http://sprunge.us;
fi
@rkennesson
rkennesson / functions.sh
Created July 16, 2017 23:20
bash functions
# __ _ _
# / _|_ _ _ __ ___| |_(_) ___ _ __ ___
# | |_| | | | '_ \ / __| __| |/ _ \| '_ \/ __|
# | _| |_| | | | | (__| |_| | (_) | | | \__ \
# |_| \__,_|_| |_|\___|\__|_|\___/|_| |_|___/
#
# ▓▓▓▓▓▓▓▓▓▓
# ░▓ author ▓ cirrus <[email protected]>
# ░▓ code ▓ https://gist.github.com/cirrusUK
# ░▓ mirror ▓ http://cirrus.turtil.net
@rkennesson
rkennesson / managing_and_upgrading_gitlab.md
Created May 29, 2017 04:32 — forked from samrocketman/managing_and_upgrading_gitlab.md
A sane admin workflow for managing your GitLab instance.

Sane GitLab management for an Admin

I've seen it asked a couple of times in #gitlab on freenode about upgrading GitLab and what is a good method or recommended method. While GitLab HQ does not recommend a specific workflow for their upgrades I am here to introduce you to my work flow. Feel free to use it or adapt it to your own style. Please note I wrote the majority of this around GitLab 6.0 but GitLab 6.2 is currently released. This will likely apply to any future GitLab release if they stick to the same model of releasing via SCM.

If you'd like to follow other stuff I write about randomly I have a LinuxQuestions.org blog under the user sag47 or you can look at my recent posts on LinuxQuestions.org by doing an advanced search and search by user name. I try to make them all informative.

A GitLab major version is released on the 22nd of each month. Each release has it's own upgrad

@rkennesson
rkennesson / gitA2gitB.sh
Created May 29, 2017 04:31 — forked from jbdelhommeau/gitA2gitB.sh
Migrate existing respositories in hub A to Github.
#!/bin/bash
repos="my-repo1
my-repo2
my-repo3"
# Git A source can be github, gitlab
GIT_A='gitlab.com'
GIT_A_ORGANIZATION='miahou'
@rkennesson
rkennesson / gh2bb_migrate_cheapass.py
Created May 29, 2017 04:30
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 = '[email protected]'
GH_PASSWORD = '1234'