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
let | |
overlay = self: super: rec { | |
my-hello = super.callPackage ./pkgs/hello/default.nix {}; | |
hello = if super.hello.version > my-hello.version then super.hello else my-hello; | |
}; | |
unstable = import <nixos-unstable> { | |
overlays = [ overlay ]; | |
config = { }; | |
}; | |
in |
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
ffi = require "ffi" | |
null = ffi.new("void*", nil) | |
print("not null: ", not null) | |
print("null == nil: ", null == nil) | |
--- Prints: | |
-- | |
-- not null: false | |
-- null == nil: true |
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
$ pwd | |
/lib | |
$ ls -alh os-release | |
lrwxrwxrwx. 1 root root 37 Nov 29 13:34 os-release -> ./os.release.d/os-release-workstation | |
$ x=os-release | |
$ echo "${x:A}" | |
/usr/lib/os.release.d/os-release-workstation | |
$ echo "${x:a}" | |
/usr/lib/os-release |
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
//! If you're on a Unix system, try something like: | |
//! | |
//! `yes | cargo run --example count_keys` | |
//! | |
//! (Originally from | |
//! https://github.com/paulkernfeld/tokio-stdin/blob/master/examples/count_keys.rs) | |
extern crate futures; | |
extern crate tokio_stdin; | |
extern crate tokio_timer; |
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 | |
[ $UID == 0 ] || (echo "Must be root" && exit 1) | |
# c1 and c2 represent two different docker containers starting at once | |
c1=1 | |
c2=2 | |
function ovlOpts() { | |
echo -n "lowerdir=$tmpdir/lower,upperdir=$tmpdir/$1/diff,workdir=$tmpdir/$1/work" |
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 | |
set -e | |
tag=${1:?arg should be a docker-ce tag, such as 'v17.07.0-ce'} | |
tmp=$(mktemp -d) | |
cd $tmp | |
wget https://raw.githubusercontent.com/shykes/moby-extras/master/cmd/moby-components |
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 | |
set -euo pipefail | |
for i in $(seq 1 20); do | |
mkdir "fetch-$i" | |
pushd "fetch-$i" | |
../bin/docker2aci docker://euank/manylabels:busybox | |
sudo rkt fetch --insecure-options=image *.aci > sha | |
sudo rkt image cat-manifest $(cat sha) > rktmanifest | |
cat *.aci | gunzip | tar x |
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
#cloud-config | |
users: | |
- name: "core" | |
- passwd: "***" | |
# The formatting of the following section is important. Don't change it! | |
# sytemd-networkd and dhcpcd are both packaged in Container Linux. We'll use systemd | |
# because that's what's used in the most minimal, out-of-the-box config at this time, | |
# and dhcpcd is disabled. We're giving systemd a dhcp config file so we can tell it | |
# to not use IPv6 privacy extensions. We also need DHCP=ipv4 b/c DHCP=all causes |
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
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/bin/git | |
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/bin/git-receive-pack | |
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/bin/git-upload-archive | |
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git | |
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-add | |
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-am | |
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-annotate | |
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-apply | |
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-archive | |
-rwxr-xr-x 117 root root 2.0M Apr 26 14:06 /usr/libexec/git-core/git-bisect--helper |
NewerOlder