Giter Club home page Giter Club logo

tomutils's Introduction

tomutils

Various scripts that I find useful.

center

Filter: Center text.

csv2tabs

Filter: Turn CSV into TSV.

dup-usb.sh

Used for mass production of USB sticks. If I wasn't cheap, I'd buy a duplicator. But, since I am cheap, I use a 4-port USB hub on a Mac and run this script in 4 different windows. Use at your own risk!

flag

The modified version of the golang flag module that permits a default file and a -flagfile option. Sadly the go authors rejected it. They don't want any changes to the standard library.

GETOPT_SAMPLE

Example of how to process command line flags in a BASH script.

joinlike

joinlike combines all lines that have the same 'first part' where the 'first part' is defined to be everything to the first whitespace. The behaviour is somewhat akin to join, but it doesn't assume the input is sorted. It works with files or pipes.

The Unix "join" command really should have this as a feature built-in. It doesn't, so here is an implementation.

mac2unix

Filter: Turn Mac line endings into Unix line endings.

md5tree

Generate a TAB-separated summary of all the files in a tree. Makes comparison easy.

# md5tree /mnt/RAIDVault        >/var/tmp/list.orig
# md5tree /mnt/RAIDVault-BACKUP >/var/tmp/list.backup
   # NOTE: For these next 2 lines TAB means press the TAB key.
# sort  -t'TAB' -k6 </var/tmp/list.backup >/var/tmp/list.backup.sorted
# sort  -t'TAB' -k6 </var/tmp/list.orig >/var/tmp/list.orig.sorted
# diff /var/tmp/list.orig.sorted /var/tmp/list.backup.sorted

The lines are tab-separated and the filename is the last thing on the line. That makes it easier to parse the data.

PERL-DEPARSE-EXAMPLE

I use deparse rarely enough that when I do, I need a reminder of how to use it. This is my reminder.

PYTHON\_main.py

When I start a new Python script, I start with this base.

PYTHON\_main\_short.py

When I start a new Python script, I start with this base if there are no command line flags. I always regret this because later I end up needing command line flags.

renamescreencapture.go

El Capitan (MacOS X 10.11) removed the ability to select the exact format of screencapture's filenames. This utility renames such files to be more unix-friendly: No spaces, 24-hour time.

To install:

cd ~src
go get github.com/TomOnTime/tomutils
cd github.com/TomOnTime/tomutils/renamescreencapture
go install

tablize

Filter: Input TSV and output an HTML table.

tabs2csv

Filter: Turn TSV into CSV.

uniq-unsorted

Filter: Like Unix "uniq" but works on unsorted data.

unsort

Filter: LIke Unix "sort" but randomizes the order of the lines.

tomutils's People

Contributors

tomontime avatar thofrank avatar

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.