Skip to content

Instantly share code, notes, and snippets.

View marsyang1's full-sized avatar

marsyang1 marsyang1

  • Taichung,Taiwan
View GitHub Profile
@marsyang1
marsyang1 / install.txt
Created July 18, 2016 10:09
Ubuntu install virtualbox and vagrant
# https://www.liberiangeek.net/2014/09/install-virtualbox-headless-ubuntu-14-04-server-manage-phpvirtualbox/
# http://www.olindata.com/blog/2014/07/installing-vagrant-and-virtual-box-ubuntu-1404-lts
# https://www.godaddy.com/garage/tech/config/install-vagrant-ubuntu-14-04/
# http://superuser.com/questions/845987/how-do-i-upgrade-vagrant-to-last-version-in-ubuntu
sudo apt-get update && sudo apt-get dist-upgrade && sudo apt-get autoremove
sudo apt-get install build-essential dkms
sudo vi /etc/apt/sources.list.d/virtualbox.list
deb http://download.virtualbox.org/virtualbox/debian trusty contrib
wget -q http://download.virtualbox.org/virtualbox/debian/oracle_vbox.asc -O- | sudo apt-key add -
sudo apt-get update && sudo apt-get install VirtualBox5.0
#http://stackoverflow.com/questions/15337409/updating-property-value-in-properties-file-without-deleting-other-values
FileInputStream in = new FileInputStream("First.properties");
Properties props = new Properties();
props.load(in);
in.close();
FileOutputStream out = new FileOutputStream("First.properties");
props.setProperty("country", "america");
props.store(out, null);
out.close();
@marsyang1
marsyang1 / ubuntu-install-wordpress.sh
Last active May 19, 2016 18:43
ubuntu-install-wordpress.sh
# reference : https://www.digitalocean.com/community/tutorials/how-to-install-wordpress-with-nginx-on-ubuntu-14-04
cd ~ && apt-get update -y && apt-get install -y wget lsb-release nginx php-fpm rsync vim \
&& debconf-set-selections <<< 'mysql-server mysql-server/root_password password 1234' \
&& debconf-set-selections <<< 'mysql-server mysql-server/root_password_again password 1234' \
&& echo "[client]
user=root
password=1234
host=localhost" > ~/.my.cnf \
&& apt-get update && apt-get install -y mysql-server && service mysql start \
&& echo "create database wordpress" | mysql -u root \
version: '2'
services:
db-mysql-test:
image: mysql
container_name: db-mysql-test
environment:
- MYSQL_ROOT_PASSWORD=1234
command: --character-set-server=utf8mb4 --collation-server=utf8mb4_unicode_ci
wordpress:
image: wordpress
@marsyang1
marsyang1 / build.gradle
Created May 18, 2016 02:51 — forked from edwardbeckett/build.gradle
mysema.querydsl gradle
sourceSets {
generated {
java {
srcDirs = ['src/main/generated']
}
}
}
configurations {
querydslapt
@marsyang1
marsyang1 / querydsl.gradle
Last active May 18, 2016 02:56 — forked from alex-shpak/querydsl.gradle
Gradle script for querydsl-apt processor with separate classpath
// apply plugin: 'idea'
sourceSets {
generated.java
main.java.srcDirs += generated.java.srcDirs
}
idea {
module {
sourceDirs += file('src/main/generated')
@marsyang1
marsyang1 / Linux Shell alias
Last active May 9, 2016 05:48
Linux Shell alias
#http://superuser.com/questions/665274/how-to-make-ls-color-its-output-by-default-without-setting-up-an-alias
## Colorize the ls output ##
alias ls='ls --color=auto'
## Use a long listing format ##
alias ll=ls -la --color=auto
## Show hidden files ##
alias l.='ls -d .* --color=auto'
@marsyang1
marsyang1 / manager-web.xml
Last active September 7, 2016 03:11
tomcat config xml file
<?xml version="1.0" encoding="ISO-8859-1"?>
<!--
Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
@marsyang1
marsyang1 / Jenkins Gitlab integration note
Last active May 9, 2016 05:42
Jenkins Gitlab integration note
1. use docker
# ambassador
docker run -d \
--name ambassador \
--restart always \
--volume /var/run/docker.sock:/var/run/docker.sock \
cpuguy83/docker-grand-ambassador -name jenkins -name gitlab
#jenkins
docker run -d \
@marsyang1
marsyang1 / build.gradle
Last active November 8, 2016 07:04
myeclipse project convert to gradle project
/*
* This build file was auto generated by running the Gradle 'init' task
* by 'mars' at '2016/4/18 下午 1:27' with Gradle 2.12
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/2.12/userguide/tutorial_java_projects.html
*/
// Apply the java plugin to add support for Java