Skip to content

Instantly share code, notes, and snippets.

View karlmutch's full-sized avatar
🇳🇿
( ಠ ͜ʖಠ)

Karl Mutch karlmutch

🇳🇿
( ಠ ͜ʖಠ)
View GitHub Profile
@karlmutch
karlmutch / README.md
Created May 7, 2023 23:40 — forked from nmarley/README.md
Go / C++ bindings example

Go / C++ bindings example

This is an example of Go code calling to a C++ library with a C wrapper.

Build

go build  # this only ensures it compiles
@karlmutch
karlmutch / golang-tls.md
Created December 1, 2022 22:24 — forked from denji/golang-tls.md
Simple Golang HTTPS/TLS Examples

Moved to git repository: https://github.com/denji/golang-tls

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)
@karlmutch
karlmutch / how-to-setup-verified-commits.md
Created December 23, 2021 02:35 — forked from Beneboe/how-to-setup-verified-commits.md
How to Setup Verified Commits on Github
@karlmutch
karlmutch / vim8.x_with_lua
Created May 1, 2020 23:47 — forked from techgaun/vim8.x_with_lua
Install vim with lua support on ubuntu 16.04
I needed to install vim with lua support because I wanted to use neocomplete in my recently installed 15.04 distro. Also, this has python3 enabled by default.
Tested on 16.04 now
Update: This has been tested and verified to work on Ubuntu 16.04 as well. Also, if you wish to use particular branch/tag, you can get the version and then checkout appropriately.
The following (based upon https://gist.github.com/jdewit/9818870) should work though I copied it from history:
sudo apt-get remove --purge vim vim-runtime vim-gnome vim-tiny vim-common vim-gui-common
sudo apt-get build-dep vim-gnome
sudo apt-get install build-essential liblua5.3-0 liblua5.3-dev python-dev ruby-dev libperl-dev libncurses5-dev libgnome2-dev libgnomeui-dev libgtk2.0-dev libatk1.0-dev libbonoboui2-dev libcairo2-dev libx11-dev libxpm-dev libxt-dev
package main
import (
"fmt"
"math"
"time"
)
// fdtime is time period for a execution time sampling
// ftime shows how fast it reacts on changes.
Results:
[/home/kmutch/project/src/github.com/leaf-ai/studio-go-runner/cmd/runner/aws.go:160] - G104 (CWE-703): Errors unhandled. (Confidence: HIGH, Severity: LOW)
> logger.Warn(fmt.Sprint(err))
[/home/kmutch/project/src/github.com/leaf-ai/studio-go-runner/cmd/runner/aws.go:165] - G104 (CWE-703): Errors unhandled. (Confidence: HIGH, Severity: LOW)
> logger.Warn(errGo.Error())
@karlmutch
karlmutch / cloud-init.yaml
Created October 21, 2019 18:00 — forked from syntaqx/cloud-init.yaml
cloud init to install docker on ubuntu
#cloud-config
package_update: true
package_upgrade: true
package_reboot_if_required: true
manage-resolv-conf: true
resolv_conf:
nameservers:
- '8.8.8.8'
@karlmutch
karlmutch / test-cloud-init-run.sh
Created October 21, 2019 17:48 — forked from maoueh/test-cloud-init-run.sh
Small script to test changes made to cloud init config without rebooting
rm -rf /var/lib/cloud/instance && rm -rf /var/lib/cloud/instances/* && rm -rf /var/lib/cloud/sem/*
cloud-init init && cloud-init modules --mode config && cloud-init modules --mode final
@karlmutch
karlmutch / test-cloud-init-run.sh
Created October 21, 2019 17:48 — forked from maoueh/test-cloud-init-run.sh
Small script to test changes made to cloud init config without rebooting
rm -rf /var/lib/cloud/instance && rm -rf /var/lib/cloud/instances/* && rm -rf /var/lib/cloud/sem/*
cloud-init init && cloud-init modules --mode config && cloud-init modules --mode final
@karlmutch
karlmutch / install-cuda-10-bionic.sh
Created July 31, 2019 19:37 — forked from bogdan-kulynych/install-cuda-10-bionic.sh
Install CUDA 10 on Ubuntu 18.04
#!/bin/bash
# Install CUDA Toolkit 10
wget https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu1804/x86_64/7fa2af80.pub && sudo apt update
sudo dpkg -i cuda-repo-ubuntu1804_10.0.130-1_amd64.deb
sudo apt update
sudo apt install -y cuda