Skip to content

Instantly share code, notes, and snippets.

View sheerun's full-sized avatar
🎵

Adam Stankiewicz sheerun

🎵
View GitHub Profile
@sheerun
sheerun / proxy
Last active January 25, 2024 01:11
Automatic SOCKS proxy setup through SSH connection on Mac OS X
# Script for automatic setup of SOCKS proxy through SSH connection.
# It automatically teardowns SOCKS configuration before stopping.
# It's supposed to work on Mac OS X 10.6+
#
# Author: Adam Stankiewicz (@sheerun)
#
[[ -n "$1" ]] || { echo "Usage: proxy user@example.com"; exit 1; }
# get service GUID and NAME (like Wi-Fi) to set SOCKS proxy
@sheerun
sheerun / certgen.rb
Last active April 10, 2022 15:39
Docker TLS certificate generator
# Generates necessary certificates to ~/.docker
#
# Usage:
# bundle install
# ruby certgen.rb <domain>
require 'certificate_authority'
require 'fileutils'
if ARGV.empty?
/* @flow */
export class GraphQLSchema {
getQueryType() {
return "foobar";
}
}
version: '2'
services:
web:
image: node:4-slim
volumes:
- .:/app
command: node /app/index.js
ports:
- "9500:9500"
'use strict';
var _typeof = typeof Symbol === "function" && typeof Symbol.iterator === "symbol" ? function (obj) { return typeof obj; } : function (obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; };
Function.prototype.$asyncbind = function $asyncbind(self, catcher) {
'use strict';
if (!Function.prototype.$asyncbind) {
Object.defineProperty(Function.prototype, '$asyncbind', {
value: $asyncbind,
@sheerun
sheerun / schema.json
Created January 21, 2017 12:33
API Umbrella definition
{
"api": {
"id": "string",
"name": "string",
"sort_order": 0,
"backend_protocol": "http",
"frontend_host": "string",
"backend_host": "string",
"servers": [
{
#!/bin/bash
export NAME=ghost
export TARGET=root@1.2.3.4
export SERVICE=$(mktemp)
cat > $SERVICE <<EOF
[Unit]
Description=Ghost
After=docker.service
@sheerun
sheerun / .bowerrc
Last active March 19, 2023 02:27
Proper .bowerrc file pointing to new Bower registry (if using legacy Bower version)
{
"registry": "https://registry.bower.io"
}
#include <bits/stdc++.h>
using namespace std;
bool prime(long n) {
if (n < 2) return false;
for (long i = 2; i*i <= n; i++) {
if (n % i == 0) return false;
}
#!/bin/sh
printf "Hello world"