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 | |
# From https://unix.stackexchange.com/questions/24198/how-to-get-netmask-from-bash | |
default_if=$(ip route list | awk '/^default/ {print $5}') | |
local_netmask=$(ip -o -f inet addr show $default_if | awk '{print $4}') | |
# From https://serverfault.com/questions/518802/two-factor-ssh-authentication-on-external-address-only | |
printf "# only allow from local IP range\n+ : ALL : ${local_netmask}\n+ : ALL : LOCAL\n- : ALL : ALL\n" > /etc/security/access-local.conf | |
apt-get install libpam-google-authenticator |
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
# This could use some cleanup and robustness changes, but it works for me. Modifications are welcome! | |
# How to setup a Ubiquiti EdgeRouter POE for FreeRADIUS | |
# Based on | |
# https://community.ui.com/questions/FreeRADIUS-on-Edgerouter-2-x/6869cef3-aeca-42c3-9081-e69daa44f397 | |
# https://networkjutsu.com/freeradius-with-two-factor-authentication/ | |
# https://wiki.freeradius.org/guide/Getting-Started | |
# SSH into your router |
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
# Load all required libraries | |
library(tidyverse) | |
# Functions #### | |
#' Load the possible word lists from the Wordle source | |
#' | |
#' @param url The javascript source for finding the word lists | |
#' @param match_possible_words A word that is within the word list for the | |
#' possible words (mainly, words that people are likely to know, the Wordle |
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 (!requireNamespace("rudolph")) { | |
devtools::install_github("billdenney/rudolph/r/rudolph") | |
} | |
library(rudolph) | |
nmtrancpp_dir <- "c:/git/Not_my_repositories/nmtranprocessorcpp" | |
grammar_path <- file.path(nmtrancpp_dir, "grammar/") | |
compiled_path <- file.path(grammar_path, "rudolph/") | |
if (!dir.exists(nmtrancpp_dir)) { | |
dir.create(nmtrancpp_dir, showWarnings=FALSE, recursive=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
#' Convert a nested list structure into a knitr-usable output as html, | |
#' LaTeX, or markdown (txt). | |
#' | |
#' @param x The (nested) list to convert into an output-ready format | |
#' @param listtype The type of list to generate (may be abbreviated) | |
#' @param use.names Should the list names be displayed in the output? | |
#' @param format What output format should be used? The format is | |
#' auto-detected in knitr output and defaults to "txt" which is | |
#' markdown text format. | |
#' @param ... Arguments passed to other methods. |
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
;; Use spaces instead of tabs for indentation | |
(setq ess-indent-level 2) | |
(setq-default indent-tabs-mode nil) | |
(setq ess-default-style 'DEFAULT) | |
(setq inferior-R-args "--ess --no-save --no-restore-data --arch x64" | |
ess-indent-level 2 | |
ess-continued-statement-offset 0 | |
ess-eval-visibly nil) | |
(require 'ess-site) |