Hacker Newsnew | past | comments | ask | show | jobs | submit | adder46's commentslogin

I wanted to share a very small traceroute implementation I wrote using Python. It is asynchronous and it supports probing over UDP or ICMP. It was a good networking exercise.


dpaster-rs is a UNIX-style command-line client interface for the dpaste.com.

If you often need to share code or output of some command in a pastebin, this tool will lift some of the burdens from your back. It reads from stdin by default if no file argument is passed, meaning it perfectly fits a UNIX-style workflow. It is configurable and easy to use. Check out the README for examples on how to install it and how to use it:

https://github.com/adder46/dpaster.rs

Any critiques regarding improving the code quality, architecture, or functionality, are more than welcome.


I wanted to share my attempt at implementing the classic tetris game. It works in the terminal and uses the ncurses-rs bindings for the UI part. For me, the coolest part about it is that the tetrominos and their rotations are encoded as 16-bit unsigned integers. For example, to represent a square, we want 51! Why 51? Because 51 decimal is `0b0000000000110011`. We can make 4x4 Vec from that, and we get:

``` [[0, 0, 0, 0], [0, 0, 0, 0], [0, 0, 1, 1], [0, 0, 1, 1]] ```

Notice how the 1s form a square?

As I'm still learning Rust, any suggestions regarding the architecture, overall design of the game, more idiomatic code, etc., are very welcome.

If you want to play or just see how it turned out, check out:

https://github.com/adder46/tetris.rs


Look up for tetrisconcept.net and theabsolute.plus discord ( https://discord.gg/6Gf2awJ ). Several people have made attempts to recreate sophisticated clones of Tetris, and the absolute plus leader board is written in rust.


Does representing tetrominos that way make hit detection or anything like that easier? My gut says the only thing they add is slightly smaller memory usage, but maybe i'm missing some sort of elegant bit trick.


I entered `twitter.com`, it says invalid URL.


If I enter `https://twitter.com/`, it gets cut off.


Hmmmm this is weird, the metadata scrapper seems to have issue with twitter, it seems to work fine with any other websites I tried...

I'll check asap and try to fix it :) Thanks for the report


pyhstr is a history suggest box for Python shells. It lets you quickly access the commands in your shell history. Just search for the command you want to execute (regex mode is supported), or, if you don't exactly know what you're looking for, you can browse through the commands until you find the one you want to execute. Apart from this, you can delete unwanted items from your history, too, and more. It works on all terminals ranging from linux term to alacritty to xterm. It was initially made for the standard Python shell but it should work with IPython and bpython, too.

It has been my daily driver for a while now.

Check out the README for instructions if you want to try it out.

Suggestions, bug reports, etc. are welcome.

Let me know what you think:

https://github.com/adder46/pyhstr


hstr-rs is a shell history suggest box that provides quick access to the commands in your shell history. Just search for the command you want to execute (regex mode is supported), or, if you don't precisely know what you're looking for, you can browse through the commands until you find the one you want to execute. Apart from this, you can delete unwanted entries from your history, too, and more. It should work on all terminals ranging from linux term to xterm. It was initially made for bash but it should work as well with zsh, ksh, and tcsh, too.

I use it on a daily basis.

Check out the README for instructions if you want to try it out.

Suggestions, bug reports, etc. are welcome.

Let me know what you think:

https://github.com/adder46/hstr-rs


Small mistake in the readme

> hstr is shell history suggest box. Like hstr, but with pages.

Should be "hstr-rs is shell..." I presume?

Looks like a nice project :) I'll give it a go. I've often wanted to iterate through options when ctrl-r ing in bash (not saying there isn't a way to do that, but if there is I don't know it)


This looks really cool, I’m going to try it out — by the way, what app/tool did you use to record the screencast?


Since I spend a lot of time on IRC and I often need to share something in a pastebin, I wrote a little script to help me with that process and lift some of the burdens from my back. It's called dpaster, and it's actually a command-line client interface for the dpaste.com pastebin. It's configurable and easy to use. It reads from stdin by default if no file argument is passed, which means you can use it as a part of some UNIX pipeline. It can even guess syntax to highlight (limited to pygments' guessing ability ¯_(ツ)_/¯).

Check it out and let me know what you think:

https://github.com/adder46/dpaster


I'm downloading a release from Github and the download speed does not exceed 50KBps. So, I investigated a bit what was going on and I stumbled upon the linked reddit thread. It seems that Github and Microsoft prioritize connections from the US, thus discriminating the rest of the world. Very disappointing for such a huge corporation.


v0.1.4 - added bpython support


pyhstr is history suggest box for the standard Python shell. It also works with IPython.

This app lets you quickly search, navigate and manage your Python shell history.

Various issues were fixed, should be pretty usable now.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: