Skip to content

Instantly share code, notes, and snippets.

@gabrielke
gabrielke / freemarker.syn
Created May 29, 2012 19:18 — forked from cimm/freemarker.syn
TextPad keyword syntax file for Freemarker.
; TextPad keyword syntax file for Freemarker
; Contributed by Simon Schoeters, version 0.2
HTML=1
[Syntax]
Namespace1 = 2
IgnoreCase = Yes
KeyWordLength =
BracketChars = {}[]()
@gabrielke
gabrielke / user_template.vm
Created May 29, 2012 21:48 — forked from marcellustavares/user_template.vm
User List Template
## Get the reference of DDL Record Service via serviceLocator, which is automatically set in the context
#set ($ddlRecordService = $serviceLocator.findService('com.liferay.portlet.dynamicdatalists.service.DDLRecordLocalService'))
## $reserved_record_set_id is also an object set in the context and it has the value of the list id configured for the portlet instance
#set ($recordSetId = $getterUtil.getInteger($reserved_record_set_id.data, 0))
## call to the retrieve all records of the list
@gabrielke
gabrielke / adempiere1
Last active December 31, 2015 05:49
Adempiere logrotate
/usr/local/adempiere_ilogicV37/source/adempiereTrunk/adempiere/Adempiere/jboss/server/adempiere/log/server.log {
daily
rotate 3
size 1M
compress
delaycompress
missingok
dateext
dateformat .%Y-%m-%d
copytruncate
@gabrielke
gabrielke / Groovy Liferay Regenerate All Images
Last active August 29, 2015 14:01 — forked from CorneAussems/Groovy Liferay Regenerate All Images
Groovy Liferay Regenerate All Images 6.2
############### two scripts inside #######
############### One group only ##############
import com.liferay.portlet.documentlibrary.util.*
import com.liferay.portlet.documentlibrary.lar.*
import com.liferay.portlet.documentlibrary.service.*
import com.liferay.portal.service.*
import com.liferay.portlet.documentlibrary.model.*
import com.liferay.portal.kernel.dao.orm.*
@gabrielke
gabrielke / hetzner_proxmox_interfaces
Last active December 19, 2020 09:07
hetzner proxmox network config
auto lo
iface lo inet loopback
iface enp2s0 inet manual
auto vmbr0
iface vmbr0 inet static
address xxx_1
netmask 255.255.255.192
gateway xxx_2
@gabrielke
gabrielke / post_ct_create.sh
Created November 9, 2017 00:32
Post CT create script
#!/bin/bash
NUM=$1
if [ x$NUM == x ]; then
echo "ERROR:container id parameter is mandatory"
exit 1
fi;
pct exec $NUM -- apt-get --yes install openssh-server
pct exec $NUM -- apt-get --yes install ansible
pct exec $NUM -- mkdir /root/.ssh
package arpad.kosa;
import org.junit.Assert;
import org.junit.Test;
import java.io.*;
public class TestOneNumberGame {
private static final String SAMPLE_GAME = "1 1 2 3 5 4 Arpad\n1 1 2 3 5 3 Elod\n2 2 2 2 2 2 Ond";
private static final String SAMPLE_GAME_NO_ONE = "3 1 2 3 5 4 Arpad\n3 1 2 3 5 3 Elod\n2 2 2 2 2 2 Ond";
package arpad.kosa;
import java.io.*;
import java.util.*;
import java.util.regex.Pattern;
import java.util.stream.Collectors;
public class OneNumberGame {
List<Player> players = new ArrayList<>();
@gabrielke
gabrielke / randomsleep.sh
Last active January 19, 2018 14:13
Super simple random sleep
perl -e 'sleep int(rand(3600))'
@gabrielke
gabrielke / sortdir.sh
Created January 28, 2018 23:10
Sort directories by size, human readable
(for i in *; do du -sh $i; done)|sort -h