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
| """ | |
| <keywords> | |
| test, python, fuse, ramdisk, benchmark, io, disk, performance | |
| </keywords> | |
| <description> | |
| Run a benchmark of IO of the ramdisk using multiple pinned threads | |
| </description> | |
| """ | |
| import os |
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
| """ | |
| <keywords> | |
| test, python, couchdb, database, create, connect, server | |
| </keywords> | |
| <description> | |
| This script connects to a CouchDB server and creates a database named "tutorial" | |
| if it does not already exist. | |
| </description> | |
| """ |
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/bash | |
| usage() { | |
| echo "Usage: $0 --watch <path_pattern> --cmd <command>" | |
| echo " Monitors files/directories matching <path_pattern> for close_write events" | |
| echo " and executes <command> upon detection." | |
| echo " The placeholder {} in <command> will be replaced with the full path of the changed file." | |
| echo "Examples:" | |
| echo " $0 --watch 'src/**/*.js' --cmd 'echo \"File {} changed\" && eslint {}'" | |
| echo " $0 --watch '/config/app.conf' --cmd '/bin/bash /opt/scripts/reload_service.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
| # | |
| # patched rpms for CVE-2023-51385 ( https://access.redhat.com/security/cve/cve-2023-51385 ) | |
| # | |
| mkdir workdir | |
| docker run -it --rm -v $PWD/workdir:/root centos:7 | |
| yum install -y \ | |
| pam-devel \ | |
| rpm-build \ | |
| zlib-devel \ | |
| wget \ |
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 | |
| ################################################## | |
| # usage: | |
| # $ ./install_fzf_rg.sh | |
| # execute the script without saving it to disk: | |
| # | |
| # $ curl -s -L https://gist.github.com/mherkazandjian/a506af9858bbe44a9fbf5c21c9b15682/raw/install_fzf_rg.sh | bash -s | |
| ################################################## |
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 | |
| ################################################## | |
| # usage: | |
| # # quick install | |
| # $ ./install_cmake.sh | |
| # # quick install with a custom install path / prefix | |
| # $ ./install_cmake.sh /opt/cmake | |
| # execute the script without saving it to disk: | |
| # $ curl -s https://gist.githubusercontent.com/mherkazandjian/fba54cd94316bfc1b1693a6ba2625f50/raw/2a1cefe9951bf6bd94910aefebb59d22eb85599c/cmake_installer.sh | bash |
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 | |
| ################################################## | |
| # usage: | |
| # $ ./install_miniconda.sh ~/apps/miniconda | |
| # $ ./install_miniconda.sh ~/apps/miniconda --mamba | |
| # $ ./install_miniconda.sh ~/apps/miniconda --installer latest | |
| # $ ./install_miniconda.sh ~/apps/miniconda --upgrade --mamba | |
| # $ ./install_miniconda.sh ~/apps/miniconda --installer latest --upgrade --mamba | |
| # $ ./install_miniconda.sh ~/apps/miniconda --installer Miniconda3-py310_23.5.1-0-Linux-x86_64.sh --upgrade --mamba |
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
| BootStrap: debootstrap | |
| OSVersion: trusty | |
| MirrorURL: http://us.archive.ubuntu.com/ubuntu/ | |
| %post | |
| sed -i 's/$/ universe/' /etc/apt/sources.list | |
| apt-get update | |
| apt-get clean | |
| apt-get install -y --no-install-recommends locales | |
| echo "en_US.UTF-8 UTF-8" >> /etc/locale.gen |
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
| import asyncio | |
| import shlex | |
| async def run_command(command: str): | |
| """ | |
| Coroutine that runs a command and captures the output as it is generated | |
| The stdout output is collected in an async fashion one line at a time. | |
| Each line is logged to the output for demonstration purposes. Once can |
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
| import os | |
| import tarfile | |
| def extract_tar_gz_file(in_fpath: str, out_dir: str): | |
| """ | |
| Extract a zipped tar archive | |
| :param in_fpath: the path to the .tar.gz file | |
| :param out_dir: the path of the extracted content | |
| """ |
NewerOlder