Skip to content

Instantly share code, notes, and snippets.

View bsingr's full-sized avatar

bsingr

  • @coliquio - former Sophos, Git Tower, Inovex, 1&1
  • Lake Constance, Germany
View GitHub Profile
@bsingr
bsingr / InfinispanHelloworld.java
Last active June 24, 2019 15:21
Infinispan Cache JDBC Store Playground
// infinispan
import org.infinispan.Cache;
import org.infinispan.configuration.global.*;
import org.infinispan.configuration.cache.*;
import org.infinispan.manager.*;
// os signals
import sun.misc.Signal;
import sun.misc.SignalHandler;
import java.lang.reflect.*;
@bsingr
bsingr / update-gitlab-jira-integration
Last active May 29, 2019 09:52
Gitlab Migrations / Hacks
# use `gitlab-rails console`
JiraService.where("properties LIKE '%[email protected]'").each do |j|
j.url = JIRA_API_URL
j.username = JIRA_USER_EMAIL_ADDRESS
j.password = JIRA_USER_API_TOKEN
j.save
end
@bsingr
bsingr / dump.js
Created November 8, 2018 08:26
dynamodb-dump
const {DynamoDB} = require('aws-sdk');
const fs = require('fs')
let dynamodb = new DynamoDB({
region: 'eu-central-1',
endpoint: 'dynamodb.eu-central-1.amazonaws.com',
accessKeyId: 'ACC',
secretAccessKey: 'SEC'
});
@bsingr
bsingr / README.md
Last active October 1, 2018 12:33
Percentiles

Percentiles

A B
1 1
1 1
2 1
2 1
2 1
2 1
@bsingr
bsingr / node-https.js
Created September 5, 2018 09:22
node-issue-https-request
require('https').get({
host: 'example.com',
port: 443,
path: '/foo/bar',
url: url
}, res => {
res.setEncoding("utf8");
let body = "";
res.on("data", data => {
body += data;
@bsingr
bsingr / list-queues.sh
Last active October 19, 2023 12:16
rabbitmq remove amq.gen queues
#!/bin/sh
USER=admin
PASS=a
rabbitmqadmin -u "$USER" -p "$PASS" list queues | grep -oP "amq.gen-[\w\-]+"
@bsingr
bsingr / SSLPoke.java
Last active October 1, 2018 12:10
Java macOS Keystore CA
import javax.net.ssl.SSLSocket;
import javax.net.ssl.SSLSocketFactory;
import java.io.*;
/** Establish a SSL connection to a host and port, writes a byte and
* prints the response. See
* http://confluence.atlassian.com/display/JIRA/Connecting+to+SSL+services
*/
public class SSLPoke {
public static void main(String[] args) {
@bsingr
bsingr / README.md
Last active August 10, 2017 06:49
SSH into AWS EC2 Instance by tag "Name"
#!/bin/bash
$USERNAME=""
$PASSWORD=""
$HOSTGROUP="Production"
$zabbixApiUrl="https://zabbix/api_jsonrpc.php"
login=$(cat <<EOF
{
"jsonrpc": "2.0",
"method": "user.login",
"params": {
@bsingr
bsingr / git-clean-remote.sh
Created May 16, 2017 16:00
git-clean-merged-remote-branches
git branch -r --merged | grep -v master | sed 's/origin\///' | xargs -n 1 git push --delete origin