Skip to content

Instantly share code, notes, and snippets.

View mikakoivisto's full-sized avatar

Mika Koivisto mikakoivisto

View GitHub Profile
@mikakoivisto
mikakoivisto / pom.xml
Created February 2, 2012 01:59
Parent pom
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.liferay.sample</groupId>
<artifactId>sample-project</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<name>sample-project</name>
@mikakoivisto
mikakoivisto / plexconnect
Last active December 23, 2015 23:19 — forked from natewalck/plexconnect
#!/bin/bash
### BEGIN INIT INFO
# Provides: plexconnect
# Required-Start: plexmediaserver networking
# Required-Stop: plexmediaserver networking
# Default-Start: 3 4 5
# Default-Stop: 0 1 6
# Short-Description: This is the Plex Connect daemon
# Description: This script starts the Plex Connect
# Python scripts in a detached screen.
@mikakoivisto
mikakoivisto / java7install.sh
Created April 22, 2015 18:23
Ubuntu 14.04 Java 7 automated install script
cat - <<-EOF >> /etc/apt/sources.list.d/webupd8team-java.list
# webupd8team repository list
deb http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
# deb-src http://ppa.launchpad.net/webupd8team/java/ubuntu trusty main
EOF
apt-key adv --recv-keys --keyserver keyserver.ubuntu.com 0xEEA14886
echo debconf shared/accepted-oracle-license-v1-1 select true | /usr/bin/debconf-set-selections
echo debconf shared/accepted-oracle-license-v1-1 seen true | /usr/bin/debconf-set-selections
@mikakoivisto
mikakoivisto / le-renew.sh
Created May 29, 2016 10:46 — forked from bjornjohansen/le-renew.sh
Let's Encrypt renewal script for Nginx
#!/bin/bash
#================================================================
# Let's Encrypt renewal script for Nginx based on the script
# by Erika Heidi for Apache on Ubuntu/Debian
# @author Erika Heidi<erika@do.co>
# @author Bjørn Johansen <post@bjornjohansen.no>
# Usage: ./le-renew.sh [base-domain-name] [path-to-webroot]
#================================================================
domain=$1
webroot=$2
var MIN_MISS_PERCENTAGE = 10;
var fields = [ "CacheType", ".Bean", "ObjectCount", "CacheHits", "CacheMisses", "CacheMissPercentage" ];
var padding30 = Array(30).join(' '), padding12 = Array(12).join(' '), padding20 = Array(20).join(' ');
var platformMBeanServer = Packages.java.lang.management.ManagementFactory.getPlatformMBeanServer();
function printInColumns(values) {
var beanName = values[1];