On March 29th, 2024, a backdoor was discovered in xz-utils, a suite of software that gives developers lossless compression. This package is commonly used for compressing release tarballs, software packages, kernel images, and initramfs images. It is very widely distributed, statistically your average Linux or macOS system will have it installed for
#!/usr/bin/env bash | |
# | |
# Author: Markus (MawKKe) [email protected] | |
# Date: 2018-03-19 | |
# | |
# | |
# What? | |
# | |
# Linux dm-crypt + dm-integrity + dm-raid (RAID1) | |
# |
The aim was to be able to:
- Run multiple Linux VMs on an Apple M1/ARM device
- Use Apple's HVF for native performance speeds
- Configure VMs to allow network access to each other
- Configure VMs to allow access to the internet
- Not rely on custom modifications of software
(placeholder to set the gist name) |
(defn- get-ip-num [^String ip] | |
(when ip | |
(when-let [groups (re-matches #"^(\d+)\.(\d+)\.(\d+)\.(\d+)$" ip)] | |
(let [[a b c d] (map #(Integer/valueOf ^String %) (next groups))] | |
(+ | |
(* 256 256 256 a) | |
(* 256 256 b) | |
(* 256 c) | |
d))))) |
# I found some good resources but they seem to do a bit too much (maybe from a time when there were more bugs). | |
# So here's a minimal Gist which worked for me as an install on a new M1 Pro. | |
# Inspired by https://github.com/malob/nixpkgs I highly recommend looking at malob's repo for a more thorough configuration | |
# | |
# Some people are coming directly to this Gist from search results and not the original post[1]. If that sounds like you, you should also know there is a video[2] that accompanies this. | |
# | |
# [1] https://discourse.nixos.org/t/simple-workable-config-for-m1-macbook-pro-monterey-12-0-1-with-nix-flakes-nix-darwin-and-home-manager/16834 | |
# [2] https://www.youtube.com/watch?v=KJgN0lnA5mk | |
# |
(import 'java.net.NetworkInterface) | |
(-> (->> (NetworkInterface/getNetworkInterfaces) | |
enumeration-seq | |
(map bean) | |
(mapcat :interfaceAddresses) | |
(map bean) | |
(filter :broadcast) | |
(filter #(= (.getClass (:address %)) java.net.Inet4Address))) | |
(nth 0) | |
(get :address) |
In Clojure, data structures are mostly built from a handful of core data structures such as lists, vectors, maps, and sets. This means that most data structures can leverage all of the generic data transformation and querying functions built for the core data structures instead of having to rebuild the same functionality for each data structure. This feature in combination with Clojure's rich standard library makes Clojure very attractive for solving data munching problems from other domains.
In this article, I'm going to demonstrate these capabilities for solving HTML transformations using Clojure. First, I'm going to describe how HTML can be represented in Clojure. With this representation in mind, I'll demonstrate how we can transform HTML documents in Clojure. Finally, I'll tie the transformations together with the HTML parsing and formatting to produce a complete solution.
These resources (articles, books, and videos) are useful when you're starting to learn the language, or when you're learning a specific part of the language. This an opinionated list, no doubt. I've compiled this list from writing and teaching Clojure over the last 10 years.
- 🔴 Mandatory (for both beginners and intermediates)
- 🟩 For beginners
- 🟨 For intermediates