Skip to content

Instantly share code, notes, and snippets.

@SmaugPool
SmaugPool / cardano-cli-completion.md
Last active November 29, 2023 11:57
cardano-cli Bash auto-completion

To enable cardano-cli and cardano-node bash auto-completion for the current shell:

source <(cardano-cli --bash-completion-script cardano-cli)
source <(cardano-cli --bash-completion-script cardano-node)

To enable it for all future sessions:

@cvarjao
cvarjao / .gitignore
Last active February 27, 2024 05:29
OpenShift oc command line cheatsheet
images/
layers/
node_modules/
.cache/
manifests/
@adixchen
adixchen / get_keycloak_access_token.sh
Last active August 31, 2021 14:14
Get Keycloak access token via curl and pretty print it with python
curl \
-d 'client_id=YOUR_KEYCLOAK_CLIENT' \
-d 'username=YOUR_USERNAME' \
-d 'password=YOUR_PASSWORD' \
-d 'grant_type=password' \
'https://YOUR_KEYCLOAK_SERVER_HOST/auth/realms/YOUR_REALM/protocol/openid-connect/token' \
| python -m json.tool
@ivargrimstad
ivargrimstad / ApplicationConfig.java
Last active July 30, 2019 14:53
Microservices in Java - Swarm example
@ApplicationPath("/")
public class ApplicationConfig extends Application {
@Override
public Set<Class<?>> getClasses() {
Set<Class<?>> resources = new HashSet<>();
resources.add(HelloResource.class);
return resources;
}
}
@md5
md5 / 00_README.md
Last active June 20, 2024 15:54
Demonstration Docker config for Wordpress on PHP-FPM behind Nginx

Proof of concept setup for Wordpress running under PHP-FPM with an Nginx frontend

Usage

Build a copy of this image:

git clone git://github.com/d9206eacb5a0ff5d6be0.git docker-nginx-fpm
cd docker-nginx-fpm
docker build -t nginx-fpm .
Windows Registry Editor Version 5.00
[-HKEY_CLASSES_ROOT\Directory\Background\shell\Cmder]
[-HKEY_CLASSES_ROOT\Directory\shell\Cmder]
@dpryden
dpryden / ClassLoaderLeakExample.java
Created October 20, 2014 00:01
Example of a ClassLoader leak in Java
import java.io.IOException;
import java.net.URLClassLoader;
import java.nio.file.Files;
import java.nio.file.Paths;
import java.nio.file.Path;
/**
* Example demonstrating a ClassLoader leak.
*
* <p>To see it in action, copy this file to a temp directory somewhere,
@triskell
triskell / cntlm_npm.md
Last active April 13, 2021 10:42
[Windows 7] CNTLM and NPM behind NTLM proxy

CNTLM and NPM behind NTLM proxy on Windows 7

CNTLM

  • Install CNTLM in a folder where you have full rights to run it as administrator.

  • Open cntlm.ini and fill it :

Username    YOUR_USERNAME
Domain YOUR_DOMAIN
describe("Mocking Ext.Ajax.request with Jasmine", function () {
var responseText,
mockResponse = {
responseText: '{"success":true,"count":1,"data":[{name: "id", "type": "int", "maxLenght": "11", "isPrimaryKey": true}]}'
};
it("should mock the Ext.Ajax.request response manipulating the spy mostRecentCall.args", function () {
spyOn(Ext.Ajax, 'request');
@4ndrej
4ndrej / SSLPoke.java
Last active January 3, 2024 09:50
Test of java SSL / keystore / cert setup. Check the comment #1 for howto.
import javax.net.ssl.SSLParameters;
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 {