Code Monkey home page Code Monkey logo

misctools's Introduction

misctools

Collection of random handy tools.

Python

cmdline-selection.py

This script uses the prompt_toolkit library to allow the user to interactively select strings from a list using a radio list or a checkbox list. Functions:

  • select_from_radiolist(strings): Prompts the user to select a single string from a list using a radio list. Returns the selected string.

  • select_from_checkboxlist(strings): Prompts the user to select one or more strings from a list using a checkbox list. Returns a list of selected strings.

oomtest.py

Try to allocate memory in 1GB chunks. Print out allocated memory size and see when allocation failed. It's helpful to test the actual memory limits for a systems, especially in cloud or docker.

ping-network.py

Python script to ping all IPs in a range and report result(up/down) in a table.

  • Ping each IP 3 times.
  • 0 packet loss means it's up, otherwise it's down.
  • multiprocess is used to do it in parallel.

treemap.py

Parses letters in a file and present the occurances in a treemap.

  • An interactive treemap will be rendered in web browser.
  • An image file will be saved locally too.

The sample program parses itself.

Bash

namedpipe.sh

Assume you have an interactive program your_program which accepts stdin and sends response to stdout. This simple script will setup a named pipe so that you can test it in batch.

  • The inputs will be read from $input_dir, assuming a .txt file.
  • Each output from the input will be write to $output_dir with _output append to the basename.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.