{"id":20210604,"url":"https://github.com/rebeccargb/goodiebin","last_synced_at":"2026-04-10T03:02:51.993Z","repository":{"id":34477212,"uuid":"38415232","full_name":"RebeccaRGB/goodiebin","owner":"RebeccaRGB","description":"The Goodie /bin/ - A random assortment of command line utilities.","archived":false,"fork":false,"pushed_at":"2025-06-05T04:32:49.000Z","size":72,"stargazers_count":4,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-06-05T07:08:30.802Z","etag":null,"topics":["cli-utilities","command-line","utilities","utility"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RebeccaRGB.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-07-02T06:22:32.000Z","updated_at":"2025-06-05T04:32:51.000Z","dependencies_parsed_at":"2025-01-13T21:30:54.573Z","dependency_job_id":"58430837-de3a-4f70-812b-7e7d6b93c650","html_url":"https://github.com/RebeccaRGB/goodiebin","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/RebeccaRGB/goodiebin","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RebeccaRGB%2Fgoodiebin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RebeccaRGB%2Fgoodiebin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RebeccaRGB%2Fgoodiebin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RebeccaRGB%2Fgoodiebin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RebeccaRGB","download_url":"https://codeload.github.com/RebeccaRGB/goodiebin/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RebeccaRGB%2Fgoodiebin/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":265484786,"owners_count":23774396,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["cli-utilities","command-line","utilities","utility"],"created_at":"2024-11-14T05:48:36.132Z","updated_at":"2026-04-10T03:02:51.928Z","avatar_url":"https://github.com/RebeccaRGB.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# The Goodie `/bin/`\n\nThis repository contains a random assortment of command line utilities that I have personally written and found very useful.\n\n## `approximate`\n\nCalculates the best fractional approximation of a real number. The first argument is the highest denominator to use. The remaining arguments are the values to approximate.\n\n    $ approximate 10 3.1415926535\n    3.1415926535 ≈ 22 / 7 = 3.14285714286\n    Delta: 0.00126448935714\n    Error: 0.0402499463364%\n    $ approximate 100 3.1415926535\n    3.1415926535 ≈ 311 / 99 = 3.14141414141\n    Delta: 0.000178512085859\n    Error: 0.00568221617337%\n    $ approximate 1000 3.1415926535\n    3.1415926535 ≈ 355 / 113 = 3.14159292035\n    Delta: 2.66853982467e-07\n    Error: 8.49422607891e-06%\n\n## `bci`\n\nConverts integers from one base (binary, octal, decimal, hexadecimal, etc.) to another. The first argument is the input base. The second argument is the output base. The remaining arguments are the values to convert.\n\n    $ bci 10 16 255 65535 42\n    FF\n    FFFF\n    2A\n    $ bci 16 10 ff ffff 42\n    255\n    65535\n    66\n\n## `bcr`\n\nLike `bci`, only working on real numbers. (This may be less precise than `bci` for integer values.)\n\n    $ bcr 10 16 3.1415926535\n    3.243F6A8822E88\n    $ bcr 16 10 3.243F6A8822E88\n    3.1415926535000000541231202078051865100860595703125\n\n## `bec`\n\nA calculator with an extensive set of functions and operations. Much easier to use than `bc`.\n\n    $ bec 2 + 2\n    4\n    $ bec 0xFF + 25\n    0x118\n    $ bec 42*0x42\n    2772\n    $ bec [sqrt[2]^sqrt[2]]^sqrt[2]\n    2.0\n    $ bec hypot[3,4]\n    5.0\n    $ bec toDeg[atan2[2,1]]\n    63.4349488229\n    $ bec 1/[1/1+1/2+1/3+1/6]\n    0.5\n    $ bec rsr[1,2,3,6]  #  reciprocal of sum of reciprocals - equivalent to above\n    0.5\n    $ bec fact 4\n    24.0\n    $ bec avg[6,9,12,17]\n    11.0\n    $ bec 0b11001100 :x 0b01010101  #  bitwise xor\n    0b10011001\n\n## `canonicalize`\n\nPrints the canonical file path for every file path given as an argument. Removes symlinks and redundant dots and slashes from the directory path.\n\n    $ canonicalize /\n    /\n    $ canonicalize /tmp/\n    /tmp\n    $ canonicalize /tmp/aprc9YXQU \n    /private/tmp/aprc9YXQU\n    $ canonicalize /usr/local/bin/../../local/bin/../bin/canonicalize\n    /usr/local/bin/canonicalize\n    $ canonicalize /this/file/does/not/exist\n    /this/file/does/not/exist\n\n## `chargen`\n\nGenerates characters.\n\n    $ chargen -n 5\n    !\"#$%\u0026'()*+,-./0123456789:;\u003c=\u003e?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefgh\n    \"#$%\u0026'()*+,-./0123456789:;\u003c=\u003e?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghi\n    #$%\u0026'()*+,-./0123456789:;\u003c=\u003e?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghij\n    $%\u0026'()*+,-./0123456789:;\u003c=\u003e?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijk\n    %\u0026'()*+,-./0123456789:;\u003c=\u003e?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijkl\n    $ chargen -f A -l Z -n 5\n    ABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRST\n    BCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTU\n    CDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUV\n    DEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVW\n    EFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWXYZABCDEFGHIJKLMNOPQRSTUVWX\n    $ chargen -f 0x30 -l 0x39 -o 1 -w 80 -n 1\n    12345678901234567890123456789012345678901234567890123456789012345678901234567890\n    $ chargen -v\n     !\"#$%\u0026'()*+,-./\n    0123456789:;\u003c=\u003e?\n    @ABCDEFGHIJKLMNO\n    PQRSTUVWXYZ[\\]^_\n    `abcdefghijklmno\n    pqrstuvwxyz{|}~ \n    $ chargen -f 0x100 -l 0x17F -v -t ' '\n    Ā ā Ă ă Ą ą Ć ć Ĉ ĉ Ċ ċ Č č Ď ď\n    Đ đ Ē ē Ĕ ĕ Ė ė Ę ę Ě ě Ĝ ĝ Ğ ğ\n    Ġ ġ Ģ ģ Ĥ ĥ Ħ ħ Ĩ ĩ Ī ī Ĭ ĭ Į į\n    İ ı Ĳ ĳ Ĵ ĵ Ķ ķ ĸ Ĺ ĺ Ļ ļ Ľ ľ Ŀ\n    ŀ Ł ł Ń ń Ņ ņ Ň ň ŉ Ŋ ŋ Ō ō Ŏ ŏ\n    Ő ő Œ œ Ŕ ŕ Ŗ ŗ Ř ř Ś ś Ŝ ŝ Ş ş\n    Š š Ţ ţ Ť ť Ŧ ŧ Ũ ũ Ū ū Ŭ ŭ Ů ů\n    Ű ű Ų ų Ŵ ŵ Ŷ ŷ Ÿ Ź ź Ż ż Ž ž ſ\n\n## `dechex`\n\nAn alias for `bci 10 16`.\n\n    $ dechex 15 255 65535\n    F\n    FF\n    FFFF\n\n## `erdrcr`\n\nErroR DetectoR and CorrectoR. Compares multiple binary files for bit-for-bit equality. Reports which bits differ and how much of the files differ. Can also output an error-corrected binary file.\n\n    $ erdrcr 1.bin 2.bin 3.bin\n    Address.Mask\t0's\t1's\tCorrection\n    00000015.02:\t2\t1\t0\n    0000001C.08:\t1\t2\t1\n    2 out of 320 bits mismatched (0.625% error rate)\n    all errors correctable\n    $ erdrcr 1.bin 2.bin 3.bin -o 4.bin\n    Address.Mask\t0's\t1's\tCorrection\n    00000015.02:\t2\t1\t0\n    0000001C.08:\t1\t2\t1\n    2 out of 320 bits mismatched (0.625% error rate)\n    all errors correctable\n    $ erdrcr 1.bin 4.bin\n    no differences found\n    $ erdrcr 1.bin trunc.bin \n    Address.Mask\t0's\t1's\tCorrection\n    00000024.20:\t1\t1\t?\n    00000024.10:\t1\t1\t?\n    00000024.02:\t1\t1\t?\n    00000025.20:\t1\t1\t?\n    00000025.10:\t1\t1\t?\n    00000025.04:\t1\t1\t?\n    00000026.20:\t1\t1\t?\n    00000026.10:\t1\t1\t?\n    00000026.02:\t1\t1\t?\n    00000026.01:\t1\t1\t?\n    00000027.20:\t1\t1\t?\n    00000027.02:\t1\t1\t?\n    12 out of 320 bits mismatched (3.75% error rate)\n    12 out of 320 bits unrecoverable (3.75% error rate)\n\n## `factor`\n\nCalculates the prime factorization of an integer and its divisors, and other related properties.\n\n    $ factor 360\n    360 = 2^3 * 3^2 * 5\n    360 = 2 * 2 * 2 * 3 * 3 * 5\n    \n    Divisors: 1, 2, 3, 4, 5, 6, 8, 9, 10, 12, 15, 18, 20, 24, 30, 36, 40, 45, 60, 72, 90, 120, 180, 360\n    sigma_0(n) = 24\n    sigma_1(n) = 1170\n    sigma_1(n)-n = 810\n    sigma_1(n)-2n = 450\n    360 is abundant.\n    \n    Pairs:\n    1*360\t2*180\t3*120\t4*90\t5*72\t6*60\t8*45\t9*40\t10*36\t12*30\t15*24\t18*20\n\n## `harden`\n\nRecursively removes write permissions and sets the user immutable flag (also known as the \"locked\" property of a file under Mac OS X). Useful for creating an unwriteable backup.\n\n## `hexdec`\n\nAn alias for `bci 16 10`.\n\n    $ hexdec f ff ffff\n    15\n    255\n    65535\n\n## `scon`\n\nConnects to a serial port and continually sends stdin to serial input and prints serial output to stdout. (Requires pySerial.)\n\n    $ scon /dev/tty.usbmodemfd121 -b 9600 -d 8 -p none -s 1 -r -w 1\n    !Hello\n    Hello\n    ^C\n    $ scon --help\n    usage: scon [\u003coptions\u003e] \u003cdevice\u003e\n       -u \u003cpath\u003e   serial device to read from and write to\n       -b \u003cint\u003e    baud rate\n       -d \u003cint\u003e    data bits (5, 6, 7, 8)\n       -p \u003cstr\u003e    parity (none, even, odd, mark, space)\n       -s \u003cnum\u003e    stop bits (1, 1.5, 2)\n       -t \u003cnum\u003e    timeout (seconds)\n       -x          enable XON/XOFF\n       -r          enable RTS/CTS\n       -h          enable DSR/DTR\n       -w \u003cnum\u003e    delay before reading or writing (seconds)\n\n## `simplify`\n\nCalculates and divides out the largest common factor / greatest common divisor from a list of integers.\n\n    $ simplify 2 4 6 8\n    GCD: 2\n    Sim: 1 2 3 4\n    $ simplify 36 72 96\n    GCD: 12\n    Sim: 3 6 8\n\n## `soften`\n\nRecursively clears the user immutable flag (also known as the \"locked\" property of a file under Mac OS X). A partial reversal of `harden`.\n\n## `sread`\n\nReads from a serial port and writes to stdout or a file. (Requires pySerial.)\n\n    $ sread -u /dev/tty.usbmodemfa131 -b 9600 -d 8 -p none -s 1 -r -o output.txt -w 1\n    $ sread --help\n    usage: sread [\u003coptions\u003e] \u003cdevice\u003e [\u003coutput\u003e]\n       -u \u003cpath\u003e   serial device to read from\n       -b \u003cint\u003e    baud rate\n       -d \u003cint\u003e    data bits (5, 6, 7, 8)\n       -p \u003cstr\u003e    parity (none, even, odd, mark, space)\n       -s \u003cnum\u003e    stop bits (1, 1.5, 2)\n       -t \u003cnum\u003e    timeout (seconds)\n       -x          enable XON/XOFF\n       -r          enable RTS/CTS\n       -h          enable DSR/DTR\n       -o \u003cpath\u003e   path to write to\n       -w \u003cnum\u003e    delay before reading (seconds)\n       -l \u003cint\u003e    number of bytes to read\n\n## `ssff`\n\nExtracts file paths from svn status lines with the specified statuses. Statuses may be specified in either uppercase or lowercase. `' '`, `'?'`, `'!'`, `'~'` may be specified as `'S'`, `'Q'`, `'E'`, `'T'`, respectively. `'Z'` specifies all possible statuses.\n\n    $ svn status\n    A       added/file\n    D       deleted/file\n    M       modified/file\n    ?       unversioned/file\n    !       missing/file\n    $ svn status | ssff m\n    modified/file\n    $ svn status | ssff ad\n    added/file\n    deleted/file\n    $ svn status | ssff \\?\n    unversioned/file\n    $ svn status | ssff q\n    unversioned/file\n    $ svn status | ssff \\!\n    missing/file\n    $ svn status | ssff e\n    missing/file\n    $ svn status | ssff z\n    added/file\n    deleted/file\n    modified/file\n    unversioned/file\n    missing/file\n    $ svn diff `svn st | ssff m` # diff modified files, but not added or deleted files\n    --- modified/file       (revision 123)\n    +++ modified/file       (working copy)\n    @@ -1,3 +1,3 @@\n     unmodified line\n    -removed line\n    +added line\n     unmodified line\n    $ svn add `svn st | ssff q` # add all unversioned files\n    A         unversioned/file\n    $ svn revert `svn st | ssff m` # revert all modified files\n    Reverted 'modified/file'\n    $ svn revert `svn st | ssff e` # restore all missing files\n    Reverted 'missing/file'\n    $ svn status\n    A       added/file\n    D       deleted/file\n    A       unversioned/file\n\n## `swrite`\n\nReads from stdin or a file and writes to a serial port. (Requires pySerial.)\n\n    $ swrite -u /dev/tty.usbmodemfa131 -b 9600 -d 8 -p none -s 1 -r -i input.txt -w 10\n    $ swrite --help\n    usage: swrite [\u003coptions\u003e] \u003cdevice\u003e [\u003cinput\u003e]\n       -u \u003cpath\u003e   serial device to write to\n       -b \u003cint\u003e    baud rate\n       -d \u003cint\u003e    data bits (5, 6, 7, 8)\n       -p \u003cstr\u003e    parity (none, even, odd, mark, space)\n       -s \u003cnum\u003e    stop bits (1, 1.5, 2)\n       -t \u003cnum\u003e    timeout (seconds)\n       -x          enable XON/XOFF\n       -r          enable RTS/CTS\n       -h          enable DSR/DTR\n       -i \u003cpath\u003e   path to read from\n       -w \u003cnum\u003e    delay before writing (seconds)\n       -l \u003cint\u003e    number of bytes to write\n\n## `truthtable`\n\nGenerates truth tables for boolean expressions.\n\n    $ truthtable a and b\n    a       b       |       a and b\n    0       0       |       0\n    0       1       |       0\n    1       0       |       0\n    1       1       |       1\n    $ truthtable 'X := A\u0026C\u0026D | B\u0026D | ~B\u0026C\u0026~D; Y := A\u0026D | B\u0026C | ~B\u0026D'\n    A       B       C       D       |       X       Y\n    0       0       0       0       |       0       0\n    0       0       0       1       |       0       1\n    0       0       1       0       |       1       0\n    0       0       1       1       |       0       1\n    0       1       0       0       |       0       0\n    0       1       0       1       |       1       0\n    0       1       1       0       |       0       1\n    0       1       1       1       |       1       1\n    1       0       0       0       |       0       0\n    1       0       0       1       |       0       1\n    1       0       1       0       |       1       0\n    1       0       1       1       |       1       1\n    1       1       0       0       |       0       0\n    1       1       0       1       |       1       1\n    1       1       1       0       |       0       1\n    1       1       1       1       |       1       1\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebeccargb%2Fgoodiebin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frebeccargb%2Fgoodiebin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frebeccargb%2Fgoodiebin/lists"}