Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Writing code

Ben Gonzales MagnusTiberius

💭
Writing code
View GitHub Profile
View dynamodb setup
#!/bin/sh
#setup.sh
#Detect docker service, then exit if dockerd is not running.
servicedocker="[/]dockerd"
if ps aux | grep "$servicedocker"; then
echo "Docker is running"
else
echo "Docker is not running"
echo "Please install Docker: sudo apt install docker.io\n\n"
View gist:0ffa86ed2cb36db615d7990bcfdba5f5
#!/bin/sh
#setup.sh
#Detect docker service, then exit if dockerd is not running.
servicedocker="[/]dockerd"
if ps aux | grep "$servicedocker"; then
echo "Docker is running"
else
echo "Docker is not running"
echo "Please install Docker: sudo apt install docker.io\n\n"
View gist:a1e362294a4864b44d1b2778f161d29b
version: "2"
services:
blobstorage:
container_name: blobstorage
image: blobstorage
build:
context: ./BlobStorage/build/docker
dockerfile: Dockerfile
ports:
@MagnusTiberius
MagnusTiberius / golang-tls.md
Created Sep 24, 2017 — forked from subfuzion/golang-tls.md
Simple Golang HTTPS/TLS Examples
View golang-tls.md
Generate private key (.key)
# Key considerations for algorithm "RSA" ≥ 2048-bit
openssl genrsa -out server.key 2048
    
# Key considerations for algorithm "ECDSA" ≥ secp384r1
# List ECDSA the supported curves (openssl ecparam -list_curves)
openssl ecparam -genkey -name secp384r1 -out server.key
@MagnusTiberius
MagnusTiberius / client.go
Created Sep 24, 2017 — forked from spikebike/client.go
TLS server and client
View client.go
package main
import (
"crypto/tls"
"crypto/x509"
"fmt"
"io"
"log"
)
View install docker
sudo groupadd docker
sudo usermod -aG docker $USER
#install docker
sudo wget https://download.docker.com/linux/static/stable/x86_64/docker-17.03.0-ce.tgz
#>/dev/null 2>&1
sudo tar -xzvf docker-17.03.0-ce.tgz
sudo cp docker/* /usr/bin/
#fix: ref-> https://stackoverflow.com/questions/24396071/docker-error-mountpoint-not-found
sudo apt-get -y install cgroup-bin
View gist:3af0b6945ab3fc4bdf3c2fa520fbb427
ALTER PROCEDURE [dbo].[EIP_EPOEvents_InsertEvent]
(
@ServerID nvarchar(16) = NULL,
@DetectedUTC datetime,
@AgentGUID nvarchar(64),
@Analyzer nvarchar(16),
@AnalyzerName nvarchar(64),
@AnalyzerVersion nvarchar(20),
@AnalyzerHostName nvarchar(128) = NULL,
@AnalyzerIPV4 int = NULL,
View epoll demo
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <netdb.h>
#include <unistd.h>
#include <fcntl.h>
#include <sys/epoll.h>
#include <errno.h>
View main
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <fcntl.h>
#include <unistd.h>
#include <getopt.h>
#include <sys/queue.h>
#include <sys/types.h>
#include <sys/socket.h>
#include <sys/file.h>