Skip to content

Instantly share code, notes, and snippets.

Aleksei Niemi

Block or report user

Report or block Niemi

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Niemi
Niemi / jenkins_standalone_init.d.sh
Created Aug 19, 2015
Init.d script for Jenkins-CI standalone (Tested on Ubuntu 14.04)
View jenkins_standalone_init.d.sh
#! /bin/sh
#/etc/init.d/jenkins
### BEGIN INIT INFO
# Provides: Jenkins-CI
# Required-Start: $local_fs $remote_fs $network $syslog $named
# Required-Stop: $local_fs $remote_fs $network $syslog $named
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: Jenkins-server daemon
# Description: "Jenkins CI Server"
View gist:7c8c326c35885d461ce0272e1d96fb68
[Unit]
Description=Java App
Requires=network.target
After=syslog.target
[Service]
User=tomcat
Group=tomcat
#EnvironmentFile=/etc/profile.d/java
Environment='JAVA_OPTS=-Djava.awt.headless=true -Djava.net.preferIPv4Stack=true -Dfile.encoding=utf-8 -Djava.security.egd=file:/dev/./urandom -Xss256k -Xmx128m -Xms128m'
ExecStart=/usr/bin/java -jar /home/app/app.jar
@Niemi
Niemi / ca
Created Jul 3, 2017
Apache Cassandra Init.d Script by Author: Eric Evans <eevans@racklabs.com>
View ca
#! /bin/sh
### BEGIN INIT INFO
# Provides: cassandra
# Required-Start: $remote_fs $network $named $time
# Required-Stop: $remote_fs $network $named $time
# Should-Start: ntp mdadm
# Should-Stop: ntp mdadm
# Default-Start: 2 3 4 5
# Default-Stop: 0 1 6
# Short-Description: distributed storage system for structured data
View tomcat_systemd.conf
[Unit]
Description=Apache Tomcat Web Application Container
After=network.target
[Service]
Type=forking
Environment=JAVA_HOME=/usr/lib/jvm/latest/jre
Environment=CATALINA_PID=/opt/tomcat/work/tomcat.pid
Environment=CATALINA_HOME=/opt/tomcat
View Self Signed Cert w OpenSSL
#https://wiki.mozilla.org/SecurityEngineering/x509Certs (read it)
#openssl minimum version 1.0.1
export somedomainname="example.com"
#cat > openssl.ss.cnf << EOF
#basicConstraints = CA:FALSE
#subjectAltName =DNS:$somedomainname
#extendedKeyUsage =serverAuth
#EOF
#generate Elliptic Curve Cryptography Self Signed Key
openssl req -new -x509 -sha256 -nodes \
@Niemi
Niemi / netstat output
Created Nov 14, 2013
useful commands
View netstat output
netstat -ntaoep
@Niemi
Niemi / .screenrc
Created Nov 14, 2013
my dotfiles from vim, screen, tmux etc
View .screenrc
startup_message off
vbell off
defutf8 on
nonblock on
# Window numbering starts at 1, not 0.
bind c screen 1
bind ^c screen 1
bind 0 select 10
screen 1
altscreen on
@Niemi
Niemi / ss output
Created Nov 14, 2013
check network connection on server with ss
View ss output
ss -4t -p -e -m -p
@Niemi
Niemi / lsof
Created Aug 29, 2012
lsof check
View lsof
lsof -n -p {procpid}
@Niemi
Niemi / gist:d434f2b94566796a4502
Last active Sep 16, 2015 — forked from dannysheehan/gist:9d67adb67eeef6ad1413
haproxy.cfg configuration for 1Gb KVM with 1 CPU with backend NGINX and percona /mariadb cluster.
View gist:d434f2b94566796a4502
#---------------------------------------------------------------------------
# @(#)$Id$
#title :/etc/haproxy/haproxy.cfg
#description :ftmon cluster haproxy config. NGINX and XtraDB Cluster backend
#author :Danny W Sheehan
#date :July 2014
#website :ftmon.org
#
# This is a work in progress. A lot of trial and error and man hours have
# gone into this configuration. I have referenced sources that have been
You can’t perform that action at this time.