EDIT: check out fix-python instead, make Python run "as usual" on NixOS!
- You are using NixOS
- You start working on a Python project
- You manage the dependencies in a classic Python virtual environment using pip or poetry
EDIT: check out fix-python instead, make Python run "as usual" on NixOS!
QNAP NAS model TS-453 Pro has limited documentation on how to control its various peripherals, namely:
This is a short post that explains how to write a high-performance matrix multiplication program on modern processors. In this tutorial I will use a single core of the Skylake-client CPU with AVX2, but the principles in this post also apply to other processors with different instruction sets (such as AVX512).
Matrix multiplication is a mathematical operation that defines the product of
| script | |
| var CopyOption = Java.type("java.nio.file.StandardCopyOption"); | |
| // put all files here >>> | |
| var ddlPath = java.nio.file.FileSystems.getDefault().getPath('ddl') | |
| var fs = java.nio.file.FileSystems.getDefault(); | |
| var f = java.nio.file.Files; | |
| if ( ! f.exists(ddlPath)) { | |
| f.createDirectory(ddlPath) |
| # Paths {{{ | |
| set folder = ~/Mail # mailbox location | |
| set alias_file = ~/.mutt/alias # where to store aliases | |
| set header_cache = ~/.mutt/cache/headers # where to store headers | |
| set message_cachedir = ~/.mutt/cache/bodies # where to store bodies | |
| set certificate_file = ~/.mutt/cerficates # where to store certs | |
| set mailcap_path = ~/.mutt/mailcap # entries for filetypes | |
| set tmpdir = ~/.mutt/temp # where to keep temp files | |
| set signature = ~/.mutt/sig # my signature file |
| #!/bin/bash | |
| # Vadim Zaliva lord@crocodile.org | |
| # based on https://gist.github.com/hadess/6847281 | |
| if [[ $EUID -ne 0 ]]; then | |
| echo "This script must be run as root" 1>&2 | |
| exit 1 | |
| fi |
| #!/bin/bash | |
| # default location of theme and wallpaper | |
| # replace 'awtheme' with your current theme | |
| wallpaperDestination="$HOME/.config/awesome/themes/awtheme/wallpaper"; | |
| # add #include "/home/arch/.Xresources_colors" to .Xresources | |
| colorScriptDestination="/home/arch/.Xresources_colors" | |
| # add [[ -f "$HOME/.bash_colors" ]] && . "$HOME/.bash_colors"; to .bashrc | |
| # bashColorsDestination="/home/arch/.bash_colors" |
| #include <string.h> | |
| void *__memcpy_glibc_2_2_5(void *, const void *, size_t); | |
| asm(".symver __memcpy_glibc_2_2_5, memcpy@GLIBC_2.2.5"); | |
| void *__wrap_memcpy(void *dest, const void *src, size_t n) | |
| { | |
| return __memcpy_glibc_2_2_5(dest, src, n); | |
| } |
This can reduce files to ~15% of their size (2.3M to 345K, in one case) with no obvious degradation of quality.
ghostscript -sDEVICE=pdfwrite -dCompatibilityLevel=1.4 -dPDFSETTINGS=/printer -dNOPAUSE -dQUIET -dBATCH -sOutputFile=output.pdf input.pdf
Other options for PDFSETTINGS:
| *.tex diff=tex | |
| *.bib diff=bibtex | |
| *.c diff=cpp | |
| *.h diff=cpp | |
| *.c++ diff=cpp | |
| *.h++ diff=cpp | |
| *.cpp diff=cpp | |
| *.hpp diff=cpp | |
| *.cc diff=cpp | |
| *.hh diff=cpp |