This guide walks you through installing Nix, enabling flakes, and setting up a reproducible development environment on Arch Linux.
The recommended way to install Nix is via the official script:
schema.rs and the table! macro to reflect database structures.filter, order, and limitThis document provides a comprehensive guide on using the tracing::instrument macro in Rust. It covers the basics of the tracing crate, the purpose and functioning of the instrument macro, and best practices for its effective use in software development.
Overview: The tracing crate is a collection of Rust libraries for application-level tracing and asynchronous diagnostics. It provides a framework for collecting structured, event-based diagnostic information. The instrument macro, specifically, is a part of this crate. It automatically attaches context-specific information to logs, such as function arguments and return values, making it easier to track the flow and performance of the code.
Purpose: The primary purpose of the tracing::instrument macro is to aid in diagnostics and performance analysis. By annotating functions with this macro, developers can automatic
| #!/bin/bash | |
| # Use nmap to find open ports fast and then run a detailed scans on the returned ports | |
| if [ -z "$1" ] | |
| then | |
| echo "__nmap_fast__" | |
| echo "Usage: ./nmap_fast TARGET_HOSTNAME" | |
| fi | |
| TARGET_HOSTNAME=$1 |
| ## Encrypt | |
| tar cz folder | openssl aes-256-cbc -salt -pbkdf2 -e > out.tar.gz.enc | |
| ## Decrypt | |
| openssl aes-256-cbc -d -salt -pbkdf2 -in out.tar.gz.enc | tar xz |
| #!/bin/bash | |
| set -e | |
| sudo -u ec2-user -i <<'EOF' | |
| conda create --prefix ~/your_project -y -c conda-forge python=3.7 ipykernel | |
| source activate /home/ec2-user/your_project | |
| conda install -y your_libs | |
| python -m ipykernel install --user |
| binary_search(){ | |
| TARGET=$1 | |
| TO_SEARCH=(${@:2}) | |
| LENGTH=${#TO_SEARCH[@]} | |
| START=0 | |
| END=$((LENGTH - 1)) | |
| while [[ $START -le $END ]]; do | |
| MIDDLE=$((START + ((END - START)/2))) | |
| ITEM_AT_MIDDLE=${TO_SEARCH[MIDDLE]} |
| #!/bin/bash | |
| ME=`whoami` | |
| PROCESS=$1 | |
| echo $PROCESS | |
| echo $ME | |
| IPCS_S=`ipcs -s $PROCESS | egrep "0x[0-9a-f]+0-9]+" | grep $ME | cut -f2 -d" "` | |
| IPCS_M=`ipcs -m $PROCESS | egrep "0x[0-9a-f]+[0-9]+" | grep $ME | cut -f2 -d" "` |
| #expose yam facts under /var/lib/puppet/yaml/facts/ in /etc/puppet/fileserver.conf and access via http | |
| curl -k -H "Accept: yaml" https://puppetmaster:8140/production/facts/hostname |
| require 'puppet' | |
| require 'puppet/application' | |
| require 'facter' | |
| typeobj = Puppet::Type.type("package") | |
| properties = typeobj.properties.collect { |s| s.name } | |
| format = proc {|trans| | |
| trans.dup.collect do |param, value| | |
| if value.nil? or value.to_s.empty? | |
| trans.delete(param) |