Skip to content

Instantly share code, notes, and snippets.

View marsyang1's full-sized avatar

marsyang1 marsyang1

  • Taichung,Taiwan
View GitHub Profile
@marsyang1
marsyang1 / docker-up.sh
Last active June 25, 2018 13:30
docker up
# nginx
wget -O /var/nginx_home/conf.d/default.conf https://gist.githubusercontent.com/marsyang1/1fcdb86aa274060ff5be/raw/7e1568c94791e171c6ba046fd7b667e5363c88f4/default.conf
docker run -d \
--name nginx \
-p 80:80 \
-v /home/nginx_home/conf.d:/etc/nginx/conf.d
-v /home/nginx_home/html/:/usr/share/nginx/html
nginx
#scm-manager=
@marsyang1
marsyang1 / JQueryDebugSample.js
Created May 9, 2018 03:56
JQueryDebugSample.js
//1. 在console載入jQuery
var jq = document.createElement('script');
jq.src = "http://code.jquery.com/jquery-latest.min.js";
document.getElementsByTagName('head')[0].appendChild(jq);
$.post("/test/hello.php"
,{"accountName":"hello","birthday":"1980-08-01","bankno":"12341234"}, function (data) {
console.log(data);
console.log(data.data)
});
@marsyang1
marsyang1 / TestRsa2.java
Last active April 11, 2018 07:33
java test Rsa 2048 by using
import com.google.common.base.Charsets;
import com.google.common.io.Files;
import lombok.extern.slf4j.Slf4j;
import org.bouncycastle.asn1.pkcs.PrivateKeyInfo;
import org.bouncycastle.asn1.x509.SubjectPublicKeyInfo;
import org.bouncycastle.openssl.PEMKeyPair;
import org.bouncycastle.openssl.PEMParser;
import org.bouncycastle.openssl.jcajce.JcaPEMKeyConverter;
import org.junit.Test;
@marsyang1
marsyang1 / ubuntu install k8s
Created January 3, 2018 01:35
ubuntu install k8s
# https://kubernetes.io/docs/getting-started-guides/ubuntu/
# https://conjure-up.io/
# http://www.admintome.com/blog/conjuring-up-kubernetes-on-ubuntu/
# lxc https://help.ubuntu.com/lts/serverguide/lxc.html
sudo snap install lxd -y
sudo usermod -a -G lxd ubuntu
newgrp lxd
/snap/bin/lxd init
# Your keymap
#
# Atom keymaps work similarly to style sheets. Just as style sheets use
# selectors to apply styles to elements, Atom keymaps use selectors to associate
# keystrokes with events in specific contexts. Unlike style sheets however,
# each selector can only be declared once.
#
# You can create a new keybinding in this file by typing "key" and then hitting
# tab.
#
@marsyang1
marsyang1 / docker redis commander
Last active May 17, 2019 07:39
redis-cli basic command
# https://hub.docker.com/r/rediscommander/redis-commander
docker run --rm --name redis-commander -d \
--env REDIS_HOSTS=10.10.20.30 \
-p 8081:8081 \
rediscommander/redis-commander:latest
@marsyang1
marsyang1 / Dockerfile
Last active August 27, 2024 18:56
PHP7 alpine with pdo , pdo mysql , gd
# reference gd: https://github.com/docker-library/php/issues/225
# pdo : https://github.com/docker-library/php/issues/62
FROM php:7-fpm-alpine
# PHP extensions
RUN docker-php-ext-install pdo pdo_mysql
RUN apk add --no-cache freetype libpng libjpeg-turbo freetype-dev libpng-dev libjpeg-turbo-dev && \
docker-php-ext-configure gd \
--with-gd \
--with-freetype-dir=/usr/include/ \
--with-png-dir=/usr/include/ \
# https://stackoverflow.com/questions/41378918/cant-see-staring-installation-page-of-wordpress-docker-container-based-on-alpin
version: '2'
services:
web:
image: nginx:latest
ports:
- 80:80
volumes:
- ./nginx_home/site.conf:/etc/nginx/conf.d/default.conf:ro
@marsyang1
marsyang1 / 愛將150維修筆記.md
Last active July 30, 2017 08:23
愛將150維修筆記
@marsyang1
marsyang1 / nginx.conf
Last active July 6, 2022 02:43
wordpress docker
# test env only
# put this file to ./nginx_home
# consider use config generator by https://www.digitalocean.com/community/tools/nginx
user nginx;
worker_processes auto;
error_log /var/log/nginx/error.log notice;
pid /var/run/nginx.pid;