Skip to content

Instantly share code, notes, and snippets.

View patlachance's full-sized avatar

Patrice Lachance patlachance

View GitHub Profile

Command:

curl https://git.io/ -i -F "url=https://github.com/YOUR_GITHUB_URL" -F "code=YOUR_CUSTOM_NAME"

URLs that can be created is from:

  • https://github.com/*
  • https://*.github.com
  • https://*.github.com/*
  • https://*.github.io
curl https://raw.githubusercontent.com/powdahound/ec2instances.info/master/www/instances.json | jq -r ' .[] | [ .instance_type , .pricing."eu-west-1".linux.ondemand , .pricing."eu-west-1".linux.reserved."yrTerm1Convertible.noUpfront"] | @csv' > prices.csv
head prices.csv
"c5d.xlarge","0.218","0.173"
"m5a.2xlarge","0.384","0.311"
"c5.9xlarge","1.728","1.369"
"m5.24xlarge","5.136","4.147"
"i3en.12xlarge","6","4.721"
"m5d.12xlarge","3.024","2.445"
"c5.large","0.096","0.076"
@patlachance
patlachance / GoogleSpreadsheet.html
Created April 19, 2020 08:02 — forked from terrywbrady/GoogleSpreadsheet.html
Sample HTML/JS to parse a Google Spreadsheet
<!doctype html>
<html>
<head>
<script src="//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script type="text/javascript">
var spData = null;
function doData(json) {
spData = json.feed.entry;
}
@patlachance
patlachance / GIT_SSH_COMMAND.sh
Created August 16, 2018 14:16 — forked from larryli/GIT_SSH_COMMAND.sh
Git ssh socks proxy
#!/bin/sh
export GIT_SSH_COMMAND='ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
git config --global core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
git clone -c=core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"' git@github.com:larryli/ipv4.git
git config core.sshCommand 'ssh -o ProxyCommand="connect -S 127.0.0.1:1080 %h %p"'
server {
listen 443 ssl http2;
listen [::]:443 ssl http2;
server_name yourdomain
ssl_certificate /etc/ssl/localcerts/yourdomain.crt;
ssl_certificate_key /etc/ssl/localcerts/yourdomain.key;
ssl_ecdh_curve prime256v1;
ssl_session_cache builtin:1000 shared:SSL:10m;
@patlachance
patlachance / upload-github-release-asset.sh
Created June 29, 2018 15:22 — forked from stefanbuck/upload-github-release-asset.sh
Script to upload a release asset using the GitHub API v3.
#!/usr/bin/env bash
#
# Author: Stefan Buck
# License: MIT
# https://gist.github.com/stefanbuck/ce788fee19ab6eb0b4447a85fc99f447
#
#
# This script accepts the following parameters:
#
# * owner
@patlachance
patlachance / config-ddwrt-rw.sh
Created June 29, 2017 17:39 — forked from valtoni/config-ddwrt-rw.sh
Config Read Write mode in DD WRT Router
# From: http://www.dd-wrt.com/phpBB2/viewtopic.php?t=86912
# 1. Prepare the USB disk
# Create an ext3 partition using GParted for instance
#2. Configure DD-WRT
#Under Services->Services->Secure Shell:
#* Enable SSHd
#* Click Apply Settings
#
@patlachance
patlachance / gist:2533275743e6e2a8c78c
Created January 17, 2016 21:10 — forked from gmasse/gist:4b0c34be3d797cd729d2
OVH custom iPXE boot (dedicated server)

iPXE customer script (BETA)

Booting your server with your own iPXE script allows cool things like:

  • running diskless bare-metal system like CoreOS, SmartOS, ...
  • recovering with your own Rescue system or bare-metal restore tools (like Acronis and Idera)
  • launching Standard installer like ESXi, Linux, Solaris, ...

How ? Using directly the RESTful API EU|CA or the API console EU|CA.

#!/bin/sh
# This is a sample script for kickstarting a VM according to the openshift.ks script under virt-manager, qemu+KVM, and Linux.
# You certainly need to modify at least the CMDLINE and --location below for it to be useful (unless you work at Red Hat).
set -e
if [ $# -lt 1 ]
then
printf 'Usage: %s vm_name [arg1 [arg2 [...]]]\n' "$0"
@patlachance
patlachance / stackato.yml
Created June 25, 2012 05:09 — forked from troytop/stackato.yml
stackato.yml for redmine
name: redmine
instances: 1
mem: 256M
framework:
type: rails3
services:
redmine-postgresql: postgresql
# env: