Skip to content

Instantly share code, notes, and snippets.

View dovidkopel's full-sized avatar

Dovid Kopel dovidkopel

View GitHub Profile
#!/usr/bin/env python3
import json
import os
import sys
from configparser import ConfigParser
from datetime import datetime
from pathlib import Path
import boto3
@dovidkopel
dovidkopel / aws_gremlin_driver.py
Created December 3, 2020 15:47
Simple extending existing gremlin remote driver to work with AWS Neptune with IAM authentication
import os, datetime, hashlib, hmac
from gremlin_python.driver.driver_remote_connection import DriverRemoteConnection
from urllib.parse import urlparse
class AWSDriverRemoteConnection(DriverRemoteConnection):
def __init__(self, url, traversal_source, protocol_factory=None,
transport_factory=None, pool_size=None, max_workers=None,
username="", password="", message_serializer=None,
graphson_reader=None, graphson_writer=None,
@dovidkopel
dovidkopel / openpgp.txt
Created September 30, 2018 17:23
OpenKeychain Linked Identity
This Gist confirms the Linked Identity in my OpenPGP key, and links it to this GitHub account.
Token for proof:
[Verifying my OpenPGP key: openpgp4fpr:95005bb40464863e5e7ec41fa239542ffcace881]
@dovidkopel
dovidkopel / pom.xml
Last active March 17, 2016 12:54
POM for SMB/SCP code samples
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>dovidkopel.com</groupId>
<artifactId>smb-scp</artifactId>
<version>1.0</version>
<name>SMB/SCP</name>
<properties>
import org.alfresco.jlan.server.SrvSession;
import org.alfresco.jlan.server.core.DeviceContext;
import org.alfresco.jlan.server.filesys.FileExistsException;
import org.alfresco.jlan.server.filesys.FileName;
import org.alfresco.jlan.server.filesys.FileOpenParams;
import org.alfresco.jlan.server.filesys.NetworkFile;
import org.alfresco.jlan.server.filesys.TreeConnection;
import org.alfresco.jlan.smb.server.disk.JavaFileDiskDriver;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.BeanFactory;
public enum BeanAccessor {
INSTANCE;
private static BeanFactory beanFactory;
public static void setBeanFactory(BeanFactory _beanFactory) {
beanFactory = _beanFactory;
}
@dovidkopel
dovidkopel / ReceivingScpCommand.java
Last active November 22, 2016 16:39
SCP Integration to Spring application
import org.apache.sshd.common.scp.ScpHelper;
import org.apache.sshd.common.scp.ScpTransferEventListener;
import org.apache.sshd.common.util.GenericUtils;
import org.apache.sshd.server.Command;
import org.apache.sshd.server.scp.ScpCommand;
import org.apache.sshd.server.session.ServerSession;
import org.springframework.beans.factory.BeanFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;