Skip to content

Instantly share code, notes, and snippets.

View MilosSimic's full-sized avatar

Milos MilosSimic

  • Faculty of technical sciences Novi Sad
  • Novi Sad
View GitHub Profile
@lalyos
lalyos / build-rpi-alpine.md
Last active July 12, 2017 08:22
Build alpine docker image for raspberry pi

There is no official alpine Docker image for the arm platform. The onec i found are not taking advantage of the much quicker Fastly CDN basedpackage mirror option

build

Here are steps to rebuild the images on a rpi:

git clone https://github.com/gliderlabs/docker-alpine.git docker-alpine-gliderlabs
cd docker-alpine-gliderlabs/
@MilosSimic
MilosSimic / parse_json_post.go
Created January 21, 2018 12:38 — forked from andreagrandi/parse_json_post.go
Parse a JSON http POST in GoLang
package main
import (
"encoding/json"
"fmt"
"net/http"
)
type test_struct struct {
Test string
@DieterReuter
DieterReuter / gist:15b00a4293e829644c52c86b2b5bcd06
Created October 7, 2017 19:58
LinuxKit, first boot ever on a Raspberry Pi 3 (on SD image from HypriotOS/arm64)
[ 0.000000] Booting Linux on physical CPU 0x0
[ 0.000000] Linux version 4.9.13-bee42-v8 (root@b90b7cd7fee9) (gcc version 6.2.1 20161016 (Linaro GCC 6.2-2016.11) ) #1 SMP PREEMPT Fri Mar 3 16:42:37 UTC 2017
[ 0.000000] Boot CPU: AArch64 Processor [410fd034]
[ 0.000000] efi: Getting EFI parameters from FDT:
[ 0.000000] efi: UEFI not found.
[ 0.000000] cma: Reserved 8 MiB at 0x000000003dc00000
[ 0.000000] percpu: Embedded 22 pages/cpu @ffffffdafe583000 s52632 r8192 d29288 u90112
[ 0.000000] Detected VIPT I-cache on CPU0
[ 0.000000] CPU features: enabling workaround for ARM erratum 845719
[ 0.000000] Built 1 zonelists in Zone order, mobility grouping on. Total pages: 251496
@annacruz
annacruz / settings.py
Last active November 6, 2018 09:59
Default configuration to use ELK stack with django project
LOGGING = {
'handlers': {
'logstash': {
'level': 'DEBUG',
'class': 'logstash.LogstashHandler',
'host': 'localhost',
'port': 5000, # Default port of logstash
'version': 1, # Version of logstash event schema. Default value: 0 (for backward compatibility of the library)
'message_type': 'logstash', # 'type' field in logstash message. Default value: 'logstash'.
'fqdn': False, # Fully qualified domain name. Default value: false.
@ryochack
ryochack / open_mmap_adv.go
Created July 17, 2013 14:29
open/read vs open/mmap vs open/bufio.read on golang. syscall.Madvise() is unsupported darwin.
package main
import (
"fmt"
"log"
"os"
"syscall"
)
func main() {
@adewale
adewale / assetlinks.json
Created September 29, 2015 18:23
Example assetlinks.json
@jmervine
jmervine / 1_http_hello.go
Last active November 22, 2019 13:16
Golang - Hello PATH HTTP Server Example
package main
import (
"fmt"
"log"
"net/http"
)
func Log(handler http.Handler) http.Handler {
return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
@opnchaudhary
opnchaudhary / ftp_uploader.py
Created March 15, 2014 03:11
A sample example for uploading files using ftp in python
#!/usr/bin/python
import ftplib
session = ftplib.FTP('example.com','username','password')
file = open('cup.mp4','rb') # file to send
session.storbinary('STOR '+'cup.mp4', file) # send the file
file.close() # close file and FTP
session.quit()
@ceteri
ceteri / clk.tsv
Last active May 14, 2020 13:13
Intro to Apache Spark: code example for (K,V), join, operator graph
2014-03-04 15dfb8e6cc4111e3a5bb600308919594 11
2014-03-06 81da510acc4111e387f3600308919594 61
@wiredprairie
wiredprairie / golang_contextWithTimeout.go
Last active September 29, 2020 13:26
Golang context.WithTimeout Demo
package main
import (
"context"
"fmt"
"time"
)
func main() {
wait := make(chan bool)