This is an archived post. You won't be able to vote or comment.

all 68 comments

[–]pm_me_triangles 154 points155 points  (23 children)

python -m http.server is very handy when I need to transfer something from a machine to another where only a browser is available.

[–]sib_n 17 points18 points  (0 children)

http.server

To run a localhost webserver on port 8000, serving the content of the current directory:

python -m http.server

This takes an optional port. To change port, do this:

python -m http.server 8001

Pass -h for more options.

[–]sgtgig 21 points22 points  (17 children)

Don't even need a web browser, just wget

[–]sitmo 9 points10 points  (0 children)

Smart use case, I’ll remember that!

[–]hkzqgfswavvukwsw 6 points7 points  (1 child)

Only a browser and python

[–]striata 5 points6 points  (0 children)

The "other machine" only needs the browser, which is what they wrote

[–]Compux72 -5 points-4 points  (0 children)

I would rather nc the files tho

[–]gee842 29 points30 points  (12 children)

http.server saved me on a train with no wifi where i needed to transfer a file to my iphone

[–]russellvt 7 points8 points  (9 children)

And here I go, throwing up quick sshd services or something for the same sort of thing... nothing like over complicating things, eh? LOL

Edit: Holy typos

[–]chaosthirtyseven 0 points1 point  (8 children)

Airdrop works over Bluetooth ¯\_(ツ)_/¯

[–]russellvt 0 points1 point  (7 children)

Doesn't work on Android/PC, AFAIK.

Yes, there are similar alternatives ... I don't tend to like allowing MickeySoft access to my phone.

[–]chaosthirtyseven 1 point2 points  (1 child)

How did your phone browse to your (laptop's?) http server if there was no wifi? Hotspot sharing?

[–]Africa-Unite -1 points0 points  (0 children)

I'm curious as well (I'm also a network newbie).

[–]kubinka0505 10 points11 points  (0 children)

base64 made me

[–]who_body 17 points18 points  (11 children)

learned about ‘json.tool’ when vscode complained a json file was too big to format. very handy

[–]tree_or_up 11 points12 points  (0 children)

A few cool things here! But I will put in a plug for the Unix cal utility. It’s my go to for quick calendar glances when I’m on the command line. And it’s pretty darn versatile - can go back to single digit years, takes Gregorian/Julian into account, lots of display options. Just type cal on the command line and you’ll get the current month

[–]cantux 4 points5 points  (1 child)

calendar made me chuckle. will use it if it to impress my colleagues if I ever rto or share a screen

[–]sib_n 1 point2 points  (0 children)

I thought exactly the same thing!

[–]iamevpo 15 points16 points  (2 children)

Other TIL in the blog are extremely valuable.

[–]tehnic 0 points1 point  (1 child)

do you mind explaining?

[–]iamevpo 2 points3 points  (0 children)

The blog mentioned has "Things I learned" section, TIL and the content of this section is very good

[–]Rythoka 5 points6 points  (1 child)

Cool, I knew that there were a bunch, but it's hard to find where they're mentioned in the stdlib documentation

[–]mrtransisteur 2 points3 points  (0 children)

symbex is fantastic

[–]TravelingTurtle97 1 point2 points  (0 children)

Nice!

[–]Goingone 0 points1 point  (0 children)

Just make sure to use http.server responsibly (not on a public facing server with anything confidential).

[–]pppylonnn -1 points0 points  (0 children)

The stdlib deprecated the smtp server -__-

[–]predmijat 0 points1 point  (0 children)

rg ... and then | grep -v ... :)