Skip to content

Instantly share code, notes, and snippets.

@devinodaniel
devinodaniel / gist:8f9b8a4f31573f428f29ec0e884e6673
Created November 21, 2017 20:18
Generate SSH RSA Private/Public Key pair with Golang
// This shows an example of how to generate a SSH RSA Private/Public key pair and save it locally
package main
import (
"crypto/rand"
"crypto/rsa"
"crypto/x509"
"encoding/pem"
"golang.org/x/crypto/ssh"
@bmpotter
bmpotter / order-preset-bare-metal.py
Created August 12, 2015 12:58
Example of ordering an hourly pre-set configuration bare metal server
import os
import pprint
import SoftLayer
client = SoftLayer.Client(username=os.environ['SLUSERNAME'], api_key=os.environ['SLAPIKEY'], endpoint_url=SoftLayer.API_PUBLIC_ENDPOINT)
hw = {
'datacenter': {'name': 'tor01'},
'hostname': 'simplebmi',
'domain': 'test.com',
'hourlyBillingFlag': True,
@trongthanh
trongthanh / gist:2779392
Last active June 25, 2024 08:04
How to move a folder from one repo to another and keep its commit history
# source: http://st-on-it.blogspot.com/2010/01/how-to-move-folders-between-git.html
# First of all you need to have a clean clone of the source repository so we didn't screw the things up.
git clone git://server.com/my-repo1.git
# After that you need to do some preparations on the source repository, nuking all the entries except the folder you need to move. Use the following command
git filter-branch --subdirectory-filter your_dir -- -- all
# This will nuke all the other entries and their history, creating a clean git repository that contains only data and history from the directory you need. If you need to move several folders, you have to collect them in a single directory using the git mv command.