12 ms·
Hundreds! Doesn't everyone? Most of them are just bash scripts, many of which have now reached a complexity so high that I wish I'd started writing them in a di
by LeoPanthera 5y ago
Hundreds! Doesn't everyone? Most of them are just bash scripts, many of which have now reached a complexity so high that I wish I'd started writing them in a different language but it's too late now. The majority of the rest are Python.
Off the top of my head, the most used ones are:
* A replacement front-end for "tar" and various compressors
* A script to synchronize my music library to a compressed version for playing in my car
* A secure-but-readable password generator
* A system to batch compress folders full of video files. (For ripped blu-ray discs, mostly.)
* A replacement front-end for "ffmpeg", see above
* A "sanity check" program for my internet connection to see if the problem is me, or Comcast
* A front-end for "rm" that shows a progress bar when deleting thousands of files. (Deletes on ZFS are unusually slow.)
And lots more tiny things.
- pdonis 5y ago> Hundreds! Doesn't everyone? I certainly have. Interestingly, one was the same "sanity check" program for my internet connection, because of the same ISP you mention. Amazing coincidence...I don't think. :-)
- tessierashpool 5y agoI've written one too, if you count a simple shell alias for ping google.com Comcast "service" has probably driven the creation of more trivial internet connection test programs than any college course in the world.
- oblib 5y agoI get more calls from users of my apps that have Comcast as the access provider than any other, and by far. The first thing I do when they have connection issues is check downdetector.com
- OrderlyTiamat 5y agoMine uses notify-send to send a notification when connection is back up/ when connection goes down.
- brk 5y agoAdd another Comcast outage checker and logger to the pile. Used to call and hassle them for outage refunds regularly.
- inetknght 5y agoChalk me up to that too. And my brother. Originally I'd used Ping Plotter. When I went 100% Linux I stopped using that. My brother ended up putting together a Grafana board tied to influxdb & infping and monitors several friend and family internet connections complete with alerts. Here [0] is a screenshot of the Comcast cable connection from a year and a half ago. I have since switched to AT&T gigabit fiber. Here [1] is a screenshot from today. [0]: https://knightoftheinter.net/img/20201102143900.png https://knightoftheinter.net/img/20201102143900.png [1]: https://knightoftheinter.net/img/Screenshot_20220413_171934.png https://knightoftheinter.net/img/Screenshot_20220413_171934....
- jmartens 5y agoI love that you are crowdsourcing data from several friends and family members. We need this for most of the SaaS world!
- ahmedalsudani 5y agoHah. I did not realize that was an option. Should have been keeping track of downtime :)
- mauvehaus 5y agoI ginned up a "wait for the internet to come back up" script that repeatedly pinged something with one packet, and used the Mac 'open' command to play an mp3 file once the ping succeeded. Unsexy, but when you can't google up a better solution...
- ralgozino 5y agoI made something similar but I used macos' `say` command instead :)
- cdaringe 5y agoI like this idea. Some company that I may or may not work for either does or does not install malware on our computers, extending the boot sequence and something in the network layer that makes it take MINUTES for anything http to be usable, even after the DE is loaded. Would love to add such a script to my login’s boot sequence
- parentheses 5y agoLinks, please.
- edpenz 5y ago> A secure-but-readable password generator I love pronounceable passwords, but there's research indicating that such generators typically produce lower than expected entropy. Do you mind sharing what algorithm you use?
- omaranto 5y agoI think the generator from xkcd sounds pretty good. https://xkcd.com/936/ https://xkcd.com/936/
- heyoni 5y agoProblem is so many websites have these arbitrarily low password lengths that usually max out at 20 characters.
- bombcar 5y agoWorse are the ones that let any length input but only read the first ten characters or so.
- lucb1e 5y agoI haven't seen those in a while now. For random sites you should use a password manager anyway though, not try to remember a thousand passphrases. You're going to end up reusing passwords if you try to memorize them all, or else you'll have to write some down and then you are already using a password manager :). Or you use a system and then 1-2 cracked passwords/-phrases will likely break them all. Note that this advice is for the average, common site. If you have special considerations for your bank, broker, or similarly high-value sites, different advice might apply of course (but this is not really the place for that and there are already enough recommendations online).
- Jaruzel 5y agoFor ages I remembered this as 'battery-horse-staple-correct' but then I see loads of people saying 'correct-battery-horse-staple' so now I think I'm the one who is wrong. I wonder which way round is actually the right way to say it?
- lq0000 5y ago> * A replacement front-end for "ffmpeg", see above I have one of these too... It's kind of frightening how hard ffmpeg is to use without some kind of custom frontend. I have probably dozens of bash/python scripts to invoke ffmpeg for different common tasks. - One to extract audio - One to extract all the individual streams from a container - A couple different transcoding scripts - One specifically for gifs - One to crop video - A few that I can't remember the purpose of... and can't tell from reading the source
- physicles 5y agoI wrote one of those last week as a sort of poor man’s video editor. Besides aliases for common commands (like extracting a time range without re-encoding), it also takes the tedium out of repeatedly typing file names. Output file names are generated based on the input file name, with a prefix that auto-increments like sql. Input files can be referenced by prefix. It makes a huge difference.
- blunte 5y agoPerhaps because ffmpeg and other swiss army knife tools can do so many useful things.
- LeoPanthera 5y agoPeople always say this but... I'm not sure I agree. I think people confuse "hard" with "powerful". With the exception of cropping I can do all of the above from memory. Maybe I just use ffmpeg a lot.
- ahmedalsudani 5y ago> Hundreds! Doesn't everyone? Raising my hand in agreement! A couple highlights: - Video syncing library before those became cool (2014). Originally built on top of firebase; now rewriting with my own backend. Very slow going :) - Twilio server + interface. I'm my own service provider (thanks to Twilio)
- thwayunion 5y ago> - Twilio server + interface. I'm my own service provider (thanks to Twilio) What does this mean? You run a pbx that implements twilio's apis and can be accessed via twilio's api endpoints? Or something else?
- deleted 5y ago[deleted]
- ahmedalsudani 5y agoTwilio is the PBX and gateway for calls + texts. I run a server that lets me receive calls wherever I am (SIP or forwarding, as required) and send messages. Like a self-hosted Google Voice but more flexible and with a greater choice of numbers + forwarding destinations. All my server does is respond to HTTP requests from Twilio and send HTTP requests when I send a message. Somewhere in the Twilio interface, you can define a SIP endpoint, but I forget where it is. That's enough for placing calls and does not require running a server. Almost forgot to mention that I receive text notifications via pushover because I am not an Apple developer ... so no app for me.
- u2077 5y agoInterested in making it open source? Self-hosted Google voice sounds awesome!
- ahmedalsudani 5y agoIt's ugly and not user-friendly but I encourage you to play with Twilio! They make everything super easy.
- deleted 5y ago[deleted]
- ajkjk 5y agoIt's cool that you do that, but "Doesn't everyone?" implies to me that you might be a bit out of touch. This is common among a certain type of person and unheard of for everybody else.
- pensatoio 5y agoNot to cast shade on you, by any means, but if you're an engineer (which I think is the implied everyone,) I'm surprised you don't!
- 3qz 5y ago> but if you're an engineer (which I think is the implied everyone,) I'm surprised you don't! I’m an engineer but I only write programs for money and not for myself
- ajkjk 5y agoYeah, I'm an engineer. I'd guess that neither I nor most of my coworkers do. It's much more common amongst lower-level engineers than, say, product engineers. Heck, I work full time in Python + Typescript and I don't even know Bash. I never even have things I want to script. Most of my time is spent making sense of code, not doing any sort of complicated repeatable task.
- tommek4077 5y agoSo, what are you engineering? Ci/cd pipelines with ready made tools?
- bigiain 5y ago
- nickm12 5y agoYeah, I think OP might be more interested in "what is the most elaborate program you wrote only for your personal use?" Most of my personal programs have been command-line script. I have written a couple of single-page web apps and a Mac app once. These were more learning projects than programs I used long term.
- ilrwbwrkhv 5y agoI also had tons of these scripts. Since then I found one ScriptKit which might be interesting to you. https://www.scriptkit.com/ https://www.scriptkit.com/ I have since ported over most of my common ones to this.
- tailspin2019 5y agoLooks pretty interesting! On my cursory glance it doesn't seem to by obvious what flavours of scripts it supports, other than the JS examples. Is it restricted to just Javascript?
- ilrwbwrkhv 5y agoYup it is only (Type|Java)Script but it has a bunch of global functions which makes translating easy.
- tailspin2019 5y ago> A "sanity check" program for my internet connection to see if the problem is me, or Comcast It's funny, I've never thought of doing this, but now realise it would be quite handy. Not just for connectivity but also some quick bandwidth/latency tests, and perhaps even a few basic internal network checks too. The number of times I'm trying to troubleshoot Zoom calls these days... it would be handy to have a little bash script to run to rule out obvious issues. For my specific use case, a big one would also be a quick automated check for whether my primary network connection is Wifi or Ethernet since I swap between the two and often forget which I'm currently using (which can impact connection quality if it's not the one I intended).
- 7373737373 5y ago* A replacement front-end for "tar" and various compressors Could you elaborate on this? I feel like this is something that could save people hours of time. I'm so incredibly sick of the various decompression flags and tools, (de)compressing something on the commandline should be as easy as it is with a GUI.
- capableweb 5y agoI've memorized a total of two commands from decompressing things (`tar xfv $file` and `unzip $file`) and one for compressing (`tar cf $archive.tar $file1 $file2 $directory`) which seems to have done everything I've wanted for more than 20 years of unix usage. Is there something I'm missing out on? Sometimes, a `gunzip` or `7z` has been needed, but they are far apart that I can look it up each time. I'm not sure how I can save hours of time as non-tar or non-zip files is not something I often come across.
- d21d3q 5y agohttps://xkcd.com/1168/ https://xkcd.com/1168/
- zvr 5y agoIf you're using GNU tar, there are four short options to specify compression/decompression: -Z for compress, -z for gzip, -j for bzip2 and -J for xz. Using long options, you can specify --compress, --gzip, --bzip2, --xz for the same, or even --lzip, --lzma, --lzop or --zstd for others.
- IYasha 5y agoThat's exactly why people hate tar/UNIX generally. Tons of parameters that don't EVEN CLOSELY represent their purpose. For example: -j -J if noone told me, I'd assume they were "join" or "jump", or something. PS: zcvf zxfv, and, - surprise, surprise! - by default tar deletes source archive!
- yesenadam 5y agotar czvf "create ze vucking file" tar xzvf "extract ze vucking files" source: https://news.ycombinator.com/item?id=18909789 https://news.ycombinator.com/item?id=18909789
- deleted 5y ago[deleted]