Skip to content

Instantly share code, notes, and snippets.

View fsamin's full-sized avatar
🐍
¯\_(ツ)_/¯

François Samin fsamin

🐍
¯\_(ツ)_/¯
  • Rennes, France
View GitHub Profile
@melix
melix / convert.groovy
Created July 17, 2013 12:57
Convert Confluence HTML export into asciidoc
@Grab('net.sourceforge.htmlcleaner:htmlcleaner:2.4')
import org.htmlcleaner.*
def src = new File('html').toPath()
def dst = new File('asciidoc').toPath()
def cleaner = new HtmlCleaner()
def props = cleaner.properties
props.translateSpecialEntities = false
def serializer = new SimpleHtmlSerializer(props)
@artyom
artyom / rpc-tls-client.go
Last active October 9, 2023 15:44
Go RPC over TLS.You have to create the following keys: certs/client.crt, certs/client.key, certs/server.crt, certs/server.key. client.crt and server.crt should be signed with ca.crt, which should be concatenated to both client.crt and server.crt. It's easier to do with easy-rsa: http://openvpn.net/index.php/open-source/documentation/howto.html#pki
package main
import (
"crypto/tls"
"crypto/x509"
"log"
"net/rpc"
)
func main() {
@lsowen
lsowen / main.go
Last active November 11, 2017 13:27
Example to create Rackspace Files TempURL with golang
package main
// Based on documentation found here: http://docs.rackspace.com/files/api/v1/cf-devguide/content/Create_TempURL-d1a444.html
import (
"crypto/hmac"
"crypto/sha1"
"encoding/hex"
"fmt"
"github.com/ncw/swift"
@dnozay
dnozay / _Jenkins+Script+Console.md
Last active June 5, 2024 17:43
jenkins groovy scripts collection.
@posener
posener / go-shebang-story.md
Last active October 18, 2024 01:42
Story: Writing Scripts with Go

Story: Writing Scripts with Go

This is a story about how I tried to use Go for scripting. In this story, I’ll discuss the need for a Go script, how we would expect it to behave and the possible implementations; During the discussion I’ll deep dive to scripts, shells, and shebangs. Finally, we’ll discuss solutions that will make Go scripts work.

Why Go is good for scripting?

While python and bash are popular scripting languages, C, C++ and Java are not used for scripts at all, and some languages are somewhere in between.