Skip to content

Instantly share code, notes, and snippets.

View OriPekelman's full-sized avatar

Ori Pekelman OriPekelman

View GitHub Profile
version: 1
info:
id: platformsh/express-bun
name: Express on Bun 1.0
description: |
<p>This unofficial template demonstrates building the Express framework for Platform.sh. It includes a minimalist application skeleton that demonstrates how to connect to a MariaDB server. It is intended for you to use as a starting point and modify for your own needs.</p>
<p>Express is a minimalist web framework written in Node.js.</p>
class: starter
featured: true
@OriPekelman
OriPekelman / applications.yaml
Created February 24, 2021 09:55
A simple vault as an app getting started... on platform.sh
#.platform/applications.yaml
- name: vault
type: 'golang:1.15'
source:
root: vault
disk: 1024
hooks:
build: ./vault-install.sh
mounts:
"/data":
echo ";8 8X8888888888888888888888888888888888888888888888888888888888888888888888888[0;
@OriPekelman
OriPekelman / rels_to_env
Last active December 19, 2017 14:02
Small ruby script to export PLATFORM_RELATIONSHIPS as pairs of key, value environment variables and runs the provided command
#!/usr/bin/env ruby
require "base64"
require "json"
if ARGV.length != 3 then #expecting precisely 3 arguments
puts "usage: rels_to_env [relationship name] [environment variable prefix] [start command]\n\nExample:\nexport_rels mysql DB \"java -jar myapp.jar\"\n\noutput:\nexport DB_HOST=\"database.internal\”\nexport DB_PORT=...\n"
else
rels = JSON.parse(Base64.decode64(ENV['PLATFORM_RELATIONSHIPS']))
rel_name= ARGV[0]
prefix = ARGV[1]
@OriPekelman
OriPekelman / gist:c92d32f8eb50023d363281a8e250efc6
Created June 12, 2017 12:38
Get php memory usage stats (column 5) from nginx logs
cat /var/log/php.access.log| awk '{print $6}' | sort -n | awk ' BEGIN { c = 0; sum = 0; min = 0; max =0 } {c++; a[c] = $1; sum += $1;} END { ave = sum / c; if( (c % 2) == 1 ) { median = a[ int(c/2) ]; } else { median = ( a[c/2] + a[c/2-1] ) / 2; min=a[0]; max = a[c-1]; } OFS="\t"; print "Count", "Average", "Median", "Min", "Max"; print c, ave, median, min, max; }'
@OriPekelman
OriPekelman / auto_referesh_google_sheet_ranges_from_column_headers.js
Last active June 2, 2017 12:17
Automatically Create named ranges for each column (First row assumed to be header)
/**
* Automatically Create named ranges for each column
*
* NOTE THAT IT DESTORYS ALL OTHER NAMED RANGES ON EVERY EDIT IN EVERY SHEET
*
* Public Domain by Ori Pekelman (2017)
**/
function addNamedRanges(SS, s, number_of_sheets){
@OriPekelman
OriPekelman / .platform.app.yaml
Created April 18, 2017 12:55
snippet to add wkhtmltopdf to platform.sh
dependencies:
ruby:
"wkhtmltopdf-binary": "> 0.0"
#!/bin/sh
KERNEL="/Users/oripekelman/Sites/xhyve-platform/tmp/cd/install.386/vmlinuz"
INITRD="initrd.img"
CMDLINE="modules=sd-mod,ext4,console quiet console=ttyS0 acpi=on"
MEM="-m 1G"
NET="-s 2:0,virtio-net"
IMG_HDD="-s 4,virtio-blk,hdd.img"
@OriPekelman
OriPekelman / MinneBar.json.html.md
Last active February 22, 2017 10:35
barcamp org api -> pandoc -> md

{width="317" height="100"}

Technology & Design (un)Conference: No Spectators, Only Participants

 

 

"One of the best uses of my Saturday in as long as I can remember." -

tap 'caskroom/cask'
tap 'homebrew/bundle'
tap 'homebrew/core'
tap 'homebrew/dupes'
tap 'jimbojsb/launchrocket'
tap 'homebrew/dupes'
tap 'josegonzalez/php'
brew 'curl'