local function lazy_load() {
local -xr thunk="$(cat)"
# (u) removes duplicates
local -xr triggers=(${(u)@})
# Only if length of triggers is greater than zero
# otherwise the function will immediately execute.
To create the timer described here
systemd-run --on-calendar='*-*-01 12:00:00' --unit='unbound-root-hints' \
--remain-after-exit --description='Update root hints for unbound' --property='Type=exec' \
--property='After=network.target' --timer-property='Persistent=true' \
--timer-property='RandomizedDelaySec=2s' --timer-property='AccuracySec=1us' \
/usr/bin/curl -o /etc/unbound/root.hints https://www.internic.net/domain/named.cache
Being a Linux desktop user is not easy, but it doesn't have to be difficult.
This is especially useful for collecting logs of system issues.
- Edit
/etc/systemd/journald.conf
and setStorage=persistent
- See https://wiki.archlinux.org/index.php/Systemd/Journal
- Useful command for viewing logs from the previous boot:
Since the server will likely not have a UI, so the download must be done with a command
The command to download teamspeak (Find the most recent version and download instead):
wget -O teamspeak-server.tar.bz2 http://dl.4players.de/ts/releases/3.0.13.8/teamspeak3-server_linux_amd64-3.0.13.8.tar.bz2
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
import java.util.List; | |
import java.util.stream.IntStream; | |
import java.util.stream.Stream; | |
public class Main { | |
public static void main(String args[]) { | |
Stream<List<Integer>> stream = SlidingWindow.pagedStream(StreamableSupplier.fromStream(IntStream.range(1, 10000).boxed()), 5) | |
.apply(i -> i <= 100); | |
stream.forEach(System.out::println); |
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
import com.google.common.io.Resources; | |
import com.google.gson.GsonBuilder; | |
import com.google.gson.JsonDeserializer; | |
import com.google.gson.JsonObject; | |
import java.io.IOException; | |
import java.net.URL; | |
import java.util.logging.Level; | |
import java.util.logging.Logger; | |
import java.util.stream.Stream; |
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
def _gen_private_pem_key(): | |
from cryptography.hazmat.backends import default_backend as crypto_default_backend | |
from cryptography.hazmat.primitives.asymmetric import rsa | |
key = rsa.generate_private_key( | |
backend=crypto_default_backend(), | |
public_exponent=65537, | |
key_size=2048 | |
) | |
return key |