With so many uses for a Raspberry Pi in a headless configuration – especially with the impending release of the Raspi Model A – we’re surprised it has taken so long for someone to send in a way to create a custom message of the day that is displayed whenever you SSH into everyone’s favorite Linux board.
A MOTD is used by servers to display messages to new users, or simply system information for server admins. It’s a simple text file stored in /etc/motd, but with some proper beardly Unix wizardry it’s possible to display uptime, free memory, and even the weather wherever the Raspi is located.
[yanewby] over on the Raspberry Pi forums created a nice little MOTD that grabs weather data from the Internet and displays it alongside an ASCII rendering of the Raspberry Pi logo. Of course like everything in Unix, this MOTD can be modified to do just about anything, from checking your Twitter to sending a text message to your phone.
Jesus, all time low.
I low how the NAT address is blacked out.
Just read the link and my god, I thought the guy was at least using update-motd!
http://wiki.debian.org/motd#How_to_script_updates_to_your_.2BAC8-etc.2BAC8-motd
http://manpages.ubuntu.com/manpages/precise/en/man5/update-motd.5.html
The top link will explain how to properly implement dynamic MOTDs on debian.
I’ve tried this method, but I can’t get /var/run/motd to use colouring.
Any ideas?
Post the script(s) yo!
pastebin it or something.
If you’d rather not post all the code just how you’re trying to get colour.
This guy is using tput to set colours and reset the display you can also use echo with colour codes.
Try this link for examples.
http://tldp.org/LDP/abs/html/colorizing.html
must be a hack, because it runs on an rpi! true! u cant do normal things on this crazy hackable device!!!!
Newbie level stuff, Unix guys have been doing this for decades.
People who are not you i take it.
This made me remember this:
http://www.youtube.com/watch?v=h1-hrethX4c
Next up: a series of articles about changing desktop backgrounds.
You must do this under Linux to be taken seriously.
Didn’t realize hackaday was moving into Linux For Dummies territory. Tomorrows RPi hack: how to colorize your directory listings as default.
BTW the script cannot show temperatures below zero…
OK, I don’t usually cry too much about “not a hack!”, but changing the MOTD banner? Really?
I also like how the image has the local IP obfuscated (as someone mentioned in the comments). Watch out, I might try to login to 192.168.1.1 over the internet. :rolleyes:
Somebody should register a webname as 192.168.1.1.com, find his IP and forward to it!
Same feelings here. The comment section can be full of unwarranted negativity but the criticism today is far from groundless.
This isn’t a hack, it’s a bad tutorial for a menial script that tries to emulate motd/ssh banner.
Good freaking god. I think this is too much right there.
I love how people blur out their local IP address so they don’t get “hackerrrred”
I see how this guy knows about Networks, hiding his private IP-Address like a madman :D
Off topic to the NAHs (Not A Hack):
I think the ASCII version of the Raspi logo looks like Micky Mouse.
Mouse of the Day?
Will tomorrow be Mighty Mouse?
Indeed it does look like a fat Mickey :D
Nothing new, XBian uses the same trick to launch a custom setting menu when logging into ssh
All time low HaD!
This is not only NOT A HACK, but it’s done THE WRONG WAY!
this guy puts the script in ~/,bash_profile instead of /etc/motd, EPIC FAIL!
Hate to add my first Notahack in the years I’ve been reading this but.., This is stuff we mastered when I started learning Unix (System V, yeah!) when I was 16. That back-quote is some clever stuff! But yeah, using shell-scripts and the STANDARD SYSTEM FUNCTION that is motd… If it’s in the manual (ha! ha!) then it’s not a hack!
Definitely one of the worst things HaD has ever run.
Wouldn’t have thought many people will be ssh’ing into the model A?
I think I’ll submit a tutorial on using cowsay instead of motd, that will blow everyone’s minds!! I’ll even obfuscate my uptime so no one can hax0r me!
Better yet, I think I’ll file my RPi down to a razor edge and throw it at the moron who greenlighted this “hack”. At least that takes some skill and effort.
Is HaD sponsored by the RPi foundation? Seriously, less useless RPi posts like this one, please.
This is indeed low. Pavement-level low :(
It would be handy if Hack-a-Day would add some sort of Not-a-Hack voting feature, which would force them to reconsider the particular “hack” when clicked enough times. Echoing the other commenters, The ASCII-art raspberry is nice, but hardly HaD-worthy, and the rest of the hack is done poorly and far from original.
+1
Nnnnnnnneeeeeerrrrrdddddsssss!!!!
Seriously Hackday is supposed to be a community. Quit infighting. Just because you think this is a low level hack doesn’t mean you should piss all over it. If you’re a so called Nix expert why wouldn’t you want low level people to be able to learn from the hackaday resource?