Live data from Hacker News

Ask HN: Tools you have made for yourself?

news.ycombinator.com

341–350 of 458 posts

Re: Ask HN: Tools you have made for yourself?

#341
post #37

I am currently learning SQL/Python, I often just wanted to know the headers and how many rows are in a CSV file, so I just wrote a small Python script for it. import csv import readline readline.set_completer_delims(' \t\n=') readline.parse_and_bind("tab: complete") def csvOpen(file): with open(file, "r", newline='', encoding='utf-8-sig') as csvfile: reader = csv.reader(csvfile) i = next(reader) dRows = sum(1 for lin…

This can be done using two lines of Bash - `head -n 1 ` to get headers - `wc -l ` to count number of rows

I was thinking about using bash, but couldn't come up with a solution to use tabcompletion when I'm in a different directory than the CSV file I want the data from, so I don'need to change directory.

Re: Ask HN: Tools you have made for yourself?

#342
post #89
post #37

I am currently learning SQL/Python, I often just wanted to know the headers and how many rows are in a CSV file, so I just wrote a small Python script for it. import csv import readline readline.set_completer_delims(' \t\n=') readline.parse_and_bind("tab: complete") def csvOpen(file): with open(file, "r", newline='', encoding='utf-8-sig') as csvfile: reader = csv.reader(csvfile) i = next(reader) dRows = sum(1 for lin…

what does sq in sqhead mean?

Well, it actually doesn't "mean" anything. I just needed to come up with an alias for the command, so I wouldn't need to type it out all the time.

Re: Ask HN: Tools you have made for yourself?

#343

This isn’t anywhere near as impressive as some of the examples here, but anyway: I run an Etsy store that sells artwork. One of the most time-consuming tasks was creating the mock-ups for product listings, so I wrote a shell script that used Imagemagick to automatically generate all the images. I was pretty pleased as I’d never written a Bash script before and it saves hours and hours of work. I also wrote a Ruby scr…

Nice I like the Etsy Ruby + Jekyll idea. Is the repo open source?

Re: Ask HN: Tools you have made for yourself?

#344

It seems like a toy compared to most of the other tools in this thread, but FWIW I have a little script I call "did": grep "$1" ~/.bash_history | tail It just shows me the last ten commands that include a search term. E.g. "did foo" shows the last ten commands that include "foo".

This is going straight into my bash_aliases. Thanks!

Cheers! :)

Re: Ask HN: Tools you have made for yourself?

#345
I created bunch of scripts that allows me to spin up a full 3 node mongo server with interfaces and webui. Creates daemons to monitor everything and restart when crashing, auto-renews certificate for lets-encypt and spins up a json server with basic crud apis ... starting a new project takes 30 mins but it saves me sooo much time debugging why things are not coming up as i wanted

Re: Ask HN: Tools you have made for yourself?

#347
During covid, I wrote a tool that takes the avg daily infection rate in my county, makes some rough assumptions about incubation time, time-to-transmission, duration of contagion and asymptomatic rate, and tells me the probability of someone with covid having been in the supermarket down the street within the past few hours (based on capacity and traffic data of people in the market).

It wasn't usually very reassuring, but it felt better to see a number than just go in blind.

Re: Ask HN: Tools you have made for yourself?

#349
post #215

I wrote an in-terminal histogram tool[0] because... that's when/where I always need histograms. [0] https://github.com/wizzat/distribution

This is the best thing since sliced bread, but it doesn't work for me on a recent Ubuntu. Tried with both Python 2 and 3. Compare: $ sudo du -sb /etc/* | sort | uniq | sort -rn | head -10 2897355 /etc/brltty 436966 /etc/java-11-openjdk 402728 /etc/ssl 251196 /etc/apparmor.d 244732 /etc/ImageMagick-6 219185 /etc/X11 170093 /etc/fonts 144084 /etc/java-8-openjdk 131407 /etc/init.d 117524 /etc/systemd With: $ sudo du -sb…

Try visidata.org

https://jsvine.github.io/intro-to-visidata/basics/summarizin...

Re: Ask HN: Tools you have made for yourself?

#350

I created bunch of scripts that allows me to spin up a full 3 node mongo server with interfaces and webui. Creates daemons to monitor everything and restart when crashing, auto-renews certificate for lets-encypt and spins up a json server with basic crud apis ... starting a new project takes 30 mins but it saves me sooo much time debugging why things are not coming up as i wanted

Awesome. Can you open source this?
Post reply on HN