Skip to content

Instantly share code, notes, and snippets.

View nddipiazza's full-sized avatar

Nicholas DiPiazza nddipiazza

View GitHub Profile
@Ryanb58
Ryanb58 / install.md
Last active May 17, 2024 13:42
How to install telnet into a alpine docker container. This is useful when using the celery remote debugger in a dev environment.
>>> docker exec -it CONTAINERID /bin/sh
/app # telnet
/bin/sh: telnet: not found

/app # apk update
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.7/community/x86_64/APKINDEX.tar.gz
v3.7.0-243-gf26e75a186 [http://dl-cdn.alpinelinux.org/alpine/v3.7/main]
v3.7.0-229-g087f28e29d [http://dl-cdn.alpinelinux.org/alpine/v3.7/community]
@makuk66
makuk66 / hung-clienttests.py
Created April 17, 2018 13:34
hung-clienttests
#/usr/bin/python
"""
Match up tests starting and completing to find hung tests
"""
import re
import sys
STARTED_RE = re.compile(r'^.* > .*STARTED$')
PASSED_RE = re.compile(r'^.* > .*PASSED$')
SKIPPED_RE = re.compile(r'^.* > .*SKIPPED$')
FAILED_RE = re.compile(r'^.* > .*FAILED$')
@JoeStanton
JoeStanton / ntlm.js
Last active December 1, 2022 08:46
NTLM Authentication with node-fetch
/* eslint-disable no-console */
const https = require('https');
const fetch = require('node-fetch');
const ntlm = require('httpntlm').ntlm;
const keepAlive = new https.Agent({ keepAlive: true });
const handleErrors = (response) => {
if (!response.ok) {
@bertold
bertold / PasswordChange.java
Last active October 13, 2023 09:29
Changing password using the UnboundID LDAP SDK
import com.unboundid.ldap.listener.InMemoryDirectoryServer;
import com.unboundid.ldap.listener.InMemoryDirectoryServerConfig;
import com.unboundid.ldap.listener.InMemoryListenerConfig;
import com.unboundid.ldap.sdk.*;
import com.unboundid.ldif.LDIFException;
/**
* Sample code to demonstrate password change.
* Error handling is not demonstrated here.
*/
@xcoulon
xcoulon / logger_template.adoc
Last active March 20, 2023 10:18
SLF4J Logger Template for Eclipse

SLF4J Logger Template for Eclipse

In Preferences>Java>Editor>Templates, create a new template named logger in the Java type members context and with the following pattern:

/** The usual Logger.*/
private static final Logger LOGGER = LoggerFactory.getLogger(${enclosing_type}.class);
${:import('org.slf4j.Logger','org.slf4j.LoggerFactory')}
@hasithaa
hasithaa / LDIFGenerator.java
Last active December 15, 2022 07:03
A utility to generate LDIF (LDAP Data Interchange Format)
/**
* Copyright (c) 2014.
* This file is licensed 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
*
* http://www.apache.org/licenses/LICENSE-2.0
*
*
@pditommaso
pditommaso / gist:2265496
Created March 31, 2012 14:26
Read/write input/output stream of interactive process
import java.io.*;
public class TestProcessIO {
public static boolean isAlive(Process p) {
try {
p.exitValue();
return false;
}
catch (IllegalThreadStateException e) {