Skip to content

Instantly share code, notes, and snippets.

@ethnchao
ethnchao / subversion.service
Created May 29, 2018 06:06
Systemd subversion.service
[Unit]
Description=Subversion Repo Service
After=network.target
[Service]
Type=forking
PIDFile=/opt/svnrepo/repo-mirror/svn.pid
ExecStart=/usr/bin/svnserve -d -r /opt/svnrepo/repo-mirror --pid-file /opt/svnrepo/repo-mirror/svn.pid
ExecStop=/bin/kill -s QUIT $MAINPID
ExecReload=/bin/kill -s HUP $MAINPID
@ethnchao
ethnchao / nexus2.service
Created May 29, 2018 06:07
Systemd nexus2.service
[Unit]
Description=Sonatype-Work Nexus 2 Service
After=network.target
[Service]
Type=forking
ExecStart=/opt/sonatype-work/nexus2/bin/nexus start
ExecStop=/opt/sonatype-work/nexus2/bin/nexus stop
ExecReload=/opt/sonatype-work/nexus2/bin/nexus restart
User=admin
@ethnchao
ethnchao / nginx.service
Created May 29, 2018 06:09
Systemd nginx.service
[Unit]
Description=The NGINX HTTP and reverse proxy server
After=syslog.target network.target remote-fs.target nss-lookup.target
[Service]
Type=forking
PIDFile=/usr/local/nginx/logs/nginx.pid
ExecStartPre=/usr/local/nginx/sbin/nginx -t
ExecStart=/usr/local/nginx/sbin/nginx
ExecReload=/bin/kill -s HUP $MAINPID
@ethnchao
ethnchao / nginx.conf
Last active May 29, 2018 06:12
Nginx Configurations
## Global Configuration
user nginx;
worker_processes 8;
events {
worker_connections 4096;
}
error_log /var/log/nginx/nginx.error.log error;
pid /usr/local/nginx/logs/nginx.pid;
@ethnchao
ethnchao / supervisor.service
Created May 29, 2018 06:12
Systemd supervisor.service
# supervisord service for systemd (CentOS 7.0+)
# by ET-CS (https://github.com/ET-CS)
[Unit]
Description=Supervisor daemon
After=network.target
[Service]
Type=forking
ExecStart=/usr/bin/supervisord -c /etc/supervisord-supervisor.conf
ExecStop=/usr/bin/supervisorctl -c /etc/supervisord-supervisor.conf shutdown
@ethnchao
ethnchao / docker.conf
Created May 29, 2018 06:14
Systemd docker.service in docker.service.d
[Service]
ExecStart=
ExecStart=/usr/bin/dockerd $DOCKER_OPTS
@ethnchao
ethnchao / docker-daemon.json
Last active May 29, 2018 06:24
Docker Daemon.json
{
"registry-mirrors": [ "http://a29bfa98.m.daocloud.io" ],
"storage-driver": "overlay2",
"tlsverify": true,
"tlscert": "/home/admin/.docker/client.cer",
"tlskey": "/home/admin/.docker/client.key",
"dns": [ "119.29.29.29", "9.9.9.9" ],
"dns-search": [ "demo.com" ]
}
@ethnchao
ethnchao / activemq.service
Created May 29, 2018 06:39
Systemd activemq.service
[Unit]
Description=ActiveMQ service
After=network.target
[Service]
Type=forking
ExecStart=/var/activemq/bin/activemq start
ExecStop=/var/activemq/bin/activemq stop
User=root
Group=root
@ethnchao
ethnchao / securerandom.source-cli.sh
Last active May 29, 2018 06:42
Java securerandom.source
java $JAVA_OPTS -Djava.security.egd=file:/dev/./urandom -jar /app.jar
@ethnchao
ethnchao / android-app-build.gradle
Created May 29, 2018 06:47
Android Gradle Configurations
apply plugin: 'com.android.application'
//apply plugin: 'com.jakewharton.butterknife'
//apply plugin: 'org.greenrobot.greendao'
//greendao {
// schemaVersion 1
// daoPackage 'com.demo.software.app.greendao.gen'
// targetGenDir 'src/main/java'
//}