Skip to content

Instantly share code, notes, and snippets.

View davidak's full-sized avatar
🔥
burnt-out

davidak

🔥
burnt-out
View GitHub Profile
@lrvick
lrvick / github-troll.md
Last active May 3, 2024 16:20
Trolling Github's DMCA repo with their own security flaws.

Proposed Nixpkgs Rules

  • Mission statement: to package the latest, stable version of all of the world’s open source software with a living maintainer.
  • Other software is allowed on a case by case basis. Possible exceptions include, but not limited to:
    • Popular closed-source applications without a good alternative.
    • Older software that is required as a dependency of other packages.
@waldyrious
waldyrious / distraction-free-mornings.sh
Created May 30, 2018 14:34
Script to block Internet access during the morning period
#!/bin/sh
# Script to set up rules to implement offline periods
# during which Internet connection is blocked.
# Start or extend sudo session
sudo -v
# Get the local network address subnet, which should be allowed
# https://askubuntu.com/a/872939/23900
@joyrexus
joyrexus / README.md
Last active February 24, 2024 15:16
collapsible markdown

collapsible markdown?

CLICK ME

yes, even hidden code blocks!

print("hello world!")
@itod
itod / split_keyboards.md
Last active May 23, 2024 01:51
Every "split" mechanical keyboard currently being sold that I know of
@martijnvermaat
martijnvermaat / nixos.md
Last active May 9, 2024 01:11
Installation of NixOS with encrypted root
@sigma
sigma / redis-mini.nix
Created April 17, 2016 06:30
minimal #redis #docker image with #nix
{ pkgs ? import <nixpkgs> {} }:
with pkgs;
let
su_exec = pkgs.stdenv.mkDerivation {
name = "su-exec-0.2";
src = fetchurl {
url = https://github.com/ncopa/su-exec/archive/v0.2.tar.gz;
sha256 = "09ayhm4w7ahvwk6wpjimvgv8lx89qx31znkywqmypkp6rpccnjpc";
@edolstra
edolstra / nix-ui.md
Last active February 2, 2024 23:31
Nix UI

General notes

  • nix-channel and ~/.nix-defexpr are gone. We'll use $NIX_PATH (or user environment specific overrides configured via nix set-path) to look up packages. Since $NIX_PATH supports URLs nowadays, this removes the need for channels: you can just set $NIX_PATH to e.g. https://nixos.org/channels/nixos-15.09/nixexprs.tar.xz and stay up to date automatically.

  • By default, packages are selected by attribute name, rather than the name attribute. Thus nix install hello is basically equivalent to nix-env -iA hello. The attribute name is recorded in the user environment manifest and used in upgrades. Thus (at least by default) hello won't be upgraded to helloVariant.

    @vcunat suggested making this an arbitrary Nix expression rather than an attrpath, e.g. firefox.override { enableFoo = true; }. However, such an expression would not have a key in the user environment, unlike an attrpath. Better to require an explicit flag for this.

TBD: How to deal with search path clashes.

@CrookedNumber
CrookedNumber / gist:8964442
Created February 12, 2014 21:02
git: Removing the last commit

Removing the last commit

To remove the last commit from git, you can simply run git reset --hard HEAD^ If you are removing multiple commits from the top, you can run git reset --hard HEAD~2 to remove the last two commits. You can increase the number to remove even more commits.

If you want to "uncommit" the commits, but keep the changes around for reworking, remove the "--hard": git reset HEAD^ which will evict the commits from the branch and from the index, but leave the working tree around.

If you want to save the commits on a new branch name, then run git branch newbranchname before doing the git reset.

@mobilemind
mobilemind / git-tag-delete-local-and-remote.sh
Last active May 24, 2024 01:23
how to delete a git tag locally and remote
# delete local tag '12345'
git tag -d 12345
# delete remote tag '12345' (eg, GitHub version too)
git push origin :refs/tags/12345
# alternative approach
git push --delete origin tagName
git tag -d tagName