Hardware:
- Raspberry Pi 4 (4GB RAM)
- Micro SD card 32GB
- 2x Integral USB 3.1 flash drives 128GB
OS:
- Raspbian Buster
| package com.github.nikolayill; | |
| import java.io.IOException; | |
| import java.nio.file.*; | |
| import java.util.*; | |
| import java.util.regex.Matcher; | |
| import java.util.regex.Pattern; | |
| import java.util.stream.Collectors; | |
| import java.util.stream.IntStream; | |
| import java.util.stream.Stream; |
| import org.junit.jupiter.api.Assertions | |
| import org.junit.jupiter.api.Test | |
| /** | |
| * https://kotlinlang.org/docs/delegated-properties.html | |
| * https://stackoverflow.com/questions/49969998/kotlin-delegated-property-by-map-throwing-nosuchelementexception-if-not-present | |
| * | |
| */ | |
| class MappingTest { |
| import java.awt.datatransfer.*; | |
| import java.awt.*; | |
| import java.io.BufferedWriter; | |
| import java.io.FileOutputStream; | |
| import java.io.OutputStreamWriter; | |
| import java.nio.charset.StandardCharsets; | |
| /** | |
| * Java "script" that save a clipboard text content to file, or print it to console (cmd have some UTF8 issues by default) | |
| * Usage java getclip.java <FILE_NAME> |
| @Service | |
| @Primary | |
| @RefreshScope | |
| public class SwitchingServiceSwitchImpl implements SwitchingService { | |
| private final SwitchingService serviceV1; | |
| private final SwitchingService serviceV2; | |
| private volatile SwitchingService active; | |
| public SwitchingServiceSwitchImpl(SwitchingServiceImpl serviceV1, SwitchingServiceImplV2 serviceV2) { | |
| this.serviceV1 = serviceV1; |
| fun <A, T, R> getStatefulMapperEx(acc: () -> A, map: (A,T) -> Pair<A,R>): (T) -> R { | |
| var state = acc() | |
| return { v:T -> | |
| val (newState, result) = map(state, v) | |
| state = newState | |
| result | |
| } | |
| } |
| //Modified takeWhile to include a last value (that gives a false predicate result) | |
| public fun <T> Sequence<T>.takeWhileInclusive(predicate: (T) -> Boolean): Sequence<T> { | |
| return TakeWhileInclusiveSequence(this, predicate) | |
| } | |
| class TakeWhileInclusiveSequence<T> | |
| constructor( | |
| private val sequence: Sequence<T>, | |
| private val predicate: (T) -> Boolean |
| /* | |
| <https://stackoverflow.com/questions/40296831/is-it-possible-to-force-a-copy-of-a-protected-google-doc> | |
| NOTE - 2021-05-24 | |
| ----------------- | |
| The script below isn't the fastest way to copy-and-paste from a protected | |
| Google Doc. Before trying it, I'd suggest following MikoFrosty's advice from | |
| the comments: |
| 0.0.0.0 002sen.cn | |
| 0.0.0.0 003bty.cyou | |
| 0.0.0.0 005nj7z.cn | |
| 0.0.0.0 006ks4g.cn | |
| 0.0.0.0 0072875.xyz | |
| 0.0.0.0 0099q7e.cn | |
| 0.0.0.0 009gfy.cyou | |
| 0.0.0.0 00ckpr.cn | |
| 0.0.0.0 00cojpj.cn | |
| 0.0.0.0 00cvl.cn |
.img or .zip to an SD card using balenaEtchersudo raspi-config
1 Change User Password and create a unique password2 Network Options > N1 Hostname