Skip to content

Instantly share code, notes, and snippets.

View gabrielke's full-sized avatar
😂
all systems green

Ákos Gábriel gabrielke

😂
all systems green
View GitHub Profile
@gabrielke
gabrielke / backup-docker-secrets.sh
Created March 14, 2021 07:27 — forked from kwonghung-YIP/backup-docker-secrets.sh
Shell script for export all secrets defined in docker swarm
#!/bin/bash
service_name="backup-all-secrets"
secret_list=( `docker secret ls --format "{{ .Name }}"` )
cmd="docker service create \
--name $service_name \
--constraint node.hostname==`hostname` "
for secret in "${secret_list[@]}"
@gabrielke
gabrielke / apache_cors_example
Created March 20, 2018 14:45 — forked from brianlmoon/apache_cors_example
CORS example for Apache with multiple domains
# Sets CORS headers for request from example1.com and example2.com pages
# for both SSL and non-SSL
SetEnvIf Origin "^https?://[^/]*(example1|example2)\.com$" ORIGIN=$0
Header set Access-Control-Allow-Origin %{ORIGIN}e env=ORIGIN
Header set Access-Control-Allow-Credentials "true" env=ORIGIN
# Always set Vary: Origin when it's possible you may send CORS headers
Header merge Vary Origin
@gabrielke
gabrielke / esp8266_pubsubclient.ino
Created March 11, 2018 07:09 — forked from igrr/esp8266_pubsubclient.ino
PubSubClient sample for ESP8266 Arduino
#include <PubSubClient.h>
#include <ESP8266WiFi.h>
const char* ssid = ".................";
const char* password = "................";
char* topic = "esp8266_arduino_out";
char* server = "iot.eclipse.org";
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<>();
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";
@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 / 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 / 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 = {}[]()