dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress oflag=sync
loadkeys <your-keymap>
(define (cc k) (call-with-current-continuation k)) | |
(display (format ">>> ~s\n" (- 10 (cc (lambda (k) (+ 1 (+ 2 (k 10)))))))) | |
(let ((k (cc (lambda (bind) (lambda (x) (+ 1 (cc (lambda (k) (bind k))))))))) (k 10)) | |
(let ((k (cc (lambda (bind) | |
(lambda (x) | |
(+ 1 (cc (lambda (k) | |
(bind k))))))))) | |
(k 10)) |
#lang racket | |
;; A solver for the following puzzle: | |
;; Given 5 integers a, b, c, d, and e, | |
;; find an expression that combines a, b, c, and d with arithmetic operations (+, -, *, and /) to get e. | |
(require srfi/1) | |
(define ops '(+ - * /)) |
(defun remote-shell-fav-hosts-get () | |
"My hook to the remote-shell processes in order to connect to | |
my OpenStack controller, and create a hashtable of host names as | |
the keys, and IP addresses as the values." | |
(interactive) | |
;; Run nova list command remotely on this host system, and put the | |
;; results in a temp buffer: | |
(let* ((undercloud-controller "10.98.1.145") | |
(default-directory (format "/ssh:%s:" undercloud-controller)) |
/** | |
* Solves the n-Queen puzzle in O(n!) | |
* Let p[r] be the column of the queen on the rth row (must be exactly 1 queen per row) | |
* There also must be exactly 1 queen per column and hence p must be a permuation of (0 until n) | |
* There must be n distinct (col + diag) and n distinct (col - diag) for each queen (else bishop attacks) | |
* @return returns a Iterator of solutions | |
* Each solution is an array p of length n such that p[i] is the column of the queen on the ith row | |
*/ | |
def nQueens(n: Int): Iterator[Seq[Int]] = | |
(0 until n) |
# This entry boots an Antergos (Arch) Linux ISO straight from disk. | |
# LVM is not supported because the lvm module is not loaded in Antergos initrd | |
menuentry "Antergos Minimal ISO 2015-09-13" { | |
insmod part_gpt | |
insmod lvm | |
insmod loopback | |
set root=(hd0,0) | |
set isofile=/antergos.iso | |
search --no-floppy --file ${isofile} --set |
In a project I'm working on I ran into the requirement of having some sort of persistent FIFO buffer or pipe in Linux, i.e. something file-like that could accept writes from a process and persist it to disk until a second process reads (and acknowledges) it. The persistence should be both across process restarts as well as OS restarts.
AFAICT unfortunately in the Linux world such a primitive does not exist (named pipes/FIFOs do not persist
This page provides a full overview of PHP's SessionHandler
life-cycle - this was generated by a set of test-scripts, in order to provide an exact overview of when and
what you can expect will be called in your custom SessionHandler
implementation.
Each example is a separate script being run by a client with cookies enabled.
To the left, you can see the function being called in your script, and to the right, you can see the resulting calls being made to a custom session-handler registed using session_set_save_handler().
# Config for GNU GRand Unified Bootloader (GRUB) (2) | |
# /boot/grub2/grub.cfg | |
# or | |
# /boot/grub/grub.cfg | |
# Mostly only 'legacy' CSM/BIOS boot methods currently. | |
# Unable to boot loop entries with Secure Boot | |
# Notes: | |
# Description: | |
# This grub.cfg file was created by Lance http://www.pendrivelinux.com |
import numpy as np | |
# The Fibonacii matrix | |
M = np.array([[0, 1], [1, 1]], dtype=np.float32) | |
# Compute the eigendecomposition of the matrix | |
w, v = np.linalg.eig(M) | |
inv_v = np.linalg.inv(v) | |
base_case = np.array([0, 1]).T # base case as a column vector |