Skip to content

Instantly share code, notes, and snippets.

#!/bin/bash
useradd -s /bin/bash -m unprivileged
cp -rf ~/.ssh ~unprivileged/
chown -R unprivileged:unprivileged ~unprivileged/.ssh/
@tiborvass
tiborvass / gist:f9303e496644c77bd11ba08ec00d9fa0
Created July 25, 2017 23:08
archive/tar changes between go1.8 and go1.9rc1
$ git log origin/release-branch.go1.8..origin/release-branch.go1.9 src/archive/tar
commit c991d2ab14496789146560608c5756d5d83b35f6
Author: Joe Tsai <[email protected]>
Date: Tue Jun 27 17:30:39 2017 -0700
archive/tar: use best effort at writing USTAR header
Prior to this change, if the Writer needed to use the PAX format, it would
output a USTAR header with an empty name. This should be okay since the PAX
specification dictates that the PAX record for "path" should override the
@tiborvass
tiborvass / main.go
Last active November 16, 2018 00:17
package main
import (
"fmt"
git "gopkg.in/src-d/go-git.v4"
"gopkg.in/src-d/go-git.v4/utils/ioutil"
)
func main() {
@tiborvass
tiborvass / Dockerfile
Last active July 7, 2017 22:22
Docker+vndr tip for Go libraries
FROM golang:1.8
RUN go get github.com/lk4d4/vndr
WORKDIR /go/src/github.com/someone/someproject
# Make sure vendor.conf only has commit hashes to always behave correctly with build caching.
COPY vendor.conf .
RUN vndr -whitelist '.*'
COPY . .
# Rationale:
# Go libraries can have 3rd-party dependencies and should have tests.
@tiborvass
tiborvass / gist:45bd25394f09b69fb682ac126877b9eb
Created August 12, 2016 22:38
selinux post script failure?
[root@fedora-2gb-nyc3-01 ~]# curl -G https://experimental.docker.com/ | sh
% Total % Received % Xferd Average Speed Time Time Time Current
Dload Upload Total Spent Left Speed
0 0 0 0 0 0 0 0 --:--:-- --:--:-- 100 14811 100 14811 0 0 84919 0 --:--:-- --:--:-- --:--:-- 85612
+ sh -c 'sleep 3; dnf -y -q install docker-engine'
warning: /var/cache/dnf/docker-experimental-repo-aab05090d83f3f86/packages/docker-engine-1.12.0-1.fc24.x86_64.rpm: Header V4 RSA/SHA512 Signature, key ID 2c52609d: NOKEY
Importing GPG key 0x2C52609D:
Userid : "Docker Release Tool (releasedocker) <[email protected]>"
Fingerprint: 5811 8E89 F3A9 1289 7C07 0ADB F762 2157 2C52 609D
From : https://yum.dockerproject.org/gpg

Cherrypicking the following:

  • #23555
  • 4104c1d Remove the node leader column, show leader as status.
  • #23505
  • 0254c12 surfacing Learn by example topics to top level of Docker Engine docs fixing links after moving surfacing tutorials
  • #23557
  • fec98ec Update experimental/README.md
  • #23301
  • 756f6ce daemon: allow tmpfs to trump over VOLUME(s)
@tiborvass
tiborvass / win32test.go
Last active January 8, 2018 13:57 — forked from dave-tucker/win32test.go
Detect on Windows if virtualization is enabled in the BIOS
package main
import (
"fmt"
"syscall"
)
func main() {
var mod = syscall.NewLazyDLL("kernel32.dll")
var proc = mod.NewProc("IsProcessorFeaturePresent")

Keybase proof

I hereby claim:

  • I am tiborvass on github.
  • I am tiborvass (https://keybase.io/tiborvass) on keybase.
  • I have a public key whose fingerprint is 61E0 BE56 8994 3F2D F37D A91D 0095 CA24 E24F D92E

To claim this, I am signing this object:

@tiborvass
tiborvass / gist:f4db9c124f0c87704748
Created October 17, 2015 20:24
Shellinabox Dockerfile
FROM ubuntu:14.04
RUN apt-get update && apt-get -y install git libssl-dev libpam0g-dev zlib1g-dev dh-autoreconf
COPY . /shellinabox
WORKDIR /shellinabox
RUN autoreconf -i
RUN ./configure && make
RUN useradd -m user
USER user
EXPOSE 4200
time="2015-06-16T21:56:27.469542473Z" level=debug msg="Calling DELETE /containers/{name:.*}"
time="2015-06-16T21:56:27.469682736Z" level=info msg="DELETE /v1.17/containers/trusting_bell/mylink?force=False&link=True&v=False"
leave
options []
opt hostname
0x8f27a0
opt resolvconf
leave
options []
time="2015-06-16T21:56:27.518977914Z" level=error msg="leaving endpoint failed: a container has already joined the endpoint"