News for hackers. Stuff that matters.
Re:Ntfy: A utility for sending notifications by y0ssar1an on Saturday August 27, 2016 @01:57AM (#12371214)
This already exists. It's called noti. It's cross-platform, supports most of the same backends, and can send Slack notifications (which ntfy can't). It also has an awesome API. You can put `noti` at the start of a command or `;noti` at the end, which is what I always do. I never remember to set the notification until after I've typed the command. If you forget to set the notification and the command is already running, you can call `noti -pwatch <pid>` and set notifications after the fact. It's very well thought out.

https://github.com/variadico/noti

Re:Ntfy: A utility for sending notifications by teraflop on Saturday August 27, 2016 @06:17AM (#12371769)
Bash tip: you can schedule an arbitrary command to run when the current command completes by suspending it with CTRL-Z, and then typing "fg; <CMD>".

(This doesn't seem to be documented specifically anywhwere, but it's implicit in the way bash's job control works.)

Re:Ntfy: A utility for sending notifications by riquito on Saturday August 27, 2016 @10:26AM (#12372467)
Which is identical to write "cmd; nextCommand"

E.g. sleep 2; echo it works

Re:Ntfy: A utility for sending notifications by mynegation on Saturday August 27, 2016 @12:44PM (#12373088)
I think the point of the tip was to show how it is done when process is already running and you forgot to add a command to be run immediately after
Re:Ntfy: A utility for sending notifications by buster on Saturday August 27, 2016 @03:40AM (#12371451)
Apart the fact that you sound like an advertisement for another software it takes just a few seconds to see that noti doesn't work on windows or with telegram for example. Not supporting a major OS is a big deal.
Re:Ntfy: A utility for sending notifications by voltagex_ on Saturday August 27, 2016 @09:46AM (#12372319)
I'm adding very basic Windows 10 (because notifications are ~50 lines there, many many more on older platforms) support.

Writing my first Go code was easier than packaging ntfy for Windows, FWIW.

Re:Ntfy: A utility for sending notifications by sneak on Saturday August 27, 2016 @10:08AM (#12372394)
Telegram is dangerous snake oil, and its use should be discouraged.
Re:Ntfy: A utility for sending notifications by krick on Saturday August 27, 2016 @12:07PM (#12372885)
Why? Lately my paranoia calmed down somehow, and I'm even considering to install it (I need to have some messenger, after all, and it doesn't make me feel as naked, as skype or whatsapp would). Care to make me reconsider?
Re:Ntfy: A utility for sending notifications by dmos62 on Saturday August 27, 2016 @04:05AM (#12371510)
Only if you are using that major platform.
Re:Ntfy: A utility for sending notifications by buster on Saturday August 27, 2016 @04:44AM (#12371597)
I don't use Windows, but Linux.
Re:Ntfy: A utility for sending notifications by curun1r on Saturday August 27, 2016 @04:58AM (#12371625)
You might also mention that it's Go instead of Python, which makes it a lot more friendly to users. I've stopped using anything written in Python since previous trips down that path have all seemed to result in pain and Google searches related to the runtime environment.
Re:Ntfy: A utility for sending notifications by pmontra on Saturday August 27, 2016 @05:55AM (#12371729)
For this kind of tool, where performances are definitely not important, I'll pick Python, Ruby and Node all the time. I assume that pip, bundle and npm already did their job and installed everything I need. Then I'm able to look at the code, change a few lines and run it again with only a text editor. The extra steps to download the source code and go through a compiler are not worth the trouble.
Re:Ntfy: A utility for sending notifications by etatoby on Saturday August 27, 2016 @09:20AM (#12372234)
On the other hand, a language & tooling that by default compiles to a static executable, such as Go, means no dependency trouble or installation steps at all, now or in the future. Just copy 1 file to all your machines and you have that command available.

If the software is open source, you can still change anything with your text editor and recompile the executable, usually with a single command (go build, IIRC.) Additionally, you can keep all the executables for all your versions and modifications.

Try to do that with Python, when the change you need is somewhere deep inside a library. At best you'll spend hours setting up multiple Virtualenvs; at worst it will just be impossible. Case in point, you can't use a Virtualenv for ntfy on OS X of you want desktop notifications (for whatever reason.)

Re:Ntfy: A utility for sending notifications by voltagex_ on Saturday August 27, 2016 @08:31AM (#12372064)
Today I dumped a not-insignificant amount of time into trying to package ntfy into a single exe on Windows (using PyInstaller. It sort-of works, but was way way more painful than it needed to be. Python packaging still sucks in 2016. Go is way ahead of Python in that regard, but comes with its own quirks (GitHub by default, always uses the HEAD version of libraries, GOPATH)
Re:Ntfy: A utility for sending notifications by pmontra on Sunday August 28, 2016 @01:12AM (#12375388)
I'm not familiar with PyInstaller but I wouldn't do anything similar with scripting languages. They are meant to be distributed as scripts so I'm not surprised it took you all that time. Why didn't you use pip to install on (I suppose) those other Windows machines?

There are similar problems with Ruby when people want to distribute executables. I remember I googled a solution that made a friend of mine happy (he had to deploy on multiple Windows machines, I don't remember what I suggested him to do) but still it's the wrong way to go. If creating a single executable is a hard requirement then yes, they are the wrong languages to solve your problem.

Re:Ntfy: A utility for sending notifications by voltagex_ on Sunday August 28, 2016 @01:59AM (#12375479)
I didn't use pip because the normal way to distribute applications on Windows is to use an exe, possibly with an installer.

Packaging Python on Windows has always been tricky.

https://github.com/larsch/ocra is the Ruby equivalent.

Re:Ntfy: A utility for sending notifications by echelon on Saturday August 27, 2016 @10:19AM (#12372437)
No way! A static binary is infinitely easier to deploy, patch, and maintain. Especially across systems.

Python, Ruby, and Node are becoming less popular for a reason.

Re:Ntfy: A utility for sending notifications by dschep on Saturday August 27, 2016 @11:52PM (#12375221)
This the first I've heard of noti, looks cool tho.

Ntfy does many of these things too, for example A coworker had suggested the PID option so it has that too :)

I mostly use the shell-integration that automatically sends notifications for commands taking longer than 10 seconds (if the terminal isn't focused).

Re:Ntfy: A utility for sending notifications by proofmaster on Saturday August 27, 2016 @05:13AM (#12371657)
I have to agree that Noti is way better.
Re:Ntfy: A utility for sending notifications by heydonovan on Saturday August 27, 2016 @02:14AM (#12371245)
I've always just used mail to send a text for notification:

./long_running_script.sh && mail -s "Script Done!" [email protected]

Re:Ntfy: A utility for sending notifications by justinsaccount on Friday August 26, 2016 @11:36PM (#12370827)
Neat, I've been working on a similar tool, but I've been trying to make it not require a 3rd party service for cross machine notifications.

I've been testing things out like udp multicast and zyre.

mobile notifications are tricky, looks like one can use https://developers.google.com/web/updates/2015/03/push-notif..., but that still technically piggybacks over google cloud messaging.

Re:Ntfy: A utility for sending notifications by danudey on Saturday August 27, 2016 @01:57AM (#12371211)
It adds another dependency, but you could always try Avahi/Zeroconf. Good for service discovery on a local network.
Re:Ntfy: A utility for sending notifications by voltagex_ on Saturday August 27, 2016 @01:16AM (#12371123)
The problem I have with that is I then have to run yet another app on my phone. I want to run less apps, not more (especially on Android, where running an app seems to mean it can use any amount of battery it wants).

When my subscription to PushBullet runs out I'll be experimenting with PushOver. It's Growl all over again, but not quite as good.

Edit: Ntfy looks like exactly what I want. I do really like the idea of notifications that stay within my LAN, or are under my direct control. Now that I have SSL on my home server, I should be able to use Chrome notifications to Android (but isn't GCM involved there somewhere anyway?)

Re:Ntfy: A utility for sending notifications by dschep on Sunday August 28, 2016 @12:05AM (#12375260)
I ran into this the other day but had trouble getting the server to run: https://f-droid.org/repository/browse/?fdfilter=notification...
Re:Ntfy: A utility for sending notifications by tymm on Saturday August 27, 2016 @07:59AM (#12371977)
Funny to see this on HN since I just released an Android App called Simplepush (https://simplepush.io) which qualifies for what Ntfy calls a backend.

Let's see if they accept a PR to list me as an additional backend :)

Re:Ntfy: A utility for sending notifications by dschep on Sunday August 28, 2016 @12:03AM (#12375251)
Yup! I'll review it when I'm not sleepy :)
Re:Ntfy: A utility for sending notifications by dtjohnnymonkey on Saturday August 27, 2016 @01:40PM (#12373324)
On OS X I usually do 'cmd && say "files done" || say error'
Re:Ntfy: A utility for sending notifications by _RPM on Friday August 26, 2016 @11:30PM (#12370809)
How did you get your phones display on your desktop?
Re:Ntfy: A utility for sending notifications by snehesht on Friday August 26, 2016 @11:40PM (#12370838)
I'm not the author but If I have to guess, author must have recorded the phone screen ( using something similar to https://play.google.com/store/apps/details?id=com.hecorat.sc... ) and desktop screen, overlapped the phone screen video onto the desktop using video overlay feature during post production.
Re:Ntfy: A utility for sending notifications by mashlol on Saturday August 27, 2016 @12:23AM (#12370963)
Could have also possibly been an emulator.
Re:Ntfy: A utility for sending notifications by dschep on Saturday August 27, 2016 @11:54PM (#12375225)
Bingo
Re:Ntfy: A utility for sending notifications by chrisper on Saturday August 27, 2016 @01:53AM (#12371203)
You can use adb to screenrecord. (I have never tried it though)

https://developer.android.com/studio/command-line/shell.html

EDIT: I think this actually does not answer your question. Sorry.

Re:Ntfy: A utility for sending notifications by rsaworks on Saturday August 27, 2016 @01:57AM (#12371213)
You can use Vysor which mirrors android screen on desktop.

https://chrome.google.com/webstore/detail/vysor/gidgenkbbabo...

Re:Ntfy: A utility for sending notifications by bcook on Saturday August 27, 2016 @08:28AM (#12372057)
Are you sure that's his phone and not Android Studio's Android Emulator (https://developer.android.com/studio/run/emulator.html)?
Re:Ntfy: A utility for sending notifications by dschep on Sunday August 28, 2016 @12:06AM (#12375263)
That was my Nexus 5x. The computer was a VM tho.
Re:Ntfy: A utility for sending notifications by dschep on Saturday August 27, 2016 @11:54PM (#12375224)
I didn't. Recorded videos on both the phone and the computer(a VM actually), then put it together with.. I don't remember what. Some video editor available in the Ubuntu repos.
Re:Ntfy: A utility for sending notifications by captn3m0 on Saturday August 27, 2016 @08:53AM (#12372143)
I am looking for a tool that sends me webhooks for events that happen on my phone. (Idea is to pre-process SMS message that I get and show me priority notifications via Chrome or other means).

Anyone knows of something that does this? (Android)

Re:Ntfy: A utility for sending notifications by tymm on Saturday August 27, 2016 @10:29AM (#12372480)
I think pushbullet does that.
Re:Ntfy: A utility for sending notifications by hossbeast on Saturday August 27, 2016 @12:50AM (#12371054)
I was hoping to see a framework for getting notifications in the shell, like in the screen / tmux status bar.
Re:Ntfy: A utility for sending notifications by dapithor on Sunday August 28, 2016 @10:40PM (#12379648)
You can already do this with `write` which is in most linux distro's. Make sure `mesg` is set to y then test with `echo "hello" | write <username>`. `Wall` messages all logged in users and I wouldn't recommend that approach.
Re:Ntfy: A utility for sending notifications by snehesht on Saturday August 27, 2016 @01:27AM (#12371144)
You could try a script that receives notifications and then prints them inside the status bar.

Tmux has refresh interval so you could easily setup a script that prints the notification for a while and then clears it.

set -g status-right "#[fg=colour010]#(/path/to/your/script)#[fg=colour255]"

Re:Ntfy: A utility for sending notifications by qznc on Saturday August 27, 2016 @02:41AM (#12371300)
You could use "wall", but that is not limited to a status bar and just prints in the terminal.
Re:Ntfy: A utility for sending notifications by mxuribe on Saturday August 27, 2016 @10:16AM (#12372424)
Seems pretty cool!
Re:Ntfy: A utility for sending notifications by posixpwn on Saturday August 27, 2016 @05:35AM (#12371697)
The fact that it doesn't support major OS is a bummer
Re:Ntfy: A utility for sending notifications by dschep on Saturday August 27, 2016 @11:55PM (#12375227)
How so? It runs on Mac OS, Linux and Windows.