Skip to content

Instantly share code, notes, and snippets.

View mikakoivisto's full-sized avatar

Mika Koivisto mikakoivisto

View GitHub Profile
import groovy.io.FileType
if ( args.length < 2 ) {
println "Scan's thread dump *.log files from directory";
println "";
println "Usage:";
println "groovy ThreadDumpAnalyzer.groovy <directory> <first value to look from thread dump> <second value to look from thread dump> <third value to look from thread dump>";
println "";
return;
}
@awesomejt
awesomejt / Vagrant file
Created January 19, 2017 22:19
Vagrant file to install Jenkins 2 on Ubuntu 16.04 LTS, along with other tools.
# -*- mode: ruby -*-
# vi: set ft=ruby :
Vagrant.configure("2") do |config|
# config.vm.box = "Ubuntu-16LTS"
config.vm.box = "ubuntu/xenial64"
config.vbguest.auto_update = false
config.vm.network "forwarded_port", guest: 8080, host: 8090

Display all renderRequest attribute names

    <ul>
    <#list renderRequest.getAttributeNames() as name >
        <li>${name}</li>
    </#list>
    </ul>

user name: liferay passwod : liferay

Commands:

Setting keyboard:

setxkbmap en_US
@pulsar256
pulsar256 / my_hetzner_xen_setup.md
Last active February 9, 2023 22:20
Hetzner Xen + v4 Subnet + v6 Subnet Setup HowTo

Hetzner Primary IPv4 IP + IPv4/2x Subnet + "Non-Routed" IPv6/64 Subnet HowTo

... so I do not forget the next time I have to figure this stuff out. And perhaps to help other poor souls fiddling with v6/v4 xen setups in a Hetzner network environment.

Basic setup

You can basically follow along the Xen Project Beginners Guide.

The short version

Install Debian Wheezy via Hetzner's installimage on the rescue system, the only important part about partitioning is that you have an LVM volume group named vg0 with enough space for your guests' disks.

@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.
@rotty3000
rotty3000 / search_articles.java
Created December 18, 2012 17:25
search for articles by tags
SearchContext searchContext = new SearchContext();
searchContext.setCompanyId(companyId);
// omit groups to search entire portal
searchContext.setGroupIds(new long[] {groupId});
// tags
searchContext.setAssetTagNames(assetTagNames);
@mrrooijen
mrrooijen / README.md
Last active February 11, 2023 19:44
Setting up XEN on a Hetzner Dedicated Server

Setting up XEN on a Hetzner Dedicated Server

Author: Michael van Rooijen (@mrrooijen)

DISCLAIMER: I am a programmer, not a sysadmin in my day-to-day life. I provide this guide simply as a self-reference, and as a way to contribute to the community of developers. The main motivation for writing this guide is because of the lack of properly written guides/tutorials. They were either out-dated, inaccurate, in a non-English language or simply too vague to understand (at least for me, as a programmer and not a sysadmin).

I hope this guide helps getting you up and running with your own collection of VPS's on your own Dedicated Server over at Hetzner.de.

Requirements:

@natecavanaugh
natecavanaugh / .gitconfig
Created November 16, 2011 23:09
Alias for 'git split'
# Paste this line into your .gitconfig
split = "!f() { git checkout -b $2 && msg=$(git stash save) && git checkout - && git reset --hard $1 && git checkout $2 && [[ ! $msg =~ ^'No local changes to save'$ ]] && git stash pop; }; f"
# move all commits after the SHA to a new branch
# use case: I accidentally make a bunch of commits into my master branch for a specific feature.
# I want to split off a feature branch and reset my current branch to some point in time before my changes.
# usage
# git split SHA NEW_BRANCH_NAME
@rotty3000
rotty3000 / freemarker.ftl
Created October 12, 2011 14:12
setting look and feel settings on a non-instancable portlet embedded in the theme
<#assign locPortletId = "82" />
<#assign PortletPreferencesFactoryUtil = staticUtil["com.liferay.portlet.PortletPreferencesFactoryUtil"] />
<#assign portletSetup = PortletPreferencesFactoryUtil.getLayoutPortletSetup(layout, locPortletId) />
<#if portletSetup.getValue("portletSetupShowBorders", "") != "false" >
<#assign temp = portletSetup.setValue("portletSetupShowBorders", "false") />
<#assign temp = portletSetup.store() />
</#if>