Interests: programming, video games, anime, music composition

I used to be on kbin as e0qdk@kbin.social before it broke down.

  • 2 Posts
  • 178 Comments
Joined 2 years ago
cake
Cake day: November 27th, 2023

help-circle


  • Been a long time since I’ve used a laptop, but usually when I’ve got a terminal open I’m doing something with Python these days. Often I just use it interactively as a calculator with some nice extra features. (I have some libraries like humanize installed in a local environment that I fire up frequently for quick tasks. That library can turn a number of bytes or seconds into easily readable approximations – e.g. humanize.naturalsize(1920*1080*3*60) spits out 373.2 MB for the size of 60 frames of uncompressed HD video.) I also have a bunch of custom scripts for various things – like a trivial spellchecker, custom image viewers, tools for converting timestamps between formats I use frequently, etc. Occasionally, I’m checking the load on a system with tools like htop, or logged into a remote system with ssh to fix something, running a long download with wget (or other tools), or re-encoding a video with particular settings using ffmpeg. Rarely I’m searching through my files with grep or other tools.





  • Here’s one of mine. I got annoyed at the complexity of other command line spellcheckers I tried and replaced them with this simple python script for when I just want to check if a single word is correct:

    #!/usr/bin/env python3
    
    import sys
    
    try:
      query = sys.argv[1].lower()
    except Exception:
      print("Usage: spellcheck <word>")
      exit(1)
    
    with open("/usr/share/dict/words") as f:
      words = f.readlines()
    
    words = [x.strip().lower() for x in words if len(x.strip()) > 0]
    
    if not query in words:
      print("Not in dictionary -- probably a typo")
      exit(1)
    else:
      print("OK")
      exit(0)
    


  • I just ssh in and use the remote computer’s shell (typical bash on the remote side via gnome-terminal on my local Mint system) or mount a remote directory (via sftp) if I want to use a GUI editor. Not sure what hoops you have to jump through on Mac since I don’t use it these days. I’d assume you can ssh into a remote system from Mac’s default terminal app still? (I learned a bunch of Unix basics on OS X in a class ~20 years ago; it worked back then, at least…)




  • I thought I wanted to be a game developer back then and was making a bunch of hobby projects with Game Maker, had taught myself C++ (to a mediocre level), was writing (not very good) music, and generally burning myself the fuck out. -.-

    The programming turned into a career (not in gamedev though). Everything else turned into an anxiety disorder.