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
[Unit] | |
Description=Weston launcher | |
RequiresMountsFor=/run | |
After=getty@tty1.service | |
[Service] | |
Restart=alway | |
RestartSec=10 | |
User=root | |
EnvironmentFile=-/etc/default/weston |
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
; CargoAttributes.nsi | |
; | |
; * Copyright © 2020 Stefan Müller <co@zzeroo.com> | |
; * | |
; * SPDX-License-Identifier: GPL-2.0-or-later | |
; | |
; Helper .nsi script to extract information from Rust's Cargo.toml. | |
; | |
; # Usage | |
; |
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
/// Prints and spins "-=..zZ[ER]Oo..=-" | |
/// | |
use std::{thread, time::Duration}; | |
const STRING: &'static str = "..zzeroo.."; | |
fn main() { | |
let mut text: Vec<_> = STRING.split_terminator("").skip(1).collect(); | |
let text_len = text.len(); | |
let mut i = text_len; |
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
# Docker total optional :) | |
# pacman -S docker | |
yay -S docker | |
# Wenn docker installiert ist kannst du so magic | |
# Sachen machen wie diese: | |
docker run -it -v $(pwd):/src debian:latest | |
# ---- hier gehts los --- |
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 std::thread; | |
use tokio::runtime::Runtime; | |
use tokio_modbus::prelude::*; | |
use tokio_serial::Serial; | |
fn main() { | |
thread::spawn(|| { | |
let mut rt = Runtime::new().expect("Couldn't create Runtime"); | |
rt.block_on(async { | |
let port = Serial::from_path("/dev/ttyUSB0", &Default::default()).unwrap(); |
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 std::thread; | |
use tokio::runtime::Runtime; | |
use tokio_modbus::prelude::*; | |
use tokio_serial::Serial; | |
fn main() { | |
thread::spawn(|| { | |
let mut rt = Runtime::new().expect("Couldn't create Runtime"); | |
rt.block_on(async { | |
let port = Serial::from_path("/dev/ttyUSB0", &Default::default()).unwrap(); |
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
--> src/main.rs:60:41 | |
| | |
29 | ui_event_sender: Sender<UiEvent>, | |
| --------------- move occurs because `ui_event_sender` has type `futures_channel::mpsc::Sender<UiEvent>`, which does not implement the `Copy` trait | |
... | |
49 | refresh_button.connect_clicked(move |_| { | |
| -------- value moved into closure here | |
50 | ui_event_sender | |
| --------------- variable moved due to use in closure | |
... |
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
# Backup virtual maschines | |
# TODO: debug notes `echo 'backup vm $i'` | |
# fish | |
for i in (virsh --connect=qemu:///system list --all --name); [ ! -z $i ] && virsh --connect=qemu:///system dumpxml $i | sudo tee /var/lib/libvirt/images/$i.xml >/dev/null ; end | |
# bash | |
#for i in $(virsh --connect=qemu:///system list --all --name); do [ ! -z $i ] && virsh --connect=qemu:///system dumpxml $i | sudo tee /var/lib/libvirt/images/$i.xml >/dev/null ; done | |
# Create btrfs Snapshot | |
sudo btrfs subvol snap -r /mnt/btrfs_storage2900G/@var-lib-libvirt-images /mnt/btrfs_storage2900G/@snapshots/@var-lib-libvirt-images-ro |
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 std::collections::HashMap; | |
fn nucleotide_counts(nucleotides: &str) -> HashMap<char, usize> { | |
let mut nucleotide = HashMap::new(); | |
for n in nucleotides.chars() { | |
let counter = nucleotide.entry(n) // gets the given key's corrosponding entry in the map for in-place manipulation | |
.or_insert(0); // ..or insert 0 if its not present already | |
*counter += 1; // Now increment the entry, so it's 1 for all new keys or plus one for all other. | |
} | |
nucleotide |
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 std::collections::HashMap; | |
fn create_hashmap(strand_a: &str, strand_b: &str) -> HashMap<char, char> { | |
let strand_a: Vec<_> = strand_a.chars().collect(); | |
let strand_b: Vec<_> = strand_b.chars().collect(); | |
strand_a.iter().zip(strand_b.iter()).map(|(&a, &b)| (a, b)).collect() | |
} | |
fn main() { |
NewerOlder