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
use core::fmt::Write; | |
use alloc::boxed::Box; | |
use embedded_hal::serial::{Write as SerialWrite}; | |
use stm32f4xx_hal::serial; | |
use log::{Log, Level, Metadata, Record}; | |
pub struct SerialLogger<E> { |
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
#[no_mangle] | |
pub extern "C" fn _sbrk() {} | |
#[no_mangle] | |
pub extern "C" fn _write() {} | |
#[no_mangle] | |
pub extern "C" fn _close() {} |
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
[[runners]] | |
name = "tt708-windows" | |
url = "https://gitlab.com/" | |
token = "[REDACTED]" | |
executor = "shell" | |
shell = "bash" | |
builds_dir="/c/gitlab-runner/builds/" | |
cache_dir="/c/gitlab-runner/cache/" | |
[runners.cache] | |
[runners.cache.s3] |
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
// Unaligned memcopy function | |
// Source: https://gist.github.com/ryankurte/29c99ef58ae636735f38b1f95da33be9 | |
// Copyright 2020 Ryan Kurte | |
// Extremely untested, probably don't use this, or, test the h*ck out of it first. | |
// It should be _reasonably_ easy to extend this to `u32` or `u64` based methods | |
// for _significant_ performance improvements, however, this would either come with | |
// extended alignment requirements or need to switch types internally based on copy | |
// length. |
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
# Systemd environment file for backup.sh daily backup service | |
# Place in /etc/backup.env | |
# Destination for rsync file system clone | |
BACKUP_DEST=/media/large1/backups/raw | |
# Destination for restic repository | |
RESTIC_REPOSITORY=/media/large1/backups/restic | |
# Restic password file |
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
# Run on https://console.cloud.google.com/bigquery | |
# Fetch all projects on crates.io | |
SELECT | |
projects.name, projects.platform , projects.latest_release_number, projects.dependent_projects_count, | |
dependencies.dependency_requirements as hal_version | |
FROM | |
`bigquery-public-data.libraries_io.dependencies` dependencies | |
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
#!/bin/sh | |
if [ $TARGET == "x86_64-unknown-linux-gnu" ]; then | |
cargo build --target=$TARGET --release | |
elif [ $TARGET == "x86_64-apple-darwin" ]; then | |
cargo build --target=$TARGET --release | |
elif [ $TARGET == "armv7-unknown-linux-gnueabihf" ]; then | |
sh ./cross-linux-armhf.sh |
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
# place in /etc/systemd/system/whatever.service and install with `systemd install whatever.service` | |
# note that if you change this file you will need to run `systemctl daemon-reload` to get systemd to notice | |
[Unit] | |
Description=A good service description | |
# After networking because we need that | |
After=network.target | |
[Service] |
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
# CMake GoogleTest vendoring helper | |
# Adapted from https://github.com/snikulov/google-test-examples | |
include(ExternalProject) | |
find_package(PkgConfig REQUIRED) | |
pkg_check_modules(GTEST gtest) | |
set(GTEST_FORCE_SHARED_CRT ON) | |
set(GTEST_DISABLE_PTHREADS OFF) |
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
use futures::{future, Future, sync::oneshot}; | |
use tokio::spawn; | |
/// AsyncWait implements a `.wait()` equivalent that works from any contex. | |
/// This is required because at some point in the past `.wait()` stopped doing this, | |
/// and thus calling it in a polling context causes everything to lock up. | |
/// see: https://github.com/tokio-rs/tokio-core/issues/182 and related issues. | |
/// ``` norun | |
/// // This will block forever if run in the main thread context | |
/// let _client = TcpConnection::<JsonCodec<Request, Response>>::new(&addr, JsonCodec::new()).wait().unwrap(); |
NewerOlder