Skip to content

Instantly share code, notes, and snippets.

View splatch's full-sized avatar

Łukasz Dywicki splatch

View GitHub Profile
@rponte
rponte / macrodef-sample.xml
Created May 18, 2011 18:19
ant macrodef sample
<!-- Create migrate task -->
<macrodef name="migrate">
<attribute name="command" />
<attribute name="environment" />
<element name="extraarguments" optional="true" />
<sequential>
<echo>** Executing "migrate @{command}" on "@{environment}" environment **</echo>
<java classname="org.apache.ibatis.migration.Migrator"
failonerror="true" fork="true" classpathref="classpath">
<sysproperty key="file.encoding" value="UTF-8"/>
@KartikTalwar
KartikTalwar / Documentation.md
Last active April 13, 2024 23:09
Rsync over SSH - (40MB/s over 1GB NICs)

The fastest remote directory rsync over ssh archival I can muster (40MB/s over 1gb NICs)

This creates an archive that does the following:

rsync (Everyone seems to like -z, but it is much slower for me)

  • a: archive mode - rescursive, preserves owner, preserves permissions, preserves modification times, preserves group, copies symlinks as symlinks, preserves device files.
  • H: preserves hard-links
  • A: preserves ACLs
<?xml version="1.0" encoding="UTF-8"?>
<!--
Licensed to the Austrian Association for Software Tool Integration (AASTI)
under one or more contributor license agreements. See the NOTICE file
distributed with this work for additional information regarding copyright
ownership. The AASTI licenses this file to you under the Apache License,
Version 2.0 (the "License"); you may not use this file except in compliance
with the License. You may obtain a copy of the License at
@artizirk
artizirk / connect.py
Last active January 26, 2022 21:32
Automaticaly connect the first available modem using ModemManager, supports hotplug
#!/usr/bin/env python3
import dbus
from gi.repository import GObject as gobject
from enum import Enum
from dbus.mainloop.glib import DBusGMainLoop
class MMModemState(Enum):
MM_MODEM_STATE_FAILED = -1
MM_MODEM_STATE_UNKNOWN = 0
MM_MODEM_STATE_INITIALIZING = 1
@paxmanchris
paxmanchris / sso_login_discourse.php
Last active December 26, 2023 09:53
Discourse sso provider login
<?php
require('mysql.php'); // see https://gist.github.com/paxmanchris/f5d4b94f67a8acd8cefc
$me = 'http://'.$_SERVER['HTTP_HOST'].$_SERVER['SCRIPT_NAME'];
$sso_secret = 'YOUR_SSO_PROVIDER_KEY_HERE';
$discourse_url = 'http://example.com';
if(!empty($_GET) and isset($_GET['sso'])){
@thomasdarimont
thomasdarimont / KeycloakAdminClientExample.java
Created January 12, 2016 19:15
Some Keycloak client examples
package de.tdlabs.training.keycloak;
import static java.util.Arrays.asList;
import javax.ws.rs.core.Response;
import org.jboss.resteasy.client.jaxrs.ResteasyClientBuilder;
import org.keycloak.admin.client.Keycloak;
import org.keycloak.admin.client.KeycloakBuilder;
import org.keycloak.representations.idm.CredentialRepresentation;
@sebastianhaas
sebastianhaas / socketcan-interface.service
Created August 6, 2016 15:02
An example systemd unit file to setup a SocketCAN interface on startup
[Unit]
Description=SocketCAN interface can0 with a baudrate of 250000
After=multi-user.target
[Service]
Type=oneshot
RemainAfterExit=yes
ExecStart=/sbin/ip link set can0 type can bitrate 250000 ; /sbin/ifconfig can0 up
ExecReload=/sbin/ifconfig can0 down ; /sbin/ip link set can0 type can bitrate 250000 ; /sbin/ifconfig can0 up
ExecStop=/sbin/ifconfig can0 down
@marcelmaatkamp
marcelmaatkamp / gist:123e8793e07a72a382d8d0e8d66bbd8f
Last active March 26, 2024 10:13
Fix Sonatype Nexus OrientDB
$ ls /opt/sonatype/sonatype-work/nexus3/db/
OSystem accesslog analytics audit component config model.properties security
$ docker-compose exec nexus java -jar ./lib/support/nexus-orient-console.jar
CONNECT PLOCAL:/opt/sonatype/sonatype-work/nexus3/db/component admin admin
REBUILD INDEX *
REPAIR DATABASE --fix-graph
REPAIR DATABASE --fix-links
REPAIR DATABASE --fix-ridbags
@klaernie
klaernie / holymoly.md
Last active April 17, 2024 17:37 — forked from jpmens/holymoly.md
Create openHAB (Jetty) keystore from OpenSSL certificate/key pair

Configure openHAB keystore to use our own TLS server certificates

1. Launch openHAB, and verify that the shipped cert is in effect

$ openssl s_client -connect localhost:8443
[lots of stuff truncated]
-----END CERTIFICATE-----
subject=/C=Unknown/ST=Unknown/L=Unknown/O=openHAB/OU=Unknown/CN=openhab.org
issuer=/C=Unknown/ST=Unknown/L=Unknown/O=openHAB/OU=Unknown/CN=openhab.org
@mcupak
mcupak / set-resolve-parameter-values.out
Created October 9, 2017 06:37
Changing resolve-parameter-values in jboss-cli.xml.
$ sed -i "s/<resolve-parameter-values>false<\/resolve-parameter-values>/\
<resolve-parameter-values>true<\/resolve-parameter-values>/" \
$JBOSS_HOME/bin/jboss-cli.xml