This file contains hidden or 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
| #include <stdio.h> | |
| struct foo_args { int bar; char *baz; }; | |
| void real_foo(struct foo_args args) { | |
| (void) printf("bar=%d, baz=%s\n", args.bar, args.baz); | |
| } | |
| #define foo(args...) real_foo((struct foo_args) { args }) |
This file contains hidden or 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
| # mongodump --port 27117 --db ace --out "/srv/mongodb-backup-$(date +%Y%m%d)" | |
| # mongo --port 27117 | |
| use ace | |
| # Find network by name | |
| db.networkconf.find({name: "Default"}) | |
| # Some of these settings can't be set in the UI without a UniFi gateway, | |
| # but manually setting the `"purpose": "corporate"` makes the subnet | |
| # visible (for reference). |
This file contains hidden or 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
| # Makefile to add the Intel ice driver (E810) as a DKMS module to Debian | |
| # | |
| # Check out the repository https://github.com/intel/ethernet-linux-ice | |
| # into a directory. Put this Makefile into the root of that directory. | |
| # Run `make` as root, which should add the module to DKMS and build it. | |
| # Use `make install` to install, or just `dkms install ice/2.4.5` directly. | |
| # `make clean` to restore the initial state. | |
| # | |
| # When the driver is updated, `git pull` and then just `make` again. It | |
| # should automatically update the version number, as long as the format |
This file contains hidden or 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
| # Makefile for Advent of Code (or similar daily programming puzzles). | |
| # Kimmo Kulovesi, https://github.com/arkku | |
| # | |
| # This allows you to type `make 3` to compile and run all of your | |
| # solutions for the puzzles of day 3 against both the simple test | |
| # case and the real input. It will time each run, and it will show | |
| # the correct answer under each run (from the file `answers.txt`, | |
| # which you must fill in). | |
| # | |
| # NOTE: This does _not_ fetch anything from the Advent of Code servers |
This file contains hidden or 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
| diff --git a/builddefs/common_features.mk b/builddefs/common_features.mk | |
| index c976b8296d..335b432e78 100644 | |
| --- a/builddefs/common_features.mk | |
| +++ b/builddefs/common_features.mk | |
| @@ -108,6 +108,12 @@ ifeq ($(strip $(MOUSEKEY_ENABLE)), yes) | |
| SRC += $(QUANTUM_DIR)/mousekey.c | |
| endif | |
| +ifeq ($(strip $(APPLE_FN_ENABLE)), yes) | |
| + OPT_DEFS += -DAPPLE_FN_ENABLE -DENABLE_APPLE_FN_KEY=1 |
This file contains hidden or 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
| #!/usr/bin/env ruby | |
| puts "🕳" | |
| bunny = [ '(\_/)', '( •_•)', '/ >' ] | |
| count = (ARGV[0] || 17).to_i | |
| 0.upto(count - 1) do |i| | |
| space='' | |
| 1.upto(i * bunny.last.length) { |j| space="#{space}#{j.odd? ? '.' : ' '}" } | |
| print bunny.join("\n#{space}") | |
| end | |
| puts "🕳" |
This file contains hidden or 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/sh | |
| host="$1" | |
| [ -z "$host" ] && host=homeshell | |
| port="$2" | |
| [ -z "$port" ] && port=60001 | |
| slave="$3" | |
| [ -z "$slave" ] && slave=`hostname -s` # use a fixed string if needed | |
| main=$4 | |
| [ -z "$main" ] && main=0 |
This file contains hidden or 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 | |
| # This script will disable the root account on macOS. | |
| # At the time of writing there is a severe security flaw in macOS High Sierra, | |
| # which allows the root account to be used without any password to gain admin | |
| # access from any of the GUI password dialogs (it will fail once the first time, | |
| # but on subsequent attempts it will accept the empty password). | |
| # | |
| # The commonly circulated workaround is to set a password for the root account, |
This file contains hidden or 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/sh | |
| # A wrapper for running tmux. Takes on (optional) main session name as | |
| # argument, creates it if it doesn't exist. Then (in either case), | |
| # a new slave session is created and attached to the main session. | |
| # The slave session is configured to be destroyed automatically when | |
| # detached, but the main session stays alive. This arrangement allows | |
| # each slave session to have independent control over active windows/panes. | |
| # | |
| # (Make sure ~/.tmux.conf does not interfere by having something like | |
| # `new-session` or `attach-session` in it.) |
This file contains hidden or 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
| config.system_cfg.1=sshd.auth.key.1.status=enabled | |
| config.system_cfg.2=sshd.auth.key.1.value=AAAA…Z | |
| config.system_cfg.3=sshd.auth.key.1.type=ssh-rsa | |
| config.system_cfg.4=users.1.password=x |
NewerOlder