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
| // Simple code snippet for adding tracing to the tests of a code that already makes use of the | |
| // tracing crate. | |
| // To enable the tracing output, call the test using `RUST_LOG`. | |
| // `RUST_LOG=info cargo test` | |
| // `RUST_LOG=mycrate=info cargo test` | |
| // Required deps: | |
| // tracing = "0.1.41" | |
| // tracing-subscriber = { version = "0.3.20", features = ["env-filter"] } | |
| // once_cell = "1.21.3" |
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/env bash | |
| # pre-commit hook that checks all the cached modifications are compliant | |
| # with the style rules of a typical Rust repository. | |
| # How to use it: | |
| # Within your repository, cd .git/hooks | |
| # Create a new pre-commit file and paste the content from here. | |
| # You can also use (part of) the sample pre-commit hook, and add this chunk. | |
| # Finally, don't forget to add execution permissions to the 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
| activate_rtlmake() { | |
| venv_path=$HOME/.local/venv/rtl-make | |
| # If the environment variable is not defined, set it to the default version. | |
| if [ -z $RTLMAKE ]; then | |
| RTLMAKE="0.5.0" | |
| fi | |
| case $RTLMAKE in | |
| "0.5.0" | "0.3.0") |
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
| # First we can see wich serial ports are initializated by the kernel | |
| sudo dmesg | grep ttyS | |
| read -s "Press to continue..." forgetme | |
| # When you connect a serial port, a positive voltage should be detected by the driver | |
| sudo cat /proc/tty/driver/serial> /tmp/1 | |
| read -s "Connect the device and press..." forgetme | |
| sudo cat /proc/tty/driver/serial> /tmp/2 | |
| diff /tmp/1 /tmp/2 |
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
| vivado_vars() | |
| { | |
| xil_path=/opt/Xilinx/Vivado # Change that to point to your Vivado installation | |
| export XILINXD_LICENSE_FILE=<put here the path if a floating license is needed, comment out if not> | |
| case $1 in | |
| 18) | |
| ver=18.2;; | |
| 16) | |
| ver=16.4;; | |
| 17) |
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
| #!/usr/bin/env bash | |
| user=felipe | |
| server=10.0.4.101 | |
| serverpath=/home/felipe/workspace | |
| if [ "x"$1 = "x" ];then | |
| echo -e "Usage: easysync <folder> [<options>]" | |
| return -1 | |
| fi |