Skip to content

Instantly share code, notes, and snippets.

@ali-ince
ali-ince / Program.cs
Created October 18, 2017 12:52
Neo4j - Large Results
using System;
using System.Collections.Generic;
using System.Diagnostics;
using System.Linq;
using System.Threading.Tasks;
using Neo4j.Driver.V1;
namespace Test
{
class Program
@ali-ince
ali-ince / Program.cs
Last active May 9, 2018 13:56
SNI Test Code
using System;
using System.Net;
using System.Net.Security;
using System.Net.Sockets;
using System.Runtime.InteropServices;
using System.Security.Authentication;
using System.Security.Cryptography.X509Certificates;
namespace SNI.Test.Local
{
package main
import (
"flag"
"fmt"
"log"
"os"
"strings"
"github.com/neo4j/neo4j-go-driver/neo4j"
var (
session neo4j.Session
err error
)
if session, err = driver.Session(neo4j.AccessModeRead); err != nil {
return err
}
defer session.Close()
func executeQuery(tx neo4j.Transaction) (interface{}, error) {
var (
counter int
result neo4j.Result
err error
)
if result, err = tx.Run(query, nil); err != nil {
return nil, err
}
var (
recordsProcessed interface{}
err error
)
if recordsProcessed, err = session.ReadTransaction(executeQuery); err != nil {
return err
}
fmt.Printf("\n%d records processed\n", recordsProcessed)
package main
import (
"flag"
"os"
"github.com/neo4j/neo4j-go-driver/neo4j"
)
var (
var (
driver neo4j.Driver
err error
)
useConsoleLogger := func() func(config *neo4j.Config) {
return func(config *neo4j.Config) {
config.Log = neo4j.ConsoleLogger(neo4j.ERROR)
}
}
var (
driver neo4j.Driver
err error
)
if driver, err = neo4j.NewDriver(uri, neo4j.BasicAuth(username, password, ""), func(config *neo4j.Config) {
config.Log = neo4j.ConsoleLogger(neo4j.ERROR)
}); err != nil {
return err
}
@ali-ince
ali-ince / Dockerfile-seabolt-archlinux
Last active March 18, 2019 09:10
A Dockerfile that enables seabolt compilation on arch linux
FROM archlinux/base AS build-openssl-with-static
# Install required packages for re-building openssl with static libraries enabled
RUN pacman -Syyu --noconfirm base-devel asp && useradd -m -d /pkg-build pkg-build
# Update makepkg.conf to enable static libraries
RUN sed -i -e 's/!staticlibs/staticlibs/g' /etc/makepkg.conf
# Trust pgp key for the openssl source
RUN su -c "gpg --recv-keys 8657ABB260F056B1E5190839D9C4D26D0E604491" - pkg-build
# Export openssl package definition
RUN su -c "asp export openssl" - pkg-build
# Build and create a package that includes static libraries