Skip to content

Instantly share code, notes, and snippets.

@didyhu
didyhu / gist:9775268
Last active Aug 29, 2015
JSF as MVC + Spring as IOC Container
View gist:9775268

JSF as MVC + Spring as IOC Container

Context

  • About
  • Configuration
  • Optional

About

View PasswordUtils.java
package net.csdra.meishanshuhuayuan;
import javax.crypto.SecretKeyFactory;
import javax.crypto.spec.PBEKeySpec;
import java.security.NoSuchAlgorithmException;
import java.security.SecureRandom;
import java.security.spec.InvalidKeySpecException;
/**
* Created by Didy on 2015-12-22.
View application-deploy.properties
# LOGGING
logging.file=myapp.log
logging.level.root=ERROR
logging.level.info.didyapp=INFO
# EMBEDDED SERVER CONFIGURATION
server.port=8080
# DATASOURCE
spring.datasource.url=jdbc:mysql://localhost:3306/test?zeroDateTimeBehavior=convertToNull&useUnicode=yes&characterEncoding=utf8
View .bowerrc
{
"directory": "src/main/webapp/bower_components"
}
View server.sh
#!/bin/bash
TARGET=PATHTOTHEJARORWAR.war
start(){
(java -jar $TARGET &)
}
stop(){
PID=$(status | awk '{ print $2 }')
if [ -z "$PID" ]
@didyhu
didyhu / pom.xml
Created Feb 19, 2016
Getting error "Detected both log4j-over-slf4j.jar AND slf4j-log4j12.jar on the class path, preempting StackOverflowError" when deploy war to aliyun ace.
View pom.xml
<plugin>
<artifactId>maven-war-plugin</artifactId>
<version>2.6</version>
<configuration>
<packagingExcludes>
WEB-INF/lib/log4j-over-slf4j-*.jar
</packagingExcludes>
</configuration>
</plugin>
@didyhu
didyhu / spring-run.sh
Last active May 11, 2016
scripts to run spring boot application
View spring-run.sh
#!/bin/bash
stop(){
for pid in $(ps aux | grep 'java' | grep -v 'grep' | awk '{print $2}')
do
pwd=$(pwd);
cwd=$(readlink /proc/$pid/cwd)
if [ ${cwd} -ef ${pwd} ]
then
echo "killing $pid @ $pwd"
View http_post.js
/**
* Created by Didy on 2016-04-21.
*/
var http = require("http");
var querystring = require("querystring");
var iconv = require('iconv-lite');
var BufferHelper = require('bufferhelper');
function http_post(options, postData, callback) {
var req = http.request(options, (res) => {
View deliver.sh
#!/bash
targethost='root@targethost'
# eg. 'root@dev.csdra.net'
targetpath='/var/www'
# eg. '/var/www'
targetname=TARGETNAME
# eg. 'SomeProject'
targetport=TARGETPORT
# eg. 8080
@didyhu
didyhu / my.ini
Created May 23, 2016
MySQL settings
View my.ini
default_tmp_storage_engine = MyISAM
default-storage-engine = MyISAM
collation-server = utf8mb4_unicode_ci
character-set-server = utf8mb4
You can’t perform that action at this time.