Skip to content

Instantly share code, notes, and snippets.

@wy8162
wy8162 / custom.sh
Created July 17, 2015 20:54
Install Oracle Silently
#!/bin/bash
if [ $USER = "oracle" ]; then
if [ $SHELL = "/bin/ksh" ]; then
ulimit -p 16384
ulimit -n 65536
else
ulimit -u 16384 -n 65536
fi
fi
@radeksimko
radeksimko / how-to.md
Last active June 22, 2022 11:44
VPC endpoint Terraform example setup

How to

ssh ec2-user@IP
aws configure set region us-west-2
aws s3 ls # listing s3 buckets over VPC endpoint privately
@hwdsl2
hwdsl2 / .MOVED.md
Last active April 10, 2025 04:32
IPsec VPN Server Auto Setup Script for CentOS and RHEL
@hhanh00
hhanh00 / reverse-ws-proxy.js
Created June 24, 2015 15:05
Reverse Proxy for websockets using Express JS
var http = require('http'),
httpProxy = require('http-proxy'),
express = require('express');
// create a server
var app = express();
var proxy = httpProxy.createProxyServer({ target: 'http://localhost:8080', ws: true });
var server = require('http').createServer(app);
// proxy HTTP GET / POST
@maniart
maniart / infinite-curry
Last active November 11, 2021 16:05
Infinite Curry
/*
Implement a function that allows for infinite cyrring, and can be used as such:
`_do(fn)(2)(3)(5)(8)(22)(230)(100)(10)();`
*/
function _do(fn) {
var args = []
, fn;
@johannesberdin
johannesberdin / convert.sh
Last active July 1, 2023 22:32
Script for recursively converting all files to UTF-8 (Mac OS X)
#!/bin/bash
# Original by LEXO, http://www.lexo.ch
# Link: https://www.lexo.ch/blog/2013/01/linux-bash-shell-script-for-recursively-converting-all-files-with-various-charsets-in-a-directory-into-utf-8-shell-skript-fur-das-rekursive-konvertieren-von-allen-files-in-einem-verzeichnis-mit-belie/
# Changed by Johannes Berdin, http://johannesberdin.de
# for running under Mac OS X
#
# Version 1.0
#
# This bash script converts all files from within a given directory from any charset to UTF-8 recursively
@arcollector
arcollector / gist:155a8c751f65c15872fb
Last active March 8, 2020 17:31
Seed scanline filling algorithm in JS
var download = function( arrayBuffer ) {
var $a = document.createElement( 'a' );
$a.setAttribute( 'download', +new Date() + '.bmp' );
$a.setAttribute( 'href', URL.createObjectURL( new Blob( [ arrayBuffer ], { type: 'application/octet-binary' } ) ) );
$a.style.display = 'none';
document.body.appendChild( $a );
$a.click();
document.body.removeChild( $a );
}
@kamermans
kamermans / configure_docker0.sh
Last active December 29, 2024 12:44
Change the IP subnet of Docker's docker0 interface
#!/bin/sh -e
#
# NOTE: Since Docker 1.10 (February 4, 2016), it has been possible to configure the
# Docker daemon using a JSON config file. On Linux, this file is normally located at
# /etc/docker/daemon.json. You should use this JSON config method if you are running
# a version of Docker that is at least 1.10!
# Here is an example configuration that sets the docker0 bridge IP to 192.168.254.1/24:
# {
# "bip": "192.168.254.1/24"
# }
@wokamoto
wokamoto / create-snapshot.sh
Last active April 20, 2018 21:04
[AWS-CLI] 自分のボリュームのスナップショットとるやつ
#!/bin/sh
SHELLDIR=`dirname ${0}`
SHELLDIR=`cd ${SHELLDIR}; pwd`
SHELLNAME=`basename $0`
LOG_DIR="/var/log"
LOG_SAVE_PERIOD=14
LOG_FILE="${LOG_DIR}/${SHELLNAME}.log"
AZ=`curl -s http://169.254.169.254/latest/meta-data/placement/availability-zone`
@balint42
balint42 / README.md
Last active March 28, 2021 20:16
parse svg path javascript function

JS function for parsing SVG paths

Parse an svg path object and generate an Array of path commands. Each command is an Array of the form [command, arg1, arg2, ...] NOTE: parsing is done via pathSegList which is faster and more reliable than parsing the path string directly, but might not work in old browsers.