Skip to content

Instantly share code, notes, and snippets.

Roland Singer r0l1

Block or report user

Report or block r0l1

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Luzifer
Luzifer / README.md
Last active May 16, 2020
Running docker-compose as a systemd service
View README.md

Running docker-compose as a systemd service

Files

File Purpose
/etc/compose/docker-compose.yml Compose file describing what to deploy
/etc/systemd/system/docker-compose-reload.service Executing unit to trigger reload on docker-compose.service
/etc/systemd/system/docker-compose-reload.timer Timer unit to plan the reloads
/etc/systemd/system/docker-compose.service Service unit to start and manage docker compose
@AlbertXiebnu
AlbertXiebnu / objectRecog.cc&env=python
Last active Jun 22, 2019
tensorflow c++ api to load model and run. from official code base.|-|&tag=gist
View objectRecog.cc&env=python
#include <fstream>
#include <vector>
#include "tensorflow/cc/ops/const_op.h"
#include "tensorflow/cc/ops/image_ops.h"
#include "tensorflow/cc/ops/standard_ops.h"
#include "tensorflow/core/framework/graph.pb.h"
#include "tensorflow/core/framework/tensor.h"
#include "tensorflow/core/graph/default_device.h"
#include "tensorflow/core/graph/graph_def_builder.h"
@r0l1
r0l1 / confirm.go
Last active Jul 14, 2019
Go (golang): How to ask for user confirmation via command line
View confirm.go
/* MIT License
*
* Copyright (c) 2017 Roland Singer [roland.singer@desertbit.com]
*
* Permission is hereby granted, free of charge, to any person obtaining a copy
* of this software and associated documentation files (the "Software"), to deal
* in the Software without restriction, including without limitation the rights
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
* copies of the Software, and to permit persons to whom the Software is
* furnished to do so, subject to the following conditions:
@lsowen
lsowen / check_sig.go
Last active Jul 31, 2019
GPG Signature Verification in go (with golang.org/x/crypto/openpgp)
View check_sig.go
package main
import (
"fmt"
"golang.org/x/crypto/openpgp"
"os"
)
func main() {
keyRingReader, err := os.Open("signer-pubkey.asc.txt")
View CGO.md

Problems & Solutions for Interaction Between C and Go

At Vimeo, on the transcoding team, we work a lot with Go, and a lot with C, for various tasks such as media ingest. This means we use CGO quite extensively, and consequently, have run into bits that are perhaps not very well documented, if at all. Below is my effort to document some of the problems we've run into, and how we fixed or worked around them.

Many of these are obviously wrong in retrospect, but hindsight is 20/20, and these problems do exist in many codebases currently.

Some are definitely ugly, and I much welcome better solutions! Tweet me at @daemon404 if you have any, or have your own CGO story/tips, please! I'd love to learn of them.

Table of Contents

@facelordgists
facelordgists / delete-git-recursively.sh
Created May 13, 2015
Recursively remove .git folders
View delete-git-recursively.sh
( find . -type d -name ".git" && find . -name ".gitignore" && find . -name ".gitmodules" ) | xargs rm -rf
@camoles
camoles / vhosts.go
Last active Sep 23, 2017 — forked from JalfResi/revprox.go
Virtual Hosts in Go
View vhosts.go
package main
import(
"net/url"
"net/http"
"net/http/httputil"
)
func main() {
vhost1, err := url.Parse("http://127.0.0.1:1980")
@reterVision
reterVision / udp_client.go
Created Jul 12, 2014
A dummy UDP hole punching sample in Go
View udp_client.go
package main
import (
"encoding/json"
"fmt"
"log"
"net"
"os"
"time"
)
@mikemaccana
mikemaccana / gist:10847077
Created Apr 16, 2014
Tptacek's Review of "Practical Cryptography With Go"
View gist:10847077

Wow. I've now read the whole book and much of the supporting code. I'm not a fan, and recommend against relying on it. Here's a laundry list of concerns:

  • The teaching method the book uses is badly flawed. The book's strategy is to start simple and build to complexity, which makes sense if you're teaching algebra but not if you're teaching heart surgery. The result is that each chapter culminates with the implementation of a system that is grievously insecure. Little warning is given of this, apart from allusions to future chapters improving the system. For instance, Chapter 2 closes with a chat system that uses AES-CBC without an authenticator.

  • The book is full of idiosyncratic recommendations. For instance, AES-CBC requires a padding scheme. There is a standard padding scheme. The book purports to present it, but instead of PKCS7, it presents 80h+00h..00h.

  • At one point about 1/3rd of the way through the book, it suggests using a SHA256 hash of the plaintext as an authenticator for a message. Thi

You can’t perform that action at this time.