Skip to content

Instantly share code, notes, and snippets.

View nerdalertdk's full-sized avatar

nerdalertdk nerdalertdk

View GitHub Profile
@jamesandersen
jamesandersen / cgo_memory_alloc.go
Created June 30, 2017 23:05
Allocating C memory when invoking C code via CGO
// allocate 81 char string in C memory
parsed := C.CString(strings.Repeat("0", 81))
defer C.free(unsafe.Pointer(parsed)) // free it when we're done here
// allocate byte array for our image data in C memory
p := C.CBytes(data)
defer C.free(unsafe.Pointer(p)) // free it when we're done
// float32 is standardized type compatible with C
gridCoords := []float32{-1, -1, -1, -1, -1, -1, -1, -1}
<?php
use Illuminate\Contracts\Validation\Rule;
class ValidPaymentToken implements Rule;
{
private $gateway;
private $param1;
private $param2;
@jonathanelbailey
jonathanelbailey / nas_nfs_server_bootstrap
Last active October 28, 2019 09:43
a bootstrap script that configures the NFS server for storage domain management with Ovirt.
#! /bin/bash
set -e
# to run this script:
# curl -s https://gist.githubusercontent.com/jonathanelbailey/1274ad29a8cdcc9a74d9a994571afdf0/raw/ \
# | sudo bash /dev/stdin
# comment out previous rpcmountdopts key.
sed -i '/RPCMOUNTDOPTS=--manage-gids --no-nfs-version 4/a # RPCMOUNTDOPTS=--manage-gids --no-nfs-version 4' \
/etc/default/nfs-kernel-server
# append new key with manage-gids option removed.
@nasrulhazim
nasrulhazim / readme.md
Last active September 3, 2018 04:45
Using Middleware to Check Account Activation and Resend Activation E-mail
@nasrulhazim
nasrulhazim / readme.md
Last active September 3, 2018 04:54
Enable Account Activation in Order to Login to the System.
@nasrulhazim
nasrulhazim / readme.md
Last active June 2, 2021 19:42
Send Welcome Email Notification with Event and Listener

Send Welcome Email Notification with Event and Listener

Step 1

Create SendWelcomeEmailNotification notification

php artisan make:notification SendWelcomeEmailNotification
@mpneuried
mpneuried / Makefile
Last active April 12, 2025 09:08
Simple Makefile to build, run, tag and publish a docker containier to AWS-ECR
# import config.
# You can change the default config with `make cnf="config_special.env" build`
cnf ?= config.env
include $(cnf)
export $(shell sed 's/=.*//' $(cnf))
# import deploy config
# You can change the default deploy config with `make cnf="deploy_special.env" release`
dpl ?= deploy.env
include $(dpl)
@cecilemuller
cecilemuller / letsencrypt_2020.md
Last active January 9, 2025 12:22
How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SSL rating)

How to setup Let's Encrypt for Nginx on Ubuntu 18.04 (including IPv6, HTTP/2 and A+ SLL rating)


Virtual hosts

Let's say you want to host domains first.com and second.com.

Create folders for their files:

Docker Macvlan and Ipvlan Experimental Driver Examples

  • The build will be vendored into github.com/docker/docker in the next few days. In the meantime here is the binary that will be getting vendored. docker-1.11.0-dev.zip
  • Ipvlan L2 mode network with multiple subnets without a parent specified
  • For a long test that will create 54 networks and 120+ containers, then delete them all and recreate them again try ipvlan-macvlan-it.sh Instructions here Docker Macvlan and Ipvlan Manual IT Test
  • FYI Note: When the parent is empty or the --internal flag is used, a linux type dummy interface is dynamically created by Libnetwork to act as the parent. This network is completely isolated and is the equivalent to a --internal flag. This is a good mode for demoing.
  • The first test requires an interface