Skip to content

Instantly share code, notes, and snippets.

Avatar

Vladimír Čunát vcunat

View GitHub Profile
@vcunat
vcunat / cloudfront.sh
Last active Jul 24, 2018 — forked from grahamc/cloudfront.sh
don't force dig to use IPv4
View cloudfront.sh
#!/usr/bin/env nix-shell
#!nix-shell -i bash -p bind.dnsutils -p traceroute -p curl
# impure: needs ping
#source: https://s3.amazonaws.com/aws-cloudfront-testing/CustomerTesting.html
function _e {
echo "> $@"
eval "$@" 2>&1 | sed -e "s/^/ /"
printf "Exit: %s\n\n\n" "$?"
}
View release.nix
{ nixpkgs ? <nixpkgs> }: {
inherit (import nixpkgs {}) hello;
}
@vcunat
vcunat / keybase.md
Last active Jan 10, 2017
For keybase.io: proving github account ownership
View keybase.md

Keybase proof

I hereby claim:

  • I am vcunat on github.
  • I am vcunat (https://keybase.io/vcunat) on keybase.
  • I have a public key whose fingerprint is B600 6460 B60A 80E7 8206 2449 E747 DF1F 9575 A3AA

To claim this, I am signing this object:

View rebuild-amount.sh
#!/usr/bin/env bash
if [ "$#" != 2 ]; then
echo "Usage: $0 commit-hash commit-hash"
echo -e "\tYou need to be in a git-controlled nixpkgs tree."
exit 1
fi
echo "Estimating rebuild amount, by packages visible to nix-env:"
echo "(If you get 0, it's an evaluation error, most likely.)"
@vcunat
vcunat / default.nix
Created Dec 4, 2016
Linux->mingw cross-compiling shim: *-native is for packages not meant to be run on windows
View default.nix
let
lib = (import <nixpkgs> {}).lib;
pkgs-cross-xx = hostArch:
lib.mapAttrs
(name_: pkg: if lib.isDerivation pkg then pkg.crossDrv else pkg)
(pkgs-cross-xx-nocross hostArch);
pkgs-cross-xx-nocross = hostArch:
(import <nixpkgs> {
crossSystem = {
config = hostArch + "-w64-mingw32";
@vcunat
vcunat / zbar.nix
Created Jul 26, 2016
Zbar: nix expression for linux->mingw cross-compilation, both 32 and 64-bit.
View zbar.nix
{stdenv, fetchurl, pkgconfig, xmlto, imagemagick, libiconv}:
stdenv.mkDerivation rec {
name = "zbar-0-10";
src = fetchurl {
url = http://downloads.sourceforge.net/project/zbar/zbar/0.10/zbar-0.10.tar.bz2;
sha256 = "1imdvf5k34g1x2zr6975basczkz3zdxg6xnci50yyp5yvcwznki3";
};
@vcunat
vcunat / R.log
Last active Jan 2, 2016
Failure while linking R, using NIX_DEBUG=1 to show linker flags
View R.log
original flags to /nix/store/vck6gcw6acfj5zbclaxq95dkx8askvc0-binutils-2.23.1-dev/bin/ld:
-plugin
/nix/store/k7vgmahnycp3x1d4i63wbj61bn67khls-gfortran-4.9.3/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/liblto_plugin.so
-plugin-opt=/nix/store/k7vgmahnycp3x1d4i63wbj61bn67khls-gfortran-4.9.3/libexec/gcc/x86_64-unknown-linux-gnu/4.9.3/lto-wrapper
-plugin-opt=-fresolution=/tmp/nix-build-R-3.2.3.drv-0/ccNJ1FPY.res
-plugin-opt=-pass-through=-lgcc
-plugin-opt=-pass-through=-lgcc_s
-plugin-opt=-pass-through=-lpthread
-plugin-opt=-pass-through=-lc
-plugin-opt=-pass-through=-lgcc
View Xorg.0.log
[ 273.050]
X.Org X Server 1.12.4
Release Date: 2012-08-27
[ 273.051] X Protocol Version 11, Revision 0
[ 273.051] Build Operating System: Linux 3.2.36 x86_64
[ 273.051] Current Operating System: Linux Tarjan.ms.mff.cuni.cz 3.4.32 #1 SMP Tue Feb 19 18:42:42 UTC 2013 x86_64
[ 273.051] Kernel command line: systemConfig=/nix/store/0z89hzfqhsnc8w0a3kpji0hcwnq5hwx2-nixos-0.2pre-9de455cM-aacca19 init=/nix/store/0z89hzfqhsnc8w0a3kpji0hcwnq5hwx2-nixos-0.2pre-9de455cM-aacca19/init
[ 273.051] Build Date: 18 February 2013 09:24:34PM
[ 273.051]
[ 273.051] Current version of pixman: 0.26.2
@vcunat
vcunat / xmonad.hs
Last active Aug 29, 2015
My XMonad config
View xmonad.hs
import Data.List
import Data.Maybe (fromMaybe)
import qualified Data.Map as M
import XMonad
import XMonad.Config.Xfce (xfceConfig)
--import XMonad.Config.Gnome
--import XMonad.Config.Kde
import XMonad.Config.Desktop (desktopLayoutModifiers)
View nvidia-HW-support.diff
--- /home/admin/nix/tmp/nvidia-long.txt
+++ /home/admin/nix/tmp/nvidia-short.txt
@@ -1,9 +1,15 @@
+GeForce 900 Series:
+
+GeForce GTX 980, GeForce GTX 970
+GeForce 900M Series (Notebooks):
+
+GeForce GTX 980M, GeForce GTX 970M
GeForce 800M Series (Notebooks):