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
@rkennesson
rkennesson / updateJetbrains.sh
Last active April 30, 2020 02:38 — forked from danielcosta/updateJetbrains.sh
Script to update PhpStorm and others Jetbrains products
#!/usr/bin/env bash
VERSION_PATTERN="([0-9]+\.[0-9]+\.[0-9]+)"
case "${1}" in
"phpstorm")
TOOL_NAME="PhpStorm"
INSTALL_DIR="/opt/phpstorm"
case "${2}" in
"eap")
@rkennesson
rkennesson / jb_install_update.sh
Created April 30, 2020 02:37 — forked from zabidok/jb_install_update.sh
Install or update jetbrains products like PhpStorm, WebStorm, IntelliJ Idea, PyCharm, CLion, ReSharper on Ubuntu and fix problems with non latin hotkeys in gui java application
#!/bin/bash
# installation jetbrains
j_url="https://data.services.jetbrains.com/products/download"
tmp_dir="$HOME/tmp_jb"
install_dir="/opt"
if [ "$(whoami)" != "root" ]
then
echo "Sorry, you are not root."
exit 1
fi
@rkennesson
rkennesson / pycharm.sh
Created April 30, 2020 02:37
PyCharm installation script
# Copyright (c) 2015 Jim Rybarski
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
# The above copyright notice and this permission notice shall be included in
@rkennesson
rkennesson / post_install.sh
Last active July 6, 2019 15:21 — forked from waleedahmad/post_install.sh
Ubuntu post installation script for installing software of your choice.
#!/bin/bash
if [[ $EUID -ne 0 ]]; then
echo "This script must be run as root"
exit 1
else
#Update and Upgrade
echo "Updating and Upgrading"
apt-get update && sudo apt-get upgrade -y
@rkennesson
rkennesson / conda_installer.sh
Created April 1, 2019 16:41 — forked from apoorvalal/conda_installer.sh
download and install conda
CONTREPO=https://repo.continuum.io/archive/
# Stepwise filtering of the html at $CONTREPO
# Get the topmost line that matches our requirements, extract the file name.
ANACONDAURL=$(wget -q -O - $CONTREPO index.html | grep "Anaconda3-" | grep "Linux" | grep "86_64" | head -n 1 | cut -d \" -f 2)
wget -O ~/Downloads/anaconda.sh $CONTREPO$ANACONDAURL
bash ~/Downloads/anaconda.sh
@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))
@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 / 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 = 'jwight@mac.com'
GH_PASSWORD = '1234'