Skip to content

Instantly share code, notes, and snippets.

View crapthings's full-sized avatar
😎
🇰🇵我们晚上去

crapthings crapthings

😎
🇰🇵我们晚上去
View GitHub Profile
@gwpantazes
gwpantazes / How to Install JDK MacOS Homebrew.md
Last active April 18, 2024 21:43
How to install different JDK versions on MacOS with Homebrew

How To Install Different JDK Versions on MacOS with Homebrew

Keywords: Java, JDK (Java Development Kit), MacOS, Homebrew, Specific Version

This how-to guide covers how to install different versions of the JDK on MacOS with Homebrew.

Table of Contents

@agrcrobles
agrcrobles / android_instructions_29.md
Last active October 22, 2023 12:09 — forked from patrickhammond/android_instructions.md
Setup Android SDK on OSX with and without the android studio

Hi, I am a fork from https://gist.github.com/patrickhammond/4ddbe49a67e5eb1b9c03.

A high level overview for what I need to do to get most of an Android environment setup and maintained on OSX higher Catalina and Big Sur with and without Android Studio been installed.

Considering the SDK is installed under /Users/<your_user>/Library/Android/sdk folder which is the Android Studio preferred SDK location, but it works fine under /usr/local/share/android-sdk as well, which is a location pretty much used on CI mostly.

Prerequisites:

https://github.com/shyiko/jabba instead ?

@elvizlai
elvizlai / traefik.toml
Created November 24, 2017 03:43
traefik demo
################################################################
# Global configuration
################################################################
# Enable debug mode
#
# Optional
# Default: false
debug = true
@jsoendermann
jsoendermann / oss-upload.sh
Created November 22, 2017 02:18
阿里云 Aliyun OSS curl upload 上传
RESOURCE="/${OSS_BUCKET_NAME}/${OBJECT_NAME}"
CONTENT_MD5=$(openssl dgst -md5 -binary "${FILEPATH}" | openssl enc -base64)
CONTENT_TYPE=$(file -ib "${FILEPATH}" |awk -F ";" '{print $1}')
DATE_VALUE="`TZ=GMT date +'%a, %d %b %Y %H:%M:%S GMT'`"
STRING_TO_SIGN="PUT\n${CONTENT_MD5}\n${CONTENT_TYPE}\n${DATE_VALUE}\n${RESOURCE}"
SIGNATURE=$(echo -e -n $STRING_TO_SIGN | openssl dgst -sha1 -binary -hmac $OSS_ACCESS_KEY_SECRET | openssl enc -base64)
URL="http://${OSS_BUCKET_NAME}.${OSS_REGION}.aliyuncs.com/${OBJECT_NAME}"
curl -i -q -X PUT -T "${FILEPATH}" \
-H "Host: ${OSS_BUCKET_NAME}.${OSS_REGION}.aliyuncs.com" \
-H "Date: ${DATE_VALUE}" \
@alvaropinot
alvaropinot / map-to-object.js
Created October 3, 2017 17:58
"FUNctional" 😜 Map 🗺 to object 🔑
const obj = { a: 1, c: 3, b: 2 }
// Map from object.
const myMap = new Map(Object.entries(obj))
// Map to Object.
// NOTE: Keys will be cast to strings by `.toString`, so any "complex" key like for example `[1, 2]` will become `1,2`
const newObj = [...myMap.entries()]
.reduce((acc, [key, value]) => (Object.assign(acc, { [key]: value })), {})
@markshust
markshust / kadira-apm-setup-README.md
Last active June 11, 2020 02:04
Kadira APM Setup

Kadira APM Setup

Short guide on how to get Kadira APM setup with Docker.

  1. Setup at least on instance with 1.7GB RAM.
  2. Open up firewall ports for inbound TCP port 443. Also open up 11011 & 4000 for debugging. Port 11011 is kadira-engine, port 4000 is the kadira-ui.
  3. Setup a Mongo database, and have the connection string ready (with username and password).
  4. Install Docker https://docs.docker.com/engine/installation/linux/docker-ce/debian/ , run sudo usermod -aG docker your-user, then install Docker Compose https://docs.docker.com/compose/install/ on the instance.
  5. Verify that you have docker and docker compose installed correctly and can use it.
  6. Setup A-records to point your kadira-ip to kadira-engine.domain.com and kadira-ui.domain.com.
@6uimorais
6uimorais / _Self-Hosted-Kadira-APM-Docker-Compose -Ubuntu.md
Last active January 29, 2022 16:34
Self Hosted Kadira APM - Docker Compose - Ubuntu

1 - Get an Ubuntu machine up and running (make sure ports 11011 and 4000 are open)

2 - Install docker + docker-compose (full_install_docker_compose.sh)

3 - Get a docker-compose.yml with mongodb, kadira-ui, kadira-engine and kadira-rma (docker-compose.yml)

3 - Run "sudo docker-compose up" (-d if you want it running on background)

4 - Access http://machineIp:4000 and login as "admin@gmail.com" and "admin" password

5 - Create your APP, get the ID and Secret

6 - Setup kadira in your app by code or settings.json (Config)

7 - Update your app from "free" plan to "paid" to get full access at Kadira ([Update App Plan](https://gist.github.com/6uimorais/1e1de20bbbb2a04fe19fc73f88d6a25f#file-changepl

@oleurud
oleurud / local-mongo-replicaset-with-docker
Last active November 16, 2023 16:57
[Local mongo replicaset with docker] #docker #mongo
# pull the official mongo docker container
docker pull mongo
# create network
docker network create my-mongo-cluster
# create mongos
docker run -d --net my-mongo-cluster -p 27017:27017 --name mongo1 mongo mongod --replSet my-mongo-set --port 27017
docker run -d --net my-mongo-cluster -p 27018:27018 --name mongo2 mongo mongod --replSet my-mongo-set --port 27018
docker run -d --net my-mongo-cluster -p 27019:27019 --name mongo3 mongo mongod --replSet my-mongo-set --port 27019
@zcaceres
zcaceres / Error-Handling-Patterns-Express.md
Last active August 3, 2023 13:40
error handling patterns in Express

Handling Errors

Express.js makes it a breeze to handle errors in your routes.

Express lets you centralizes your error-handling through middleware.

Let's look at patterns for how to get the most out of your error-handling.

First, our error-handling middleware looks like this:

@craigvantonder
craigvantonder / install-nginx-latest.sh
Last active March 29, 2021 14:14
Install Nginx Mainline / Stable on Ubuntu 16.04
#!/bin/bash
# https://www.nginx.com/resources/wiki/start/topics/tutorials/install/
# Switch to root
sudo su
# Add the mainline release
echo "deb http://nginx.org/packages/mainline/ubuntu/ xenial nginx
deb-src http://nginx.org/packages/mainline/ubuntu/ xenial nginx" > /etc/apt/sources.list.d/nginx.list