{"id":22912007,"url":"https://github.com/opencoff/useful-scripts","last_synced_at":"2025-05-09T01:33:41.747Z","repository":{"id":29824969,"uuid":"33369500","full_name":"opencoff/useful-scripts","owner":"opencoff","description":"Useful scripts I wrote to make my life easier","archived":false,"fork":false,"pushed_at":"2020-04-30T00:52:22.000Z","size":158,"stargazers_count":20,"open_issues_count":0,"forks_count":4,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-03-31T20:41:16.345Z","etag":null,"topics":["aes-encryption","disable-windows-capslock","openbsd-scripts","osx-scripts","python","python-script","random-mac-address","shell-scripts"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/opencoff.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-03T15:31:55.000Z","updated_at":"2024-03-10T08:53:03.000Z","dependencies_parsed_at":"2022-08-28T12:51:15.505Z","dependency_job_id":null,"html_url":"https://github.com/opencoff/useful-scripts","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencoff%2Fuseful-scripts","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencoff%2Fuseful-scripts/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencoff%2Fuseful-scripts/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/opencoff%2Fuseful-scripts/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/opencoff","download_url":"https://codeload.github.com/opencoff/useful-scripts/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253174414,"owners_count":21865861,"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":["aes-encryption","disable-windows-capslock","openbsd-scripts","osx-scripts","python","python-script","random-mac-address","shell-scripts"],"created_at":"2024-12-14T04:19:33.844Z","updated_at":"2025-05-09T01:33:41.727Z","avatar_url":"https://github.com/opencoff.png","language":"Python","readme":"Sudhi's Script Hacks\n====================\nThese are some of the scripts I wrote to make my life interesting.\nI contribute it to the world so that others may enjoy.\n\n\nMost of the scripts come with some sort of help message\n(``--help``). If not, the use of the script ought to be evident.\n\nLicense\n=======\nMost of the scripts are GPLv2. Some are with a more liberal (BSD)\nlicense. Don't ask - its just my preference.\n\nBrief Blurb about Each\n======================\n\nmkgetopt\n--------\nThis subdirectory has a standalone Python tool to generate command line\nparsing code for use in C/C++ programs. It uses ``getopt_long()``\nand removes tedium around command line processing. It comes with a\nmanpage and examples.\n\nScripts\n-------\nMany of these scripts have builtin help (``--help``); they are\nidentified with a suffix of ``*``. ::\n\n    abspath            when you need command line access to os.path.abspath()\n    isabs              when you need command line access to os.path.isabs()\n    realpath           when you need command line access to os.path.realpath()\n    aes-test.sh        Self-test for aes.py (tests various sizes)\n    mk-raw-vmware.py   The name says it all; make a raw disk with no holes\n    randmac            Print a semi-random mac address\n    rename             Rename files based on regex. Yes, its Perl.\n    rotatedir          Rotate a directory with newest name ending in .0 suffix\n    xdump              I forget how to use hexdump. Hence this short alias\n\n    server-backup      Script I use to backup remote machines via SSH. Customize it for\n                       your use case.\n\n    aes.py          *  AES encrypt a file in CTR mode with random salt\n    cert-tool.py    *  Tool to turn you into a light weight X.509 CA\n    comic2pdf       *  If you have bunch of CBRs and want PDFs instead\n    deadlinks       *  Show me symlinks that point to non existent files\n    dos2unix.py     *  Turn CRLF into LF\n    finddup         *  If you have identical files strewn around in your file system\n    hexlify         *  hexlificate your stdin\n\n    pardu.py        *  Parallel, pure-python version of du. Possibly\n                       faster than the native version on your machine. \n                       alias du=pardu.py is the recommended way.\n\n    kill.py         *  Cross platform, interactive way to kill processes by name/PID\n                       alias kill=kill.py  works very nicely.\n                       'q' in the prompt cleanly exits the tool.\n\n    rm.py           *  Cross platform, interactive way to remove files\n                       alias rm=rm.py  saves you from unwanted pain.\n                       'q' in the prompt cleanly exits the tool.\n\n    make-tunnel.py  *  Create IPSec tunnels with preshared keys (site-to-site VPN). Tested on\n                       Linux, easy to adapt to other OSes.\n\n    pingsubnet.py   *  Ping multiple addresses in parallel for a subnet and get results back;\n    randpass        *  Experiments in generating random passwords\n    rsync-backup.py *  Backup using rsync and hardlinks\n    tolower         *  Play with file names and their case. Try 'tolower --help'\n\novpn-tool.py      \n------------\nSo, you want to run your own OpenVPN server. And then you decide to get adventerous and offer it to\nyour friends and family. Now, you have to worry about authentication and mobile devices. This\nutility is designed to make your life easy to manage a small OpenVPN server and generate client\ncerts, client configs etc. The generated ``.ovpn`` file is also usable on iOS and Android.\n\nComes with builtin help ``ovpn-tool.py  --help``.\n\nOS X Tools\n----------\nThese are some OS X specific tools that make your life interesting.::\n\n    mkdmg.sh          Make OS X compressed disk image from a source directory\n    gone.sh           Nuke your OS X root/boot disk. Use with care :-)\n\nThe next set of utilities work with ``launchd(8)`` to make their behavior persistent across boots.\nYou can run them in one-shot mode on the command line or use the ``install`` option to relegate it\nto launchd control.::\n\n    osx-ipfw.sh       Enable ipfw(8) with a default set of secure rules\n    osx-noatime.sh    Enable noatime mounts on all disks\n    osx-ramfs.sh      Put /tmp and /var/run under a RAMFS\n    osx-randmac.sh    Randomize your MAC address every day. Designed to auto-detect your wifi\n                      interface. Run it without any args to see usage.\n    osx-tuntap.sh     Make your tun-tap driver persistent.\n\n\nThe ramfs.sh and randmac.sh files have been tested to work on OS X Yosemite.\n\nLinux Specific Tools\n--------------------\n::\n\n    find-usb-disk     List USB disks - for those of us who dislike systemd\n    linktest.py       Test link status of ethernet interface(s)\n\nkern-build\n~~~~~~~~~~\nIf you are in the embedded systems world - building and using custom linux kernels, then you'll love\nthis utility. It allows you to build multiple kernel images from a single source directory. It\ntook life during the reign of 2.6.12. I've kept it more or less up-to-date through modern 3.x\nkernels. Haven't tried it on 4.x yet.\n\nI used it regularly to build kernels for UML, x86 and mips. If you add other Arch's and their\naliases, send me patches.\n\nopenbsd-randmac.sh \n------------------\nThis script is incomplete - it generates a random mac address and sets it on the interface. But, one\nneeds a place from whence to call this. Haven't figured out exactly where to do that. Patches\nwelcome.\n\ndisablecaps.inf\n---------------\nA long time ago, I used to do a lot of work on Windows - especially writing ARM instruction set\nemulators. And, I wanted a way to disable CapsLock permanently. I figured out this hack to make it\nhappen. I haven't tested in on a more recent Windows 7/8/10. If you find this useful, drop me a\nnote.\n\n--\nSudhi\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencoff%2Fuseful-scripts","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fopencoff%2Fuseful-scripts","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fopencoff%2Fuseful-scripts/lists"}