This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/python3 | |
import argparse | |
import socket | |
import logging | |
import time | |
def parse_arguments(): | |
parser = argparse.ArgumentParser(description='DNS test') | |
parser.add_argument('-w', '--wait', default=0.5, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* gcc -D_GNU_SOURCE -o dnstest dnstest.c */ | |
#include <stdio.h> | |
#include <unistd.h> | |
#include <netdb.h> | |
#include <string.h> | |
#include <stdlib.h> | |
#include <sys/socket.h> | |
#include <netinet/in.h> | |
#include <arpa/inet.h> | |
#include <sys/time.h> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright 2016 Maciej Borzecki <maciek.borzecki@gmail.com> | |
// | |
// Licensed under the Apache License, Version 2.0 (the "License"); | |
// you may not use this file except in compliance with the License. | |
// You may obtain a copy of the License at | |
// | |
// http://www.apache.org/licenses/LICENSE-2.0 | |
// | |
// Unless required by applicable law or agreed to in writing, software | |
// distributed under the License is distributed on an "AS IS" BASIS, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
GO ?= go | |
GOFMT ?= gofmt | |
V ?= | |
LOCALPKG = $(shell go list .) | |
PKGS = $(shell go list ./... | grep -v vendor) | |
PKGFILES = $(shell find . \( -path ./vendor -o -path ./Godeps \) -prune -o -type f -name '*.go' -print) | |
PKGFILES_notest = $(shell echo $(PKGFILES) | tr ' ' '\n' | grep -v _test.go) | |
GOCYCLO ?= 15 | |
CPUS=$(shell lscpu -p | wc -l) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
;; rename to .dir-locals.el | |
((c-mode . ((c-file-style . "linux-tabs-only") | |
(indent-tabs-mode . t) | |
(show-trailing-whitespace . t) | |
(c-basic-offset . 8) | |
(tab-width . 8) | |
)) | |
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python2 | |
from __future__ import print_function | |
import subprocess | |
import os | |
import signal | |
import time | |
MENDER_QEMU_PATH = os.path.join(os.path.dirname(__file__), "mender-qemu") |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
add_changelog() { | |
tmpfile=$(mktemp /tmp/prepare-commit-msg.XXXXXXX) | |
cat "$1" | awk ' | |
function print_changelog() { | |
printf "\n" | |
printf "# changelog information, use Changelog: <None|Title|Commit>\n" | |
printf "# or provide a message\n" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"fmt" | |
) | |
func main() { | |
foo := []int{1,2,3,4} | |
fmt.Println(foo[3]) // --> 4 | |
fmt.Println(foo[4:]) // --> [] why? |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
if [ -n "$V" ]; then | |
set -x | |
fi | |
PORT_BASE=59401 | |
make_port_number() { | |
echo $((PORT_BASE + RANDOM % 100)) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package main | |
import ( | |
"errors" | |
"fmt" | |
"testing" | |
) | |
type App struct { | |
Name string |