Skip to content

Instantly share code, notes, and snippets.

View Kyslik's full-sized avatar

Martin Kiesel Kyslik

View GitHub Profile
Broadcast Time Zone
# First container
cat <<EOF > Dockerfile.1
FROM busybox
ADD rootfs /
EOF
mkdir rootfs
ln -s evil/level1/level2 rootfs/proc
@dcormier
dcormier / deepequal.go
Last active February 2, 2020 18:29
Golang reflect.DeepEqual() example; does it do what you mean?
// Runable: https://play.golang.org/p/-bkg2k6ymCR
//
package main
import (
"fmt"
"reflect"
"time"
)
package reflectimport ( "runtime"
"sync"
"unsafe"
)
type Caller struct {
v Value
//readonly cache
numIn int
@rivo
rivo / serve.go
Created November 26, 2017 12:28
Graceful stop and restart for HTTP servers in Go
package main
import (
"context"
"fmt"
"net"
"net/http"
"os"
"os/exec"
"os/signal"
@matejb
matejb / sigterm_context.go
Created May 20, 2017 12:21
Golang context with cancellation on signal receive
func contextWithSigterm(ctx context.Context) context.Context {
ctxWithCancel, cancel := context.WithCancel(ctx)
go func() {
defer cancel()
signalCh := make(chan os.Signal, 1)
signal.Notify(signalCh, os.Interrupt, syscall.SIGTERM)
select {
case <-signalCh:
@tompec
tompec / bulma.blade.php
Last active September 10, 2020 20:33
Bulma blade template for Laravel 5.4 pagination
@if ($paginator->hasPages())
<nav class="pagination is-centered">
@if ($paginator->onFirstPage())
<a class="pagination-previous" disabled>Previous</a>
@else
<a href="{{ $paginator->previousPageUrl() }}" rel="prev" class="pagination-previous">Previous</a>
@endif
@if ($paginator->hasMorePages())
<a class="pagination-next" href="{{ $paginator->nextPageUrl() }}" rel="next">Next</a>
<?xml version="1.0" encoding="UTF-8"?>
<opml version="1.0">
<head>
<title>Subscriptions - freek@spatie.be</title>
</head>
<body>
<outline text="PHP" title="PHP">
<outline htmlUrl="http://frederickvanbrabant.com" title="frederickvanbrabant.com" xmlUrl="http://frederickvanbrabant.com/feed.xml" type="rss" text="frederickvanbrabant.com"/>
<outline htmlUrl="http://mattallan.org" title="mattallan.org" xmlUrl="http://mattallan.org/feed.xml" type="rss" text="mattallan.org"/>
<outline title="asked.io" xmlUrl="https://asked.io/rss" type="rss" text="asked.io"/>
@montanaflynn
montanaflynn / pget.go
Last active October 21, 2023 06:12
Bounded Parallel Get Requests in Golang
package main
import (
"fmt"
"net/http"
"sort"
"time"
)
// a struct to hold the result from each request including an index
@santoshachari
santoshachari / Laravel PHP7 LEMP AWS.md
Last active February 20, 2024 10:00
Laravel 5.x on Ubuntu 16.x, PHP 7.x, Nginx 1.9.x

#Steps to install latest Laravel, LEMP on AWS Ubuntu 16.4 version. This tutorial is the improvised verision of this tutorial on Digitalocean based on my experience.

Install PHP 7 on Ubuntu

Run the following commands in sequence.

sudo apt-get install -y language-pack-en-base
sudo LC_ALL=en_US.UTF-8 add-apt-repository ppa:ondrej/php
sudo apt-get update
sudo apt-get install zip unzip