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 / gist:e3ff80534e9e4f7d50ba6b240e932c80
Last active August 25, 2023 16:53 — forked from crittermike/gist:7b654d3d686a4e434eda
Run a single specific Drupal update hook using Drush
drush php-eval "module_load_install('MYMODULE'); MYMODULE_update_NUMBER();"
# or
drush php:cli
require 'core/modules/taxonomy/taxonomy.post_update.php';
taxonomy_post_update_add_unpublished_nodes_to_taxonomy_index($sandbox);
@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 / 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\-]+"
@Geoff-Ford
Geoff-Ford / master-javascript-interview.md
Last active May 27, 2024 16:10
Eric Elliott's Master the JavaScript Interview Series
@bsingr
bsingr / README.md
Last active August 10, 2017 06:49
SSH into AWS EC2 Instance by tag "Name"
@LindaLawton
LindaLawton / GoogleAuthenticationCurl.sh
Last active June 9, 2024 10:41
Curl bash script for getting a Google Oauth2 Access token
# Tutorial https://www.daimto.com/how-to-get-a-google-access-token-with-curl/
# YouTube video https://youtu.be/hBC_tVJIx5w
# Client id from Google Developer console
# Client Secret from Google Developer console
# Scope this is a space seprated list of the scopes of access you are requesting.
# Authorization link. Place this in a browser and copy the code that is returned after you accept the scopes.
https://accounts.google.com/o/oauth2/auth?client_id=[Application Client Id]&redirect_uri=http://127.0.0.1&scope=[Scopes]&response_type=code
# Exchange Authorization code for an access token and a refresh token.
@ataube
ataube / authenticate_token.js
Last active May 8, 2017 15:53
Keycloak Learnings
// authenticate
function authenticate() {
const url = [
'http://localhost:8080/',
'auth/realms/collectai/protocol/openid-connect/auth',
'?response_type=code&client_id=portals-api&redirect_uri=http://localhost:3000/merchant',
];
document.location.assign(url.join(''));
}
@colophonemes
colophonemes / create_triggers
Last active February 17, 2024 15:15
Postgres TRIGGER to call NOTIFY with a JSON payload
CREATE TRIGGER person_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
'email',
'username'
);
CREATE TRIGGER income_notify AFTER INSERT OR UPDATE OR DELETE ON income
FOR EACH ROW EXECUTE PROCEDURE notify_trigger(
'id',
@bsingr
bsingr / LICENSE.txt
Last active February 26, 2024 10:12
http json echo server written in python3
Copyright (c) 2016 Jens Bissinger
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
@bsingr
bsingr / nginx.conf
Last active October 23, 2023 05:46
Shadow traffic duplication reverse proxy
daemon off;
error_log /dev/stderr warn;
worker_processes 4;
events {
worker_connections 1024;
multi_accept on;
}