Shellcheck: a static analysis tool for shell scripts - <AUTHOR> http://www.shellcheck.net/ <comment><USER2> Just spent some time sending my scripts to this site for it to analyse and see what it does. I can see that while it wasn't be able to tell me of more efficient code to achieve my goal (wasn't really hopping for that), it did spot 1) one liners where some commands are not needed, 2) variables which are not used, 3) where I should use double quotes to prevent word splitting and 4) lines where my ssh was eating up my stdin.

What a great sanity check for the days when I'm writing something on my own without a second pair of eyes to proof-read it.

</comment><comment><USER3> Combine it with the sublime text plugin ([https://github.com/SublimeLinter/SublimeLinter- shellcheck](https://github.com/SublimeLinter/SublimeLinter-shellcheck)) and you got real time static analysis while without your shell scripts !

</comment><comment><USER4> Shellcheck is great. The Vim Syntastic plugin already knows about Shellcheck so if you use Syntastic and install Shellcheck you'll automatically start getting warnings on your code.

BTW, it can be a little hard to figure this out, but if Shellcheck gives you a warning that you want to ignore (because you intended to trigger that behavior), you can put the following comment above the offending line:

      # shellcheck disable=SC1234

where "SC1234" is replaced with the actual error code that Shellcheck gives.

</comment><comment><USER5> This looks very helpful: bash scripts are notoriously difficult to get right. I wish it'd suggest best practices like `set -e` and the like though.

<comment><USER6> The jury's still out on whether `set -e` is worth it.

On paper it sounds like it's equivalent to `on error goto 0`, making a script fail-fast -- which would have been awesome.

Instead, it makes a script fail sometimes for things that are sometimes errors. The rules for how and when are unexpected and unintuitive, several weird cases are described on [http://mywiki.wooledge.org/BashFAQ/105](http://mywiki.wooledge.org/BashFAQ/105)

If enabling it just granted a free 50% chance of stopping on any given error, it would have been worth it, but it triggers on false positives as well.

<comment><USER7> Well, dealing with horrible exception handling is still better than just silently running off the edge on errors.

Much like any language, you need to read and understand it to be able to truly write, I think. bash is deceptive in this regard IMO, due to how low its barrier to entry is.

Now if you want to see some truly horrible code, implement a shell script that runs in bash and zsh and does exception printing in both.

</comment></comment></comment><comment><USER8> The real problem with shell scripts is that they usually tie together a few external commands and tend to pass information around using the filesystem.

This, together with poor error handling is a recipe for disaster: Problems with permissions, insufficient disk space, etc. Instead of stopping when encountering an error, most shell scripts will happily continue break at some other point in time (or worse - destroy valuable data).

</comment><comment><USER9> The emacs interface is very nice as well, using flycheck

</comment><comment><USER10> I ran it against a deploy script generated by Mina [1]. Only a few deprecation warnings and notes about using find instead of ls to better handle non- alphanumeric filenames. I've learned a lot about error handling by reading Mina-generated scripts.

1\. [http://nadarei.co/mina/](http://nadarei.co/mina/)

</comment><comment><USER11> Isn't this a pretty good argument against shell scripts? I feel like we've advanced far enough in PL research to think of something a bit safer

<comment><USER12> Time for advertisement! You might like elvish [https://github.com/elves/elvish](https://github.com/elves/elvish) which proudly has optional typing and much more well-defined semantics than say, bash. This is work in progress though.

Advertisement aside, there is some inherit unsafety in shell scripts that cannot be easily resolved, namely the unsafety involved in interacting with external commands.

Compared to other scripting languages, the greatest advantage of shell languages is the convenience of interacting with external programs. However, at least in Unix, there are few static constraints you can apply to them. Everything we know is that the program will (probably) parse something in argv which are just bytes, (probably) take something from stdin which are just bytes, and (probably) put something to stdout which are again just bytes; there is no universal method to check that the commands arguments are well- formed, or the input format is correct, or the output format conforms to a certain schema without running the actual program. A solution is to define some kind of static protocols for external programs so that their invocations can be statically checked, but it's already too late.

<comment><USER11> I think a decent solution is to have a shell alternative that defines interfaces for known programs (much like autocomplete scripts do now).

I know ls returns a list of files, so I should be able to use that. I don't know foo, so it's basically string -> string or whatever, but if an entrepreneuring spirit does know about foo, he could write an abstraction layer for it.

The trick is making a simple interface for that

<comment><USER13> Also there's a question about whether you can properly deal with option hell. Parsing every possible output of ls reliably in the face of malicious filenames sounds...fun.

Edit: It's really impossible to avoid edge cases. Take find: you can't parse it, because it's just a list of filenames separated by \n. But filenames can contain just about any character. How do you handle /home/bar\n/tmp?

Maybe you just ignore pathological input, but now you're regressing towards the state of bash.

<comment><USER12> Option hell is indeed a problem.

The problem with `find` happens to have a solution (-print0). However it is a PITA in deal with \0-separated strings in traditional shells, unless you pipe it to another command that happens to recognize \0-separated strings.

With elvish you can parse the \0-separated strings outputted by `find ... -print0` into a genuine _list_ \- not lines (which are \n-separated strings) or \0-separated strings, but real lists that support indexing, iteration, etc. and there is absolutely no chance that two consequent items will run together or one item will be treated as two. Imagine how fantastic it is to deal with that :)

</comment></comment></comment></comment></comment><comment><USER14> As someone who regularly answers batch file questions on Stack Overflow, I think this would be invaluable for all the mistakes people make there too.

</comment><comment><USER15> This is awesome. As a beginner when it comes to writing shellscripts, this is my new jshint equivalent.</comment>


Travel tool - <AUTHOR> https://traista.com/2018/05/15/local-spots-while-traveling <comment><USER2> This is very cool, I am in the travel industry and I love the fact that you can search local deals and places. Sweet.</comment>


Ask HN: New site feedback ('ideas for things to do' - using RoR, EC2, AJAX, CC, API, etc) - <AUTHOR> http://smynx.com

<comment><USER2> I really dig the the design of the site, the logo is pretty rad.

The one thing I noticed is how Y looks like a hand and is giving the "two finger salute" to the little guy flying in the parachute, it made me chuckle, but no one will really notice :) see: <http://en.wikipedia.org/wiki/V_sign>

EDIT:(your site has something about a UK business, so you're probably familiar with it, I'll leave the link for others)

</comment><comment><AUTHOR> Ta!

Yeah, the logo (and most of the design, in fact) was done by an amazing Russian design company: <http://www.turbomilk.com> \- I think they added the 'v sign' to make it more playful!

</comment><comment><USER3> That design rocks. Curious, how did you get in touch with a Russian company, and how was it working with them?

<comment><AUTHOR> I think I was looking through a flickr group of 'great web design' or something similar (e.g. <http://flickr.com/groups/webdesign-inspiration/>) and found their site mentioned on it. We got in touch, and it went from there.

We found it a pleasure to work with them. I should point out that it wasn't a case of cost - there wasn't _that_ much difference between them and companies based in the UK/US - the choice was purely down to their creativity.

We communicated throughout the project via Basecamp, and found they very quickly got 'what we meant' when we asked for changes or things to be done in certain ways. We've worked with tens of design agencies over the last 10 years (mostly face-to-face), and turbomilk were probably one of the easiest we've worked with! It helps that they seem to be nice guys too, who genuinely love design. I think you get a sense of that from their website.</comment></comment>


Sherbet: An Ergonomic Gaming Keypad - <AUTHOR> https://www.billiam.org/2019/05/29/sherbet-an-ergonomic-keypad <comment><USER2> This is a pretty novel use of the low-profile Choc switches. I like it.

QMK supports ARM very strangely, but the more I think about it, the more I like it. They use ChibiOS as an RTOS to basically schedule USB code alongside QMK, and then they get ChibiOS's USB support for free. (Note that on many of these ARM chips, the USB is actually handled in hardware; you just need to get the right bytes into the right memory addresses at the right time. You don't have to be awake at the exact instant to toggle a USB pin at exactly the instant the protocol demands. So it works quite well; ChibiOS is not preempting your matrix scan at random times or anything.)

Having said that, I think it's reasonable to write your own firmware. QMK feels very very legacy right now. It is hard to use modern dev tools to work on the code (like clangd), and the newer chips are supported in a very janky manner because of assumptions made for the original AVRs that it ran on. I always thought it was weird that the boards that OLKB use are among the most jankily-supported, even though they fund the development of QMK. They also don't really maintain all of the in-tree examples, so you'll copy someone else's outdated keyboard code and be starting with code that barely works. (I made an STM32F103-based keyboard recently, and the example code actually has their own debouncing algorithm, rather than calling QMK's newish built-in debouncing algorithm. So you get latency by default, although it hasn't bothered me at all so I haven't fixed it.)

The model of flashing firmware to change the key layout also seems crazy to me, in an era where you can easily enumerate as a flash drive and just drag a JSON-encoded keymap onto it to adjust the layout. (Or just edit it live, a la CircuitPython.) I watch new users of QMK-based keyboards struggle and give up on a somewhat regular basis. Seems strange to me.

<comment><USER3> > The model of flashing firmware to change the key layout also seems crazy to > me, in an era where you can easily enumerate as a flash drive and just drag > a JSON-encoded keymap onto it to adjust the layout. (Or just edit it live, a > la CircuitPython.)

Are there any keyboards that have that functionality? I know Logitech allows you to save macro key info to the hardware. However, last I saw that was only for specific macro keys, not all keys like QMK.

<comment><USER2> There aren't but someday I plan to write one.

QMK does already save some things into "EEPROM" (more realistically, flash on the MCU), like whether you've enabled NKRO, which LED pattern is selected, etc. Because it's opaque, it ends up just being another trap for the inexperienced. "I pressed a key and now my keyboard doesn't work." Yup, that can happen thanks to the magic of persistent storage.)

I think the reason QMK doesn't use flash for keymaps is because it was simply designed before that was within the capabilities of the hardware it ran on. My Ergodox firmware just barely fits in the 32k of available flash on the 32u4, for example. But a STM32F103 has twice or 4x that much flash, so there is much more room to breathe and add creature comforts.

(You can also use USB mass storage to flash devices, see UF2: [https://github.com/microsoft/uf2](https://github.com/microsoft/uf2). It's so much better than DFU or all the hacks Arduino uses.)

</comment></comment></comment><comment><USER4> Saw this alternate entry device announced at CES:

[https://www.charachorder.com/](https://www.charachorder.com/)

SelfieType, using a camera to watch your fingers, looks even more futuristic:

[https://www.androidauthority.com/samsung-selfie-type-demo- vi...](https://www.androidauthority.com/samsung-selfie-type-demo- video-1071955/)

<comment><USER5> Charachorder looks like a modern attempt to produce something similar to the Datahand (availability was always limited, and the company has gone defunct by now): [http://www.atpm.com/7.05/datahand.shtml](http://www.atpm.com/7.05/datahand.shtml)

The biggest issue with these devices is the huge learning curve upfront. You need to invest a lot of time to get to a point where the productivity / speed claims get true.

I learned Dvorak many years ago, and I would never switch back to a more traditional layout, but I'm not sure I would recommend it to anybody in general.

<comment><USER6> There actually is a modern (almost) equivalent of the DataHand called the Azeron gamepad [1], and there are some DIY 3D printed DataHand replicas too [2][3].

If you want to type really fast (>200 WPM) and don't mind a VERY steep learning curve, then getting a $95 Georgi keyboard [4] and learning steno [5] is probably the way to go.

[1]: [https://www.azeron.eu/](https://www.azeron.eu/)

[2]: [https://github.com/JesusFreke/lalboard](https://github.com/JesusFreke/lalboard)

[3]: [https://geekhack.org/index.php?topic=41422.0](https://geekhack.org/index.php?topic=41422.0)

[4]: [https://www.gboards.ca/product/georgi](https://www.gboards.ca/product/georgi)

[5]: [https://www.youtube.com/watch?v=Wpv-Qb- dB6g](https://www.youtube.com/watch?v=Wpv-Qb-dB6g)

</comment></comment></comment><comment><USER7> Heh. Not one picture of his hand actually using this thing. "Oh, someone might want to see if it works?" Gotta love that pure technical mindset.

<comment><USER8> The picture would mostly be a hand obscuring anything under it. I am not sure how that would be useful?

<comment><USER9> a couple of additional pictures would be useful. right now I don't haven't got an idea how to hold it. fun fact, I went to youtube what Logitech G13 is and the first video that has anyone holding it is not even in top results.

<comment><USER10> What do you mean? You don't hold it, it's a keyboard. You put your left wrist on the wrist rest, thumb on the joystick.

<comment><USER11> That's what they mean, using it.

</comment></comment></comment></comment></comment><comment><USER6> It's good to see these smaller gaming keyboards getting more common. I never got why people who play low mouse-sensitivity games like CS:GO use full-size keyboards that limit the space they have available for a big mousepad.

An imo more interesting ergonomic gaming keyboard is the Azeron [1]. It's based on the old DataHand keyboards (which were way ahead of their time) and I hope that this kind of ergonomic layout becomes more common. I don't own one myself (I use a HHKB Pro 2), but not having to move your hands at all when typing seems pretty comfortable.

[1]: [https://www.azeron.eu/](https://www.azeron.eu/)

<comment><USER12> Counterstrike pros do a lot of things that seem weird at first, like playing low resolution 4:3 on a 16:9 monitor, with black bars on the sides. That seems ridiculous until you consider that they don't actually need that extra field of view (since if an opponent catches you looking away, you'll lose), and it makes player models larger on screen.

As far as keyboards, I believe most of them are using full size keyboards, not even tenkeyless, because they need the number pad for buy binds. Also, many of them rotate their keyboard slightly clockwise. I'm not exactly sure why, but it does get rid of ulnar deviation as well as take up less room on the desk.

<comment><USER6> >Also, many of them rotate their keyboard slightly clockwise. I'm not exactly sure why, but it does get rid of ulnar deviation as well as take up less room on the desk.

The reason I've always heard for that is that desk space on LAN tournaments used to be pretty limited so they had to rotate their keyboards like that in order to fit them, and now they're just doing it out of habit. And I get that buy binds are convenient but it doesn't seem worth the extra desk space, especially not when there are many other unused keys that can be used for buy binds instead.

</comment></comment></comment><comment><USER13> I tried the Razer Nostromo a while ago, while the idea looked nice, I couldn't get used to it and it ended up collecting dust somewhere

<comment><USER14> Huh. Your comment resonated with me, but confused me a bit as I had a 'Nostromo' Gaming Keypad too, but I knew it wasn't from Razer, so had to go check...

Turns out the one I had - a Belkin Nostromo N52 - was at some point replaced by an equivalent from Razer, but 'made betterer' ( [https://support.razer.com/gaming-keyboards/razer- nostromo/](https://support.razer.com/gaming-keyboards/razer-nostromo/) ).

Your one looked a lot better than my one, covered in dust somewhere as they both now are!

(image of Belkin Nostrom N52:) [https://i.ebayimg.com/images/g/tBsAAOSwvgheGmiG/s-l225.jpg](https://i.ebayimg.com/images/g/tBsAAOSwvgheGmiG/s-l225.jpg)

<comment><USER15> I have a Razor Nostromo too, and I remember at some point I discovered it was Belkin hardware (perhaps in the name of some driver). I believe Belkin licensed it to Razor.

I was gifted one because I asked for a separate keypad for gaming. Problem is, I am left-handed and the model I got is for _normal_ people. Yet it was quite convenient, I have been using it for years, as testifies its poor state. A few years ago, some games couldn't handle keypad keys properly (facking normies...), so the fully configurable keys of the Nostromo did the trick. I simply couldn't use the directional pad and the other thumb operated buttons as-is (used them for rarely used stuff instead - it's still better than reaching out for the keyboard).

</comment></comment></comment><comment><USER16> Never mind gaming – with some slight modifications (like some thumb buttons), two of these mirrored could make a very nice work keyboard, with the joysticks replacing the mouse + two scroll wheels.

<comment><USER17> The design is based upon keyboard like that.

See the Dactyl and Dactyl Manuform.

Adding the joysticks shouldn't be as difficult as designing the whole thing from scratch.

[https://github.com/adereth/dactyl- keyboard](https://github.com/adereth/dactyl-keyboard)

[https://github.com/abstracthat/dactyl- manuform](https://github.com/abstracthat/dactyl-manuform)

</comment></comment><comment><USER18> Nice use of Kailh's Choc switches. I wish there were other keycap options out there for them though. It's such a shame that injection moulding is so expensive to get off the ground.

<comment><USER19> Weirdly enough, there's a groupbuy closing out soon for PBT Choc keycaps. It's taken forever but it's getting there. [0]

[0] [https://www.gboards.ca/product/mbk-group- buy](https://www.gboards.ca/product/mbk-group-buy)

<comment><USER18> Oh wow! Thanks for sharing, I'll probably join up.

</comment></comment></comment><comment><USER20> Just a heads up, it looks like the link to your article "Customizing the Logitech G13" in the first paragraph is broken

</comment><comment><USER21> Respect to the person making it. I love ergonomic mechanical keyboards, but I have 0 skills to make them, so I've paid several hundred dollars to the EZ company for their Ergodox/Planck keyboards. Love both to death though.

Wish I could improve my electrical skills enough to actually make one of these from scratch.

<comment><USER22> As someone with zero formal electrical education and have built multiple keyboards, it really is easier than it looks. Just a decent soldering and a build guide us all you need.

Now, designing the PCB or hand-wiring (lik in the OP) is obviously a bit more involved. However, the most complicated circuitry is just a diode matrix. It really is that easy.

Edit: not to take away from the OP -- his build is definitely impressive and time-consuming. But if you're thinking of designing and building your own keyboard, the concepts are quite simple.

</comment></comment><comment><USER23> I recently received my Dygma Raise [1] after backing on Kickstarter and also beta tested their proof-of-concept tech, the "Shortcut". Their old version used a thumbstick but abandoned it after feedback; I was a little disappointed but they opted for switching the space into four separate keys which I find pretty good as an alternative.

Very glad these kinds of devices are gaining attention. At worst, a better gaming experience. At best, tackling RSI and allowing us to type/game for longer.

[1]: [https://www.dygma.com/](https://www.dygma.com/)

</comment><comment><USER24> I'm not a gamer so I'm having a hard time visualizing how this thing is intended to be used. Is this for your left hand?

[UPDATE] Based on a link in another comment I went to this site:

[https://www.azeron.eu/](https://www.azeron.eu/)

It's really weird. Every image shows a device that looks like it is intended to be used with your left hand, except for one tiny image of someone actually using the thing. In that image, they are using it with their right hand, and the device in that image looks like a mirror image of every other image on the page. WTF?

<comment><USER6> It is for your left hand since most gamers use the WASD keys for movement. Here's a video of a similar design being used to play Quake. [https://www.youtube.com/watch?v=xyVSANPnLlg](https://www.youtube.com/watch?v=xyVSANPnLlg)

[EDIT] The Azeron comes in both right- and left-handed versions so that's why some images show a right hand. The Azeron works similarly to one half of a DataHand keyboard.

This old infomercial shows how they're used [https://www.youtube.com/watch?v=T7UajuYCIyk](https://www.youtube.com/watch?v=T7UajuYCIyk)

<comment><USER24> Thanks.

> most gamers use the WASD keys for movement

What are they doing with their right hand? (Hm, something tells me I'm going to be sorry I asked ;-)

<comment><USER6> Mouse is always in the right hand and that's used for aiming (in shooter games at least). Typically left click is fire and right click is aim-down-sights.

</comment></comment></comment></comment><comment><USER25> Does it actually work though? What I've found is that the positioning of the forearms and where the weight of the arm rests tends to be the most important thing about avoiding wrist pain.

</comment><comment><USER26> I've always wanted one of these kinds of devices for gaming. Unfortunately they're never made for left handed people. I understand how that's the case for such niche accessories, but when I see a brand like Razer not having keypads, it just means ~15% of gamers can't use the device.

<comment><USER27> Probably a bit fewer than 15%; I write left handed but comfortably game with my right hand.

<comment><USER28> I imagine it must be not too hard to learn to use either hand. I started a new job and got given a shit mouse which caused me wrist pain and I found I was able to use the left hand until I went and got my own mouse. It was a bit awkward at first but after a few hours I felt I was 90% as good as I was with the right hand.

<comment><USER29> I remember many OS had "mouse button handedness: right/left" option in the 90s while there never were "left handed keyboard" in the history.

<comment><USER17> There are several left handed keyboards (from a quick web search), with the number pad and navigation keys on the left.

I don't see any with the Enter key to the left of A.

There are still left-handed mice, and OSs still include the option to switch around the buttons. I have a mouse on either side (on Linux), with the one on the left using flipped buttons.

</comment></comment></comment></comment></comment><comment><USER30> I'd actually like to buy that.

</comment><comment><USER31> Wow!! Looked like a lot of fun.. Hows the durability?

</comment><comment><USER32> My g13 has recently started playing up. I'm just switching to keyboard. :/

<comment><USER33> I used to use a Belkin N52 then an N52TE. My current gaming keyboard is a Razer Orbweaver Chroma ([https://www.razer.com/gaming-keyboards-keypads/razer- orbweav...](https://www.razer.com/gaming-keyboards-keypads/razer-orbweaver- chroma)) which I'm pretty happy with - the mechanical switches are good, although the extra row of buttons seems a bit superfluous.

<comment><USER34> After my G13 started acting up I got myself a Razer Tartarus V2 and honestly I'm disappointed to the point I feel like I need to warn people. If you buy Razer, make sure you can return it if you're disappointed.

First the Tartarus V2 has issues with several MMOs where keys will get "stuck" and based on googling this has been an issue with other Razer products for 5+ years. While some may have been fixed Tartarus V2 still has the issue 2 years after release.

Second, the Razer Synapse software pack suffers from gamer marketing bloat and requires you to have a razer account to even allow configuring your device.

<comment><USER33> The razer account thing is absolutely ridiculous, I agree. What is worse is it keeps trying to update and has broken more than once (I have a keyboard too, and both were set up with different versions of synapse and I don't want to have to redo my config).

If they go bankrupt or if I lack a net connection, the hardware stops working. Super annoying.

As for the Tartarus keys sticking - was that because it had membrane keys? Or was it software? The orbweaver has mechanical and is the main reason I bought it over the Tartarus.

<comment><USER34> I think it is software, or at least it can be fixed in software. Which is what makes it so frustrating.

My workaround is to configure the whole thing as a joystick then use JoyToKey to convert it back to keyboard inputs. No stuck keys.

</comment></comment></comment></comment></comment><comment><USER35> Wow, hadn't heard of Meshroom before, amazing functionality.</comment>


Building a URL shortener with GraphQL/Graphcool, React-Apollo and Netlify - <AUTHOR> https://divu.in/jamstack-url-shortener-graphql-22dda2b576cf <comment><AUTHOR> OT: pardon the typo, HN shows 'shortener with' when I edit and removes the space in the title.</comment>


The Hawkeye Is the Adhesive, Eye-Tracking Phone the Internet Asked For - <AUTHOR> http://www.npr.org/sections/alltechconsidered/2017/01/05/508026494/the-hawkeye-is-the-adhesive-eye-tracking-phone-the-internet-asked-for?utm_source=facebook.com&utm_medium=social&utm_campaign=npr&utm_term=nprnews&utm_content=20170105 <comment><AUTHOR> I can't imagine how this eye tracking feature would work for complex actions, for example how much can your eye accomplish? Didn't Samsung do this a few years ago?</comment>


Ask HN: moving beyond screen to persist SSH sessions? - <AUTHOR>

I work from my laptop, and my laptop is constantly moving between my home, cafés, libraries, schools, etc.  I have SSH windows open and I want them to simply stay open and work all the time.  I want the session to automatically persist changes in wireless networks, temporary lack of network connectivity, putting my laptop in suspend, etc.  I also want my SSH-forwarded ports to keep being forwarded as long as I'm connected to the internet.   It's such a huge pain to constantly re-login to all my SSH windows on every minor blip of connectivity.
Is there any way to accomplish this in any OS?  Every time I have posted this problem elsewhere, everyone shouts "screen!" but I think the HN audience understands that while screen is cool, it doesn't even come close to resolving this issue; so I'm hoping for a better answer here.
To give an example of my problem:
Let's I have 5 SSH windows open doing various things (perhaps I am running top, emacs, a window that i'm using to type svn commands, etc).   I also have port-forwarding set up so that I can use Firefox securely through a SOCKS proxy, and access websites that are only available from behind the SSH machine.
If my wireless network switches or even drops for 1 second, I now have 5 dead SSH sessions.   I have to somehow reinitialize them, and when I do it's a mess to get them back in the correct state.   I can solve the latter with screen.  How can I solve the former automatically, without wasting time re-establishing those connections? <comment><USER2> To fix constantly re-logging in to ssh: \- set up key authentication and run ssh user@host with your favorite parameters in a loop (shell script) so it reconnects when disconnected. \- in fact, have it run screen when connected, so you get right back to where you were effortlessy.

As for port forwarding, you will still be disconnected from everything on connectivity blips when ssh has to reconnect if you use ssh port forwarding. Try a VPN setup instead. You might have to fiddle with the host to keep it from sending RST's/FIN's as soon as you drop (though it shouldn't unless a packet for you comes in during the blip, I think). When you come back, if you come back soon enough, the connections should be restored without having been disconnected. (AS LONG as you have the same IP address on the VPN, so use a static IP setup)

Also, if you run your SSH -through- the VPN connection and recover quickly enough SSH shouldn't disconnect at all either.

More Edit: For long connectivity lapses (changing locations) all your TCP connections -will- drop. This is not something you can work around.

<comment><AUTHOR> Thanks for your response. Just to clarify, I don't care if my forwarded TCP connections drop when my internet connection drops, just that they are re- established automatically. I also don't care about the actual TCP connection dropping, I just want all my SSH terminals to automatically pick up where I left off. Of course screen factors into this, but it has to be more than just screen.

Regarding the VPN, could this connection be automatically established upon joining a wireless network? (i think you see where i'm going with this question)

<comment><USER3> I don't think it's any more complex than running screen on the server, using SSH keys to allow you to connect to the server without a password, and possibly orchestrated with a small script that checks network connectivity and re-establishes your session after it's broken. Your 5 shells are running in one screen session on the server, so you don't have to restart all of them. It's just a simple "screen -D -R". If there is no existing screen session to attach to, you can have screen automatically create your sessions via the config file.

This is pretty much what I do already, except that I don't switch connections as frequently as you. But when I go to a new place, it's just connect with ssh and reattach with screen.

</comment></comment></comment><comment><USER4> That depends. Can you mess around with the server? If so you could install HIP [1][2][3] on both client and server as a way of providing IP mobility. Basically the way it works is it inserts a layer between the routing and transport layers (called the shim layer), which handles mobility. The transport layer gets a locally significant identifier that uniquely identifies the connection on that host. This remains persistent even after the IP address changes. The shim layer then notices when you've got a new IP address and alerts the other host or notices when the other host has stopped responding for a while and waits for it to make contact again. You'll probably also need access to a DNS server that you can update on the fly, since HIP resolves HITs (HIP identifiers) to IP addresses via DNS. This isn't by any means a production solution, but if you're willing to try it out I'd love to hear how it works out for you :) Also the third reference explains how it works far better than I did.

[1] <http://www.openhip.org/>

[2] <http://en.wikipedia.org/wiki/Host_Identity_Protocol>

[3] <http://infrahip.hiit.fi/>

</comment><comment><USER5> To solve your problem just use ssh -o TCPKeepAlive=no restOfYourCommandGoesHere

From the ssh_config manpage:

"TCPKeepAlive

Specifies whether the system should send TCP keepalive messages to the other side. If they are sent, death of the connection or crash of one of the machines will be properly noticed. However, this means that connections will die if the route is down temporarily, and some people find it annoying.

The default is ``yes'' (to send TCP keepalive messages), and the client will notice if the network goes down or the remote host dies. This is important in scripts, and many users want it too.

To disable TCP keepalive messages, the value should be set to ``no''."

<comment> a-priori While that may improve the situation, it won't help if your IP address changes during the outage.

</comment></comment><comment><USER6> Not quite what you are asking for but it would solve the problem:

1\. Get an Android.

2\. Hack it and install the debian subsystem.

3\. see: <http://brad.livejournal.com/2400054.html>

So now instead of running an ssh to a remote server you are running an ssh to your android which then hosts all of the outward ssh sessions. Because of the androids 2g/3g you can't lose your connection (well not easily).

<comment><USER7> I truly feel sorry for you if your cell phone has a more stable internet connection than a desktop.

<comment><USER6> Cellphones: always connected to cell towers. Conneciton isn't great but its almost always there.

Laptop: network changes as you move from one wifi hotspot to another.

I'm advocating moving his ssh connections to route through the android rather than directly from the laptop to the server.

</comment></comment></comment><comment><USER8> For port forwarding, I use autossh (<http://en.wikipedia.org/wiki/Autossh>) to keep my IMAP and SMTP tunnels alive.

</comment><comment><USER9> As a very meta aside, this is the sort of Ask HN posting that really deserves to be on the front page. If you're reading this whole thread and you think it's interesting; please be sure to upvote the story so we can all set a good example.

<comment><AUTHOR> Thanks; I was actually concerned that my question might be inappropriate because it's a sort of "help me!"/tech support type question. I tried unsuccessfully to find a FAQ which explains what types of questions are appropriate, but couldn't find anything so I just posted anyway. I figured if it wasn't ok, it wouldn't get voted on; so no harm done.

</comment></comment><comment><USER10> The completely unrealistic way to solve this problem would be with Mobile IP:

<http://en.wikipedia.org/wiki/Mobile_IP>

But I don't know if that has ever really been used outside of a research context.

</comment><comment><USER11> I think it might be the change of ip adress that is killing your connectivity. I can close the lid of my macbook running os x or linux, let it fall to sleep, go down to the porch outside and let the machine wake up from sleep and still have the ssh connection active.

A thing you can do to get more stable ssh connections on your side is to run a nat service on the machine. For example, running connections on a OS X machine that has parallels installed (virtualization software) and that runs NAT is far more stable than a machine without.

</comment><comment><USER12> A VNC or RDP session running on a stable host somewhere, running full screen on your laptop, so you only have one thing to reconnect to.

What you want would be cool but it can't be done with TCP/IP.

<comment><AUTHOR> VNC would be painfully slow, though.

 _it can't be done with TCP/IP._ It surely _can_ , but would have required someone to figure it out. Surely a combination of an SSH client which reconnects (and therefore temporarily remembers your password/key) with screen might do it. But I'm hoping someone has been in the same situation and has figured out a somewhat elegant solution.

<comment><USER12> You'd get bogged down in retransmit backoff before you knew it!

</comment></comment></comment><comment><USER13> You have to run your screen session from a stable host, not a laptop that gets disconnected all the time. Do you have a web host with ssh access? A buddy with a VPS somewhere? A spare $5 a month to spend on a shell account host to never have to deal with this again?

You could try using ssh-agent to reduce the pain of your connectivity issues, but screen really is the answer.

<comment><AUTHOR> I have plenty of access to shell accounts. But using a shell account to screen to another host just adds another layer of complexity, because when I lose my wi-fi connectivity for 1 second, then my SSH session to the _shell_ account is lost instead of access to the real host. It still requires a waste of time logging into the _shell_ account.

<comment><USER14> I think you may be constraining the solution down into impossibility. When you lose the network, you will lose the SSH sessions. Period. TCP will guarantee that. (Although not at "one second".) That's part of TCP's point.

The best you can hope for is either to set some stuff up as described so SSH automatically relogins to a screen session, or find a better network connection. Fundamentally, you can't patch around a bad network connection.

<comment><AUTHOR> Hmm, I think I just mis-stated my problem as being more difficult than it really is. I posted an example to the question for clarification.

</comment></comment></comment></comment><comment><USER15> Chcek your SSH configuration. By default SSH using some kind of ping system where, if the client loses contact with the server, the server closes the session. However, you can turn this off, or you can adjust the timing parameters to handle unreliable connections. I did that when I had a horrible connection (from the other side of the world) and it always worked fine.

</comment><comment><USER16> When you start a local shell, you can generate some session identifier (export DURABLE_SESSION=$RANDOM) and put it in your environment. Then have your ssh client send it to the server with "-o SendEnv DURABLE_SESSION".

One question is when does sshd know when to ditch interrupted sessions.

<comment><USER17> You can always manually interrupt an SSH (or Telnet) session using the following key sequence:

        <Enter><Tilde><Period>

This sequence is caught by the SSH client to force a session disconnect.

<comment><USER16> You are of course correct, but that's not related to what I'm getting at.

My question raised the point that the server would not be able to tell the difference, after an interruption, between session state that the client will hope to resume and session state that should be discarded. That state would accumulate until some routine cleared it out.

</comment></comment></comment><comment><USER18> On Windows, I use Bitvise Tunnelier and the SSH tunnels/connections always keep retrying if there's a disconnect. For the terminals, I just use screen so I can get right back to what I was doing, but it is annoying to lose all those consoles if I had a bunch open.

</comment><comment><USER19> Several people have mentioned running ssh in a loop. Here is an example of that:

[http://www.commandlinefu.com/commands/view/357/ssh-tunnel- wi...](http://www.commandlinefu.com/commands/view/357/ssh-tunnel-with-auto- reconnect-ability)

</comment><comment><USER20> Rocks sounds ideal, but it's not maintained. <http://pages.cs.wisc.edu/~zandy/rocks/>

</comment><comment><USER21> autossh + key auth is probably what you want: <http://www.harding.motd.ca/autossh/> . Added to screen it's a very nice combination.

</comment><comment><USER22> I have this exact same problem. I don't forward traffic through SSH but I run a service that has almost 30 servers. Sometimes I have connections open to 10+ of them, sometimes (shudder) all of them. When my connection dies I want to throw my computer out the window.

I haven't read the comments here yet but hopefully someone will have at least a partial solution to save my sanity :)</comment>


Build a realtime liveblog with RethinkDB and PubNub - <AUTHOR> http://rethinkdb.com/blog/rethinkdb-pubnub/

<comment><USER2> Using a locally-hosted database to send a realtime feed up to a remote Pubnub server to have Pubnub send data back down to your visitors seems unnecessarily complex.

There are plenty of standalone websocket (relay) servers if your language of choice doesn't implement Websockets well. Also if you're using nginx, you have built-in modules like pushstream that can handle it from the nginx side.

Considering the biggest selling point of RethinkDB is to provide realtime updates faster than other solutions, putting Pubnub is not just slowing the real-time system down but adding extra monetary cost.

<comment><USER3> Most of the demos that we publish at RethinkDB use Socket.io or some other similar WebSocket abstraction layer, catering to cases where the user wants to fully host the entire application from end to end.

But scaling a Socket.io application is not trivial, there are users who want a hosted solution for realtime streams so that they don't have to worry about their application falling over if they get too many simultaneous connections.

Granted, the case in the blog post is perhaps a bit contrived. But consider, for example, a scenario where you take a single page web application, deploy it to a CDN, and have all the realtime traffic that it accommodates routed through PubNub's infrastructure. You could make it so that no traffic is hitting your own servers, and you are just broadcasting updates into the PubNub stream from your RethinkDB-based backend. That would be pretty trivial to scale.

And in terms of the speed at which the messages are routed, for the purposes of a liveblog or something of that nature, pushing everything through PubNub isn't noticeably slower than using Socket.io.

Of course, nobody's saying that you should always use PubNub. As I said, we often use Socket.io ourselves. But I do think there is legitimate value in presenting it as an available option.

<comment><USER4> > But scaling a Socket.io application is not trivial, there are users who want > a hosted solution for realtime streams so that they don't have to worry > about their application falling over if they get too many simultaneous > connections.

PubNub employee here, I agree, this is the reason.

> And in terms of the speed at which the messages are routed, for the purposes > of a liveblog or something of that nature, pushing everything through PubNub > isn't noticeably slower than using Socket.io.

We aim for 1/4 second global latency (averaging 151ms currently [http://status.pubnub.com/](http://status.pubnub.com/)).

Great demo!

</comment></comment></comment><comment><USER5> While I love technical articles such as this it saddens me there is always a gap providing a working example. All code an no visuals mean most people won't try it. Please give us a URL to play with, or at minimum, animated gif to see this. I often find this with well written technical articles, open source projects, etc. Folks are excited to go over code detail but never show us the _demo_. You'll get more uptake since the hard work is already done!

<comment><AUTHOR> Hello :) I work on the community team at RethinkDB and we're working with PubNub to host a meetup here in the bay area where we'll do a live demo and presentation of this blog post. We record all the talks, too, so hopefully we'll get this going sometime soon. Definitely understand where you're coming from though.

<comment><USER5> Hey right on, thanks for that. It's a great read and can't wait to see it in action :)</comment></comment></comment>


Ask HN: Cheap Physical servers?  - <AUTHOR> Trying to find a cheap physical server for a project, any ideas? Here's what I want:
- (EDIT) $700-1000 price -1-2 U rackmount or desktop form factor - No nodes or anything fancy like 2 PSU's -Reliable, fairly powerful components -Able to run linux
EDIT: I'm trying to start a hosting startup, and want my own servers.
EDIT: Thanks everyone so far, still have not found anything perfect yet, though. <comment><USER3> Your best bet is to hit up one of the various resellers. These guys, like Northbay Netoworks in the Bay Area, buy up unused and distressed assets from companies and then resell them on the open market. They will hit up someone like me when we have 100 - 150 "old" servers we want to get rid of, and someone like you when you want to buy a "couple of racks worth" of servers to try something out. Servers that are 4 - 5 years old can be had for $400 - $500 per server caveat they may or may not have memory in them. (which is a problem if they take DDR2 memory which is no hard to find).

Conversely there are places like auctionbdi.com which liquidate old buildings and will sell a pallet worth of old servers for $50 - $500 but you really need to go there first to look at them to get a good estimate of how many are recoverable out of the stack. Often times you'll be able to create maybe a dozen "good" servers out of a stack of 50 "liquidated" servers of identical or nearly identical type.

The post liquidator market is a place like "Weird Stuff Warehouse" (sunnyvale) which buys pallets of stuff and pulls out the resalable stuff into their shops.

If you want exactly 1 machine then a card on the bulletin board of a hacker space saying what your minimum requirements are is a good investment, you can often get one machine for free from someone who is trying to get rid of an old machine (I've "donated" several machines that way)

And of course you can create a virtual machine on an existing desktop and just play around with concepts before you get physical hardware.

<comment><AUTHOR> Useful info, thanks.

</comment></comment><comment><USER4> Find a supermicro reseller and build your own.

Back in the days when I ran my own servers (before virtual machines were so easy and cheap -- and I'm talking 10 years ago) all my servers were supermicro cases (and sometimes motherboards), and bought all the other components individually.

Definitely cheaper than a HP or whatever server.

<comment><USER5> I've had really good experiences with Amadi Systems as a Supermicro reseller. [http://amadisystems.com/](http://amadisystems.com/)

I've stopped buying Dell/HP entirely now, because the price of Supermicro's stuff is so much better and you don't get into warranty arguments like you do with HP about running non-approved OSes.

<comment><AUTHOR> I'll check them out, thanks.

</comment></comment></comment><comment><USER6> Do you mean dedicated servers? Hetzner, which is based in Germany, has some very inexpensive dedicated server plans:

[http://www.hetzner.de/en/hosting/produktmatrix/rootserver](http://www.hetzner.de/en/hosting/produktmatrix/rootserver)

</comment><comment><USER7> If I were you, I'd take a moment to reconsider just how crucial it is at this stage to have your own servers. I've been in a similar position before, and as appealing as the notion may seem, it's going to create a lot of work that while immediately fulfilling, isn't going to be really moving your product forward.

<comment><AUTHOR> I'm creating a hosting company, like Heroku and can't be hosting my customers stuff on another company's servers, thanks for the advice though. Also there are some cheap $99 servers that might get the job done.

<comment><USER8> FWIW, Heroku uses AWS.

<comment><AUTHOR> Also, would it not be inefficient to virtualize a virtual machine on a virtual machine?

<comment><USER8> If you're planning on using virtual machines, then potentially yes.

<comment><USER9> As far as I know, AWS doesn't allow running a hypervisor inside another hypervisor.

<comment><USER8> Ravello [1] seems to do this with with VMWare and xen-blanket[2] claims to allow running Xen on AWS.

[1] [http://www.ravellosystems.com/](http://www.ravellosystems.com/) [2] [https://code.google.com/p/xen-blanket/](https://code.google.com/p/xen- blanket/)

</comment></comment></comment></comment></comment></comment></comment><comment><USER10> Here are some links:

[http://eracks.com/](http://eracks.com/)

[http://unixsurplus.com/](http://unixsurplus.com/)

[http://www.newegg.com/Server- Barebones/SubCategory/ID-8](http://www.newegg.com/Server- Barebones/SubCategory/ID-8) (Add CPU/RAM/HD and you're all set)

</comment><comment><AUTHOR> I mean real physical hardware, like an HP server you buy and setup yourself.

<comment><USER11> At your pricepoint, you're looking a white-label reseller; There's no margin at a full-sized server for 600$, so there's not a lot of interest in selling them.

I'd go back to why you believe you need a physical server and re-evaluate.

<comment><AUTHOR> I'm ok with used, and the current suggestions have been more than helpful, although I took your advice and changed the price range to $700-1000.

</comment></comment></comment><comment><USER12> Saw this over at slickdeals... [http://slickdeals.net/f/6883520-dell- poweredge-t20-intel-has...](http://slickdeals.net/f/6883520-dell- poweredge-t20-intel-haswell-pentium-g3220-3ghz-server-w-4gb-memory-and-500gb- hdd-249-free-shipping)? ...Add some more RAM and it might work for you and save some $ to boot.

</comment><comment><USER13> Perhaps try an HP N54L, less than $300 (with no drives, but can hold 4). It's a little boxy 'tower' with good build quality.

[http://www8.hp.com/uk/en/products/proliant- servers/product-d...](http://www8.hp.com/uk/en/products/proliant- servers/product-detail.html?oid=6280790)

</comment><comment><USER14> I have a few Dell servers from a previous startup that were racked for about a year, and been in storage since. I'm in San Francisco. Let me know if you're interested in anything, and we can figure out prices.

        Dell PowerEdge R415
          16GB memory
          (2x) Processor, 4180, 2.6, 6MB, Opteron *16 cores total*
          250GB 7200rpm Western Digital Drive

        Dell PowerEdge R210
          8GB memory
          Processor, X3450, 2.66/4.8, 8MB, Xeon Unitary Lynnfield, B1
          (2x) 250GB 7200rpm Western Digital Drives

        (2x) Dell rack rapid rails (slide out). Super nice.

I also have a Dell 24 port PowerConnect 2824 switch as well, specs at [http://www.dell.com/us/business/p/powerconnect-2800/pd](http://www.dell.com/us/business/p/powerconnect-2800/pd)

</comment><comment><USER15> What you need is white label hardware suppliers. In US, look at Supermicro, Silicon Mechanics, etc. I believe there a few others, a google search on white label server providers should yield you a few hits.

Also consider looking up on Alibaba and see if you can find a server manufacturer in China or Taiwan.

</comment><comment><USER16> Given your lack of experience with hardware, I am not sure this is the business for you.

<comment><AUTHOR> I have experience with more high-end systems, but my budget is small.

</comment></comment><comment><USER17> I'm using a Dell C6100, on recommendation from [http://www.servethehome.com/](http://www.servethehome.com/) :

[http://blog.printf.net/articles/2014/02/10/dell-c6100-xs23-s...](http://blog.printf.net/articles/2014/02/10/dell-c6100-xs23-sb- server/)

Serve The Home forums are going to be the right place to look for specific deals. [http://forums.servethehome.com/index.php](http://forums.servethehome.com/index.php)

<comment><USER18> The price of those servers have gone up unfortunately. I got one for dirt cheap when they first hit ebay. Also, those puppies are loud.

</comment></comment><comment><USER19> We used to OEM HP ProLiant DLs at my last gig. Great hardware. The new DL320e starts at $579 list, so will definitely fit within your price point:

[http://www8.hp.com/us/en/products/proliant- servers/product-d...](http://www8.hp.com/us/en/products/proliant- servers/product-detail.html?oid=5379527)

If you plan to buy a few of these, definitely give their OEM / enterprise sales guys a call - they give very good discounts off list (based on volume, of course).

</comment><comment><USER20> So - it depends a bit on your purpose - if you just need a linux box, with no particular performance constraing, a Raspberry Pi might do. For a bit more performance, ODroid is nice - <USER2> [http://www.hardkernel.com/main/main.php](http://www.hardkernel.com/main/main.php). ~$200 at the high end. You can of course add some storage via USB. For a serious server machine - the above recommendations may be plausible.

</comment><comment><USER21> At first i would suggest you buy a VPS ( [http://virpus.com/](http://virpus.com/) ) Begin with a VPS and not with your own physical servers. The competition is large and your investment might not pay off. With just one server you can handle 100 costumers at ease so start with a VPS and see how business will go and then buy your own servers.

Hope that helps. Let me know

<comment><AUTHOR> I'll be host VPS's so it would be inefficient, thanks though.

<comment><USER16> You don't need your own hardware. There are literally thousands of colo server providers that will rent bare metal machines, you can put any virtualization tech you want on these. Lots of VPS providers run on say hertzner or similar.

</comment></comment></comment><comment><USER22> Try Great Lakes Computers. they sell HP/Dell Blades and Rackmount. I have bought from them couple of times for 20-40% of the price of the new Server.

[http://www.glcomp.com/products/servers/dell- poweredge/blade-...](http://www.glcomp.com/products/servers/dell- poweredge/blade-servers)

</comment><comment><USER23> Some collocation facilities have their own servers you can pay a little more for usually around $100 to 120 a month with everything you need and root access to completely control the server.

I like dedicated servers even though the world is going to the cloud, a dedicated server gives you control over your costs.

<comment><AUTHOR> I'm trying to start a hosting startup, and feel it would be out of the question to use a provider for my use-case.

<comment><USER23> For a hosting start up I would suggest getting a massive server and paying for it by an equipment lease. Personally I manage two racks full of servers and if I had a magic wand it would be awesome just to have one or two big servers. (64 gigs of ram, lots of 2.5 drives, 4 or 6 processors)

Right now co-location providers are desperate because Amazon and others are taking away a lot of their business so you can get a good price.

I have a friend (manages his own servers) who has a hosting business and he brings in enough to be happy, about $10k a month. He hosts ASP and .NET sites with no marketing budget he just posts to various forums and website hosting comparison sites.

I really like Supermicro servers and Dell Servers.... Supermicro makes some really big servers that you can add your own components to and I find them very reliable. For a friend some years ago I put together a $24k server and they paid for it with a business lease through Bank of America.

I used to own the domain ehosting.com and tried doing hosting but it just isn't my thing. Getting everything to work for a people was far more work then I expected. If I were to try again I would just offer virtualized servers and not have any hand in customers setups.

Having a specialty in hosting I believe is important. For example for $14.95 a month from GoDaddy I have an account with unlimited space and unlimited domains. I have hosted about 30 domains and 24 gigs of files all for $14.95. I also have a virtualized server from GoDaddy for $39.95 a month which I use a coupon code and save about 20% off a month.

<comment><AUTHOR> Thanks, but I prefer small, cheap 1U's because this first server is just a test run/demo, and also because it's easier to scale.

<comment><USER24> "A hosting company" is a vague thing to want to setup, at the low-end you can have a single rack with random boxes in it.

But to scale you need to consider running an AS, peering, redundant feeds, PSUs, having remote access to reimage machines, etc, etc.

So rather than saying you want to be a host you'd get better response0s if you said what kind of hosting person you want to be? Random wordpress? Giving remote root on virtual machines? (Whats your antispam policy? How will you monitor incoming/outgoing bandwidth? What kind of routers will you use? What network topology to increase uptime? How many geographical locations?)

Lots of people started hosting companies back in the day by filling racks with servers, before power costs made it hard, and these days reselling AWS, etc, is the simplest way to start - no need to worry about infrastructure, and still reasonably reliable.

</comment></comment></comment></comment></comment><comment><USER25> [http://www.unixsurplus.com/](http://www.unixsurplus.com/)

<comment><AUTHOR> A nice option, thanks!

<comment><USER25> Welcome. Never had any issues with their gear.

</comment></comment></comment><comment><USER26> Can you also post at [http://www.webhostingtalk.com/](http://www.webhostingtalk.com/), almost every major host and independent resellers/hosts are there and few years back I was able to find excellent server for just $90

</comment><comment><USER27> OVH.us.

It is a French company. I worked with them when I was in France and it was awesome.

They recently opened a datacenter in canada and they are the cheapest hosting company I've ever seen.

I currently have 10 physical servers there and I have had no problems so far, except maybe their crappy user interface...

</comment><comment><USER28> I've got (2) 1U Tyan B2881G28U4H servers with Dual Opteron 270 processors, ram, and 15k scsi drives.

I shot you an email to see if you're interested. Bought these a while back and they've been sitting in a closet ;(

Cheers

</comment><comment><USER29> This depends completely on what you're trying to do. Does it need to be rackmountable? How many sockets? How many drive bays? For under-a-desk usage (eg, somewhat quiet)?

</comment><comment><AUTHOR> Sub-question for everyone: on some of the links people posted there were great deals, but the server's had DDR2 RAM, would performance be decreased significantly?

<comment><USER30> This benchmark [1] shows little difference between DDR2 and DDR3 running on enthusiast hardware. DDR3 runs at a lower voltage which is supposed to result in some power savings, especially critical in most server applications, but their benchmark showed little difference in power consumption as well. Multiply the difference out by typical server memory configurations and it might be more significant.

[http://www.xbitlabs.com/articles/memory/display/ddr3.html](http://www.xbitlabs.com/articles/memory/display/ddr3.html)

</comment></comment><comment><USER16> ebay. [http://www.ebay.com/sch/i.html?_trksid=p2047675.m570.l2632.R...](http://www.ebay.com/sch/i.html?_trksid=p2047675.m570.l2632.R2.TR2.TRC1.A0.H0.Xsunfire+x4600&_nkw=sunfire+x4600&_sacat=175698&_from=R40) look for sunfire x4600 stuff. Very standard with lots of upgradability and headroom.

</comment><comment><AUTHOR> Hmm...This post just disappeared from the front page and the ask section, any ideas why?

</comment><comment><USER31> EBay.</comment>


Zen Photon Garden - <AUTHOR> http://scanlime.org/2013/04/zen-photon-garden/

<comment><USER2> I'm amazed that this runs wholly on the CPU. Seriously tempted to build a WebGL demo using similar concepts, with the addition of lenses and other optical geometry. It'd be tough to beat this in terms of the sheer cool factor, though.

</comment><comment><USER3> Great work! I just managed to create a godly looking "lolcat" - <http://www.bit.ly/ZKtfnS> ;)

If create any closed shape (using lines set at 100% reflective) around the light source, it seems to stop working so nicely. Are the rays just being reflected around in an infinite loop?

</comment><comment><USER4> > If it gets popular, I'd love to create an iOS app. The web site works on iOS > in a minimal capacity, but it's slow and not at all fun to use. Sculpting > with light on the iPad seems like a natural fit.

Why not instead make it animate to music and turn it into a good old Winamp or XMMS plugin? :)

</comment><comment><USER5> I wonder what an actual artist could do with this. I was able to make a hallway by playing with perspective: [http://zenphoton.com/#AAQAAkAB9gCNlAAKAbwA0AIzANAAVakBoQDyAk...](http://zenphoton.com/#AAQAAkAB9gCNlAAKAbwA0AIzANAAVakBoQDyAkoA8gBVqQGUAQYCUgEGAFWpAXoBJQJeASQAVakBZAFDAm4BQgBVqQE+AWsCjgFpAFWpARUBoAKoAZwAVakA+AHFAsQBvwBVqQDbAe0C0QHmAFWpALoCCQLmAgAAVak=)

Also, you may want to integrate a URL shortener with the 'Share link' button... [https://developers.google.com/api-client- library/javascript/...](https://developers.google.com/api-client- library/javascript/samples/samples)

</comment><comment><USER6> I love it! I am tempted to add the function to be able to add more light sources with different colors, though it might need a different name for that garden.

</comment><comment><USER7> Very nice! Feels very atmospheric and relaxing.

It makes me think of a bit of a Matrioshka Brain structure (for example from the Alistair Reynolds story Troika), with a star and surrounding shells that capture ever more of the light.

Technically, it takes a similar approach to "real time" raytracing as the cycles render engine in Blender, increasing the number of samples (thus decreasing the noise) over time.

</comment><comment><USER8> I like visual "toy" apps, interactive if you like and slow self-changing if you don't. Porting this to iOS would be great; one of those "if you don't I will" sorta things.

</comment><comment><USER9> I love this. It's so pleasing to look at.

</comment><comment><USER10> Really cool (in a Zen kind of way)! :)

</comment><comment><USER11> This is gorgeous!</comment>


Uber's bug bounty program is a complete sham, specific evidence entailed - <AUTHOR> https://reddit.com/r/technology/comments/4bq67q/ubers_bug_bounty_program_is_a_complete_sham/ <comment><USER2> Dupe: [https://news.ycombinator.com/item?id=11353287](https://news.ycombinator.com/item?id=11353287)

<comment><AUTHOR> Thanks, it didn't wasn't on the front page and when I submitted it hn didn't complain about it</comment></comment>


Fast machine-learning online optimization of ultra-cold-atom experiments - <AUTHOR> http://www.nature.com/articles/srep25890?TB_iframe=true&width=921.6&height=921.6 <comment><USER2> In case someone forgets what a Bose-Einstein Condensate is: [https://en.wikipedia.org/wiki/Bose%E2%80%93Einstein_condensa...](https://en.wikipedia.org/wiki/Bose%E2%80%93Einstein_condensate)</comment>


Screenshots: Facebook design refreshment in the works - <AUTHOR> http://thenextweb.com/2009/10/06/facebook-design-refreshment-works/

<comment><USER3> This has to be the worst example of blurring out text that I can recall seeing.

<comment><USER4> It's quite an annoying thing. I received the screenshots blurred and all we can do to stop the names from being read is blur the blur even more - <USER2> makes it look even worse in some ways. The blur isn't necessary really anyway as it was just a nice gesture to the users in the screenshots. Hopefully we can get copies of the original shots later today to improve the quality of the article :).

<comment><AUTHOR> "a nice gesture to the users"? I think those users would habe enjoyed the extra attention. More followers, credit, props and traffic? Just put my name in there from now on...

<comment><USER4> Haha, will remember to do so in the future :-).

</comment></comment></comment></comment><comment><USER5> I don't see the point of having one extra step if I wan't to update my status. I'd leave it as it is if I would like to encourage people to update regularly (that is the point of FB). I am, however, looking forward to the "top content" feature as the right box (highlights) is useless for me (showing the same stuff I don't care about for days in a row)

</comment><comment><USER6> Call me suspicious but I doubt these redesigns were done by Facebook, the author of the post is a 16 year old British guy and the screenshots look like they're taken from a 16 year old British guys profile rather than a designer working in Palo Alto...

<comment><USER4> Huh? The features that are explained in the article were made by Facebook and are being tested on a selected number of users. Facebook have also confirmed this at the end of the article. I simply wrote the article for The Next Wek and the user who informed us of the update (who the screenshots are taken by) is a sort of friend of mine ;).</comment></comment>


Ask HN: How to start a career in freelance web development? - <AUTHOR>

Hello HN. I am a young programmer trying to start a career in web development. I have become familiar with all stacks on web development and I would like to start some freelancing jobs. However I have no idea how to market myself, get clients, build portfolio,etc. Could any veteran share some ideas on this topic with me? Thanks so much! :D <comment><USER2> I would start out by producing websites for friends and family to get your name out there and show off what you can do. Also, it might help your portfolio if you were to offer to produce websites for organizations that don't yet have one and that would benefit from one. As an example, I made a website for a local Air Cadet unit (a youth leadership program) for free, and they loved it and have utilized it as a major tool for communicating with their members. This might not sound very effective, but it required little effort to make and has given me free advertising by word of mouth from the members of the unit, their parents, and the people in charge of the program. So, essentially I'm suggesting that you offer your services to anyone you can and get them to recomend you to their friends.Hope tht advice helpeyou out a bit!

</comment><comment><USER3> "I am familiar with all stacks" just means that you aren't great in any one particular stack. Become great at 1 stack. Pick one, it doesn't mean you can't do other things, it means you are selling 1 specific thing.

Then respond to "looking for freelancers" posts on HN.

</comment><comment><USER4> what did you build to familiarize yourself? do you have any websites currently up? if you don't, sounds like that's where to begin. create a demo/portfolio website of some kind.</comment>


Show HN: Find and submit interesting Twitter threads - <AUTHOR> https://www.threadcache.com/ <comment><AUTHOR> This is a little side project I worked on. The goal is to easily discover interesting, provocative, captivating, funny (and the list goes on) twitter threads.

Feel free to provide feedback and submit threads!

</comment><comment><USER2> This is pretty nifty!

Twitter's UI is pretty bad at being able to filter for good content and I always feel like I'm missing out on popular threads because they are buried somewhere in my feed.</comment>


8-bit StarCraft - <AUTHOR> http://www.youtube.com/watch?v=8B16eAS1dwA

<comment><USER2> This is very well done.

As a fan of StarCraft I must say that a lot of detail went into the making of this parody. The protoss turret sound at 1:05 cracked me up.

Here is the awesome 8-bit theme which could have been its soundtrack : <http://www.youtube.com/watch?v=3in8Z-w-uHY>

</comment><comment><USER3> Not too long ago I found this company from the UK that still develops games for 8 bit micros:

<http://www.retrosoftware.co.uk/>

And they sell cassette versions! I've been thinking of writing one myself, just for fun.

<comment><USER4> There's also a game by Ian Bogost called Guru Meditation

<http://www.bogost.com/games/guru_meditation.shtml>

for Atari VCS (2600) and iPhone.

<comment><USER5> I can't get it to run on my Amiga...

</comment></comment></comment><comment><USER6> Really well done. I like when there are post like this because, even thought it's not about technology or startup, it's still related to hacking. I'm sad when people down this talking about reddit because this post is clearly different. It has historical lessons in it and even thought you might not like gaming or starcraft, known that this game is still played today by thousand of players worldwide and that it is more than 10 years old.

</comment><comment><USER7> Is it authentic? It seems to me to be a side-scroller inspired by StarCraft and an RTS. Plus the designer of Starcraft was 10 years old in 1984, according to wikipedia. It doesn't seem right/

<comment><USER8> Also (even though it was already said that this is a parody), the first alphas of starcraft1 were based on the warcraft 2 engine. Screenshots are available:

[http://www.sirlin.net/storage/post- images/starcraft_alpha.pn...](http://www.sirlin.net/storage/post- images/starcraft_alpha.png)

( I think they abused ships for the flying units somehow, even though I am unsure about the precise details).

I think this is a cool detail to know, and it makes me curious if the first alphas for starcraft 2 were maps and hacks of starcraft 1 or warcraft 3 :)

<comment><USER9> I remember that. I'm glad they ditched it. On a side note, once WC3 came out, the marine/firebat/zergling/hydralisk models made me thing SC2 was imminent on the WC3 engine. Guess they didn't, and just went for a new engine entirely.

<comment><USER8> In case you are interested, more details on the development of starcraft 1 can be found here:

[http://sclegacy.com/editorials/34-general/270-starcraft- evol...](http://sclegacy.com/editorials/34-general/270-starcraft-evolution)

</comment></comment></comment></comment><comment><USER10> Even back in the '80s neglecting to kill the pylon was a grave error.

</comment><comment><USER11> I want to see someone make a flash version of this

</comment><comment><USER12> Hmm, I fail to understand the 2D-to-1D-mapping.

<comment><USER13> What's the standard mapping?

<comment><USER13> Oops, ignore that comment.

</comment></comment></comment><comment><USER14> This kind of post is probably against the guidelines. It does not engage any intellectual curiosity, and probably falls under:

>Off-Topic: Most stories about politics, or crime, or sports, unless they're evidence of some interesting new phenomenon. Videos of pratfalls or disasters, or cute animal pictures. If they'd cover it on TV news, it's probably off- topic.

This isn't meat & potatoes, this is cotton candy. There is already lots of it on Reddit.

Basically this is the kind of Reddit-like submission that has turned y-combinator alumni off from HN.

<comment><USER10> Fun Police! You're under arrest for public display of humor.

</comment></comment><comment><USER15> Rofl, cute.</comment>


How to deliver effective workshops online - <AUTHOR> https://www.contentful.com/blog/2020/05/11/delivering-online-workshops-or-how-to-talk-to-ascreen-and-feel-connected-to-the-audience/ <comment><AUTHOR> This article covers some basic tools and tips for this. Do you have nything to add?</comment>


The Joy of Perl (1998) - <AUTHOR> https://www.salon.com/1998/10/13/feature_269/ <comment><USER2> Used to spend a ton of time writing Perl (see username). Moved on to better designed languages. Which are not hard to find.

There are a few big issues with Perl 5 but the biggest is easily the mess of references vs flat values. Python, Ruby, JavaScript and many other dynamic languages do not make the programmer think about whether you are going to pass a data structure like an array or hash as a reference or direct value. Perl does. A lot of built in operators expect direct values, eg array ops like join, push. This is because the ops existed before Perl added complex data structures — arrays of arrays, hashes of arrays, etc. References were bolted on in Perl 5 to support such structures. And any code using them will handle references not direct values. So you have a split. And then a lot of energy is spent navigating between these two types of variables.

As Steve Yegge said:

"Perl's references are basically pointers. As in, C-style pointers. You know. Addresses. Machine addresses. What in the flip-flop are machine addresses doing in a "very high-level language (VHLL)", might you ask? Well, gosh, what they're doing is taking up about 30% of the space in all Perl documentation worldwide."

[https://sites.google.com/site/steveyegge2/ancient- languages-...](https://sites.google.com/site/steveyegge2/ancient-languages- perl)

For a taste of this here is how you join an array inside a hash:

join(',',@{$foo->{'bar'}})

Update - I forgot to say my favorite thing about Perl. The CPAN community. People talk about the sheer scale of CPAN but my favorite thing about it is the quality of documentation, at least back when I was using it. Really good uniform high quality docs. Almost always a great synopsis with multiple good examples covering real uses cases and gotchas. Then thorough documentation of functions/methods. My theory is this culture developed because CPAN predates StackOverflow, github, Google, maybe even search engines. The docs had to be good.

<comment><USER3> _" Python, Ruby, JavaScript and many other dynamic languages do not make the programmer think about whether you are going to pass a data structure like an array or hash as a reference or direct value. Perl does."_

If you don't think about these things in python, you're going to be scratching your head when you see something like this:

      >>> foo = ['a','b','c']
      >>> bar = foo
      >>> bar[1] = 'z'
      >>> foo
      ['a', 'z', 'c']

<comment><USER4> No, it isn't the same. I'm no language lawyer, but this is my understanding of it.

In python, $foo is a reference. It might be a reference to a scalar value, or list, or hash, etc, but it is a reference. The code you wrote might cause confusion for people who don't understand the python model.

In perl, $foo might be a scalar value, or it might be a reference to a value of some kind. Perl has this exact same type of problem demonstrated by your python code, but in addition it has the problem of "is $foo a scalar value or a reference?"

<comment><USER5> Imho that's not really correct, or at least misleading.

In Python, variable "foo" behaves like its value is a non-reference if the value is what some languages call "unboxed", for example numbers and strings.

That's exactly the same as Perl.

Technically, Python shares objects even in the case of numbers being copied around, and the object's _address_ is visible with the "id()" function.

(I emphasise _address_ because that was a criticism of Perl in another comment, but everything in Python is memory with an address as well and the criticism ought to apply more strongly because even numbers need memory allocation.)

However, the fact that numbers are immutably-shared when assigned in Python doesn't make their behaviour any different from numbers being assigned in Perl (apart from the obscure id()). It's hard to imagine what "problem" is created in Perl by the fact that numbers and strings are non-references. Most other languages do like Perl.

With strings, Perl does both according to a performance heuristic: Sometimes it copies, sometimes it shares. This is completely safe because you can't tell the difference at language semantics level anyway.

<comment><USER6> Numbers in Python are referenced objects. Low valued integers get reused to avoid the bloat of duplicate objects.

</comment></comment></comment></comment></comment><comment><USER7> I still write Perl to this day on my personal projects and try to contribute as much as I can to CPAN. After more than 10 years it's still my go to language. I think a lot of people are afraid of learning Perl just because they heard is hard to write or they came across some horrible code, I believe PHP suffered from this not so long ago. If you want a taste of using a really good web framework have a look at Mojolicious, Moose and friends introduce some really nice concepts around objects, there are many other interesting packages. The consistent documentation and testing around most of the packages on CPAN makes working with modules a breeze. Other languages like Python or Node.JS could learn a lot from the Perl community even to this day. The are just a few rules for writing code in Perl, the expresivity of which a lot of people are complaining it's actually the Perl's strong points.

<comment> heresie-dabord > I still write Perl to this day

I do too. I use it for solving data-analysis problems in a portable and long- stable way. To this day, I can still run Perl that I wrote a long time ago. That's a good investment. I can build data structures in Perl OO that are much more efficient in memory consumption than other interpreted languages.

Good code and bad code exist in every language -- anyone who has been in the business for a while knows this.

I would just add that the rejection of sigils and braces is also the rejection of other very useful and efficient tooling, such as bash and awk.

</comment></comment><comment><USER8> We use perl to power some web services that have been running a long time. It's a work horse.

I'm ok with it but it is hard to read, I think because there are so many ways to do everything. it takes a bit to get used to some of the syntax ($@~). I was told my perl was very c like during a review.

It's great for text manipulation though.

I just remember Rasmus (of php) talking about how he always expected any language to take over php but perl made some design decisions that made it unpalatable to hosting providers.

It's still my go to for processing large text files.

<comment><USER9> PHP rise is a lesson in systemic effects. linguistic wise it had nothing on perl, the module execution model was another 'less is more'. Crazy in retrospect.

</comment></comment><comment><USER10> If perl6 had not been the Duke Nukem Forever of programming languages, I'd probably still be coding in Perl, but Ruby just came along and offered a very similaly spirited playground. And then I found lisp and realized that my late perl code was very lisp-ish anyway.

<comment><USER11> Did Duke Nukem Forever change its name? Perl 6 has. It's called Raku now ([https://raku.org](https://raku.org) using the #rakulang tag on social media). And it is very much alive and ready for production.

<comment><USER10> No, but it was so long in the making that I had discovered alternatives and mastered them.

I still write perl5 sometimes but none of perl6 features convinced me to install an interpreter anywhere when I already have ruby or python on the machine.

<comment><USER11> Too bad. And now it is too late, because Perl 6 has been renamed to Raku ([https://raku.org](https://raku.org) using the #rakulang tag on social media). Which features _would_ convince you to install Raku?

<comment><USER10> Which does it offer that are not covered by ruby, python or CL?

I am fluent in a lot of languages and cannot really imagine anything that could motivate me to upgrade my perl5 black belt to perl6 except for a well- paid gig that requires it.

<comment><USER11> Better Unicode support and async/parallel processing primitives that don't depend on a GIL, are the first things that come up.

</comment></comment></comment></comment></comment></comment><comment><USER12> I still use Perl for server side chores, but most all my web app code is JS now and runs entirely in the web browser.

As I recall, back in the mid-late 90s the phrase "there's more than one way to do it" was used a lot in reference to Perl, and that was generally true and made it pleasure to learn and use.

There soon came to be two very divided camps of perl users. There were guys like Randal Schwartz that considered themselves as elite geniuses and hacks like me who asked stupid questions and "made crap".

Coming from knowing nothing about writing code I bought books by Selena Sol and Lincoln Stein and learned a lot. They were very accessible with lots of example code. But Randall's O`Reilly books were just way too perplexing for me to get anything out of them.

I also joined some of the official Perl and Perl CGI mailing lists. Those lists were public but had just few hard core users and then guys like me, who knew almost nothing, came flooding in with lot's of newbie questions and things got pretty vicious. "RTFM" was a common snotty response that gave no help at all.

I made an effort to answer those newbies fast and courteous but they'd still often get just beat to shit by the snobs there. In fairness, Larry Wall was always very welcoming and encouraging to dabblers and beginners like me, and he did work hard to discourage snobbiness, but somehow those perl mailing list just attracted hardasses. Larry was never on any of the lists I joined.

If you go read some of those old emails you can see it.. I started the perl.macosx mailing list around March 2001 after getting chased off the "macperl" list for asking a question about perl on OSX when it first came out. I tried to keep things friendly on the new list and it was a lot of fun until the snobs showed up there too about a year later. I finally just unsubscribed after a just few more years.

It wasn't long after I left that participation in those email lists started really falling off. Now they're barely used at all. Can't blame it on Larry Wall though. I still love that guy.

<comment><USER13> The Perl Cookbook was great for most basic questions and Perlmonks for anything beyond that. I still miss the discussions in Perlmonks, something that Stack Overflow is missing.

</comment></comment><comment><USER14> > it's a completely different beast, a highly complex "scripting" language

I learned long ago to not call my programs scripts, because many people interpreted (sorry) this negatively.

<comment><USER15> In those days "real programmers" were doing C and ASM, and they anyway considered all other languages as a joke :P

<comment><USER16> Kernigan didn't! The number of little languages he made is astounding.

<comment><USER17> The "unix way" was full of small languages, sometimes compiled to C.

There's a good reason why parser generators were part of UNIX.

</comment></comment></comment></comment><comment><USER18> Perl isn't so bad once you learn all the little gotchas, but it's not something I would recommend to anyone unless they're scraping clis. It has too many foot guns, and the pool of engineers to choose from seems too small.

</comment><comment><USER19> I was basically introduced to functional programming through Higher Order Perl.

<comment><USER20> That is such a great book.

</comment></comment><comment><USER21> After I first got online in 1995, I had noticed that Perl was this thing that everyone was using to create dynamic HTTP server behavior.

I ended up using what I knew instead: Turbo Pascal + some oddball "wincgi" interface.

Later I caved and started using Perl, since everyone else was using it. It was a pretty weird experience. I did my first paid "consulting", for a company from the tiny place where I grew up, building a "web app" using Perl. This happened during the first year of university studies. I got paid $12/hour. That was so much money to me, back then! (I was like 18 or 19.)

This experience is where I grew to hate Perl and learned to love more structured languages.

A year later in 1997, I ended up working full-time with the [https://en.wikipedia.org/wiki/Pike_(programming_language)](https://en.wikipedia.org/wiki/Pike_\(programming_language\)) instead. This was essentially a precursor of Dart.

<comment><USER21> 14 years later (2011) I ended up visiting/working with a team that had stayed with Perl for some time. That was a fascinating experience. They were using selected "good" parts of Perl, sort of how you can can use the good parts of any competent dynamic programming language and stay productive, in a small team. Afaik they're still going strong.

</comment></comment><comment><USER22> A thread from 2012: [https://news.ycombinator.com/item?id=3728313](https://news.ycombinator.com/item?id=3728313)

<comment><USER23> Yeah kamaal's comment on that thread shows just how insanely terse Perl can be... truly the king of one-liners

</comment></comment><comment><USER24> I met a long-time collaborator of mine over drinks a while back, and we talked about Perl.

"It's my second language", he said.

"What's your first?"

"English."

</comment><comment><USER25> It soothes me to read that even back in 1998, people were criticizing Perl for being write only and were considering Python. Trends in programming seem a little slower, knowing that.

<comment><USER26> In that time period I remember it being _very_ common to hear Python introduced in conversation as a perl alternative. That was how I first heard of it too.

</comment></comment><comment><USER23> Oh man, this brings back memories... when this article was written, I was a high school freshman, and I had just bought _Teach Yourself Perl 5 in 21 Days_ so I could learn how to write my own custom CGI scripts for my geeky personal webpage. It was my first true programming language, after childhood flings with BASIC.

Also, I find it humorous how the term "hacker" is used here to refer to literally anyone who works on computers. I suppose the title of this site retains that meaning...

</comment><comment><USER27> One of the most insightful pieces from the article:

""" "I realized at that point that there was a huge ecological niche between the C language and Unix shells," says Wall.

...

"People are always looking for the interstices," says Wall. "They are always looking for the new ecological niches. And the speed with which you can move into those ecological niches is really important, because the first person into a niche is often the winner." """

</comment><comment><USER25> I did not know that Larry Wall wrote patch. I thought it came out with diff.

</comment><comment><USER28> I can't imagine programming in any other programming language than Perl.

<comment><USER29> I can't imagine programming in Perl anymore. I did a bit in a previous job and it was a ball ache trying to remember the syntax and all it's quirks.

I don't know why you'd want to use it over other popular scripting languages like JS/Ruby/Python. All have more active communities.

AWS don't even support Perl

<comment><USER30> Non-web developer here... I've personally never seen any Ruby in anything I've ever worked on (only personal, limited anecdote, of course).

Python's nice for gluing more performant native code together (perl XS isn't as straightforward IME). But for text processing I'll take perl every time.

<comment><USER29> Ruby definitely has its niche in web development mainly due to Rails, Jekyll and Sinatra. Quite a weird choice for other things. Pretty sure Homebrew on Mac uses it.

It's not the most performant of languages (although it's definitely getting better).

<comment><USER31> Homebrew is the only thing I think Ruby is perfect for. It's just a DSL for describing how to fetch and build a program, like Makefiles but more convenient.

<comment><USER29> Chef is the same kinda thing but for managing infrastructure (like Ansible for Python & Cake for .NET)

[https://www.digitalocean.com/community/tutorials/configurati...](https://www.digitalocean.com/community/tutorials/configuration- management-101-writing-chef-recipes)

</comment></comment></comment></comment></comment></comment><comment><USER32> Perl comes from the days when interpreted programming languages were invented as concrete solutions to general problems. Now we have reusable frameworks as concrete solutions, whereas high level languages have more general use cases.

</comment><comment><USER33> Amazing - I did not realize that this article was 21 years old until 3/4 of the way through reading it.

</comment><comment><USER34> The thing about perl I still miss is the metaprogramming. It's really amazing to be able to launch a program that writes the "last mile" of code before it starts taking requests.

<comment><USER35> You can do a lot in Perl with just closures and setting package slots etc., that you would need to use macros for in say Lisps.

Still, I agree, there's no real AST and string eval is unsafe and parsing is a real issue. I've started [https://metacpan.org/pod/FP::AST::Perl](https://metacpan.org/pod/FP::AST::Perl) (very unfinished) to solve the code generation issue and hope to generate an AST from the op tree (not sure how feasible, will see). Feel free to tell me (here or offline) what your use case is and whether that module might suit you.

<comment><USER36> > There's no real AST

Perl cannot be statically parsed!

> Theorem: Parsing Perl 5 is Undecidable

[https://www.perlmonks.org/index.pl?node_id=663393](https://www.perlmonks.org/index.pl?node_id=663393)

<comment><USER35> > Perl cannot be statically parsed!

My usage (modifying syntax / extending the compiler when _running_ Perl programs) doesn't need static parsing. What I need is a way to leverage the existing infrastructure in the interpreter for parsing in a way that's compatible with most modules/usages. AFAIK the parser in perl goes directly from source to an OP tree (modulo running other Perl code on the go that modifies the parsing state, which is the reason for the undecidability), it would be cool if it didn't go to an OP tree but something more AST instead, but it might not be feasible to change perl to do that because of modules working on the op tree (if anyone wants to help figure out how much this is true, please do); because of that I'll instead look into converting the op tree into an AST. I've been told the op tree does have additional info that might make that feasible. Notabene, B::Deparse exists, which is somewhat of a proof that this works, although there are limitations, whether they matter is part of what I need to find out.

<comment><USER36> Haha, my comment was definitely tongue in cheek ;) I fully expect most of properly written Perl code to be statically parseable into an AST, save for pathological cases (and I fully expect a proper rubocop-like Perl linter to highlight such ambiguities, and would reject them in any sensible project)

</comment></comment></comment></comment></comment><comment><USER27> Such a well written article. It was amusing that an article from _1998_ ends with a footer with author's (Andrew Leonard) Twitter ref.

</comment><comment><USER37> I bet some younger HN readers are looking at this and wondering if the popularity off Perl at this point is primarily sentimental associations that older devs have with the early days of the Web when they could find artsy ways to explore a new emerging medium.

It is. Very much so.

<comment><USER38> I disagree completely, but I'll accept that that's partly a matter of taste.

But the thing that shocks me most about how completely Perl has fallen out of fashion is that nowadays sysadmins will write a hundred-line bash script rather than a five-line Perl script because of the theory that Perl is hard to read.

<comment><USER39> That could be, but I've also noticed a sort of purism where the shell script is ideal because it can be run on any system.

(Of course, using bash for the shell isn't a good choice because you can't rely on bash being installed).

Personally I reach for Perl as soon as any sort of arithmetic is involved. And even if starting with find(1) is the first choice, it's worth getting to know modules like File::Find because they're way more powerful.

<comment><USER40> It is unfortunate that those sysadmins are then failing to just go full on awk then rather than those shell scripts.

Even alpine has awk installed. docker run --rm alpine awk

<comment><USER41> alpine doesn't "have awk installed," it's just that BusyBox that has an awk implementation. For real GNU awk you have to install the gawk package.</comment></comment></comment></comment></comment>


Ask HN: How would you apply startup lessons to a solo musical career? - <AUTHOR> As the title says.
You are a singer and guitarrist that makes it's own songs.
You play guitar better than how you sing, but you don't sing bad.
Do you apply the lean startup and put out a song on spotify as soon as possible?
or do you do something else?
How would you translate paul graham's essays into a music career? <comment><USER2> Start here: [https://www.donpassman.com/](https://www.donpassman.com/)

This is the bible of business in music industry.

Then study the business-end from Taylor Swift to Tycho to Post Malone and Sean Mendez. Oh, and especially Lil Nas X and what he did.

I would say there are a lot of lean ideas playing out in the music industry across genres -- you just need to translate what they are doing to how Eric Reis might do it :-)</comment>


How not to write recruiting emails - <AUTHOR> http://blog.alexmaccaw.com/recruiting-emails

<comment><USER2> Agree mostly, but I do take issue with the idea that "an active GitHub account should be enough for most programming jobs." Recruiter or otherwise, that kind of assumption is a good way to miss out on talent.

At my current job I have a very active github account - but about 95% of that activity is in private repos.

I am just now starting to work more on contributing to github hosted OSS Projects but -- when I even had time previously -- those projects were often not hosted on github.

For my personal projects, I use my own git repos over ssh. I probably will decide to put them on github when and if I am ready to share them -- but that's not a given.

In my previous job, we didn't use github. Everything was closed source and internal.

Just because one service is the current fad (and don't get me wrong, I generally think github kicks ass) doesn't mean it's valid to assume that your next candidate is using it.

<comment><USER3> I think what the OP is arguing is that if he has an active github profile: 1\. the recruiter should have done the work to check that out before emailing him. 2\. his/her profile should be enough to warrant arranging a meeting/interview, and a resume would add little extra information.

If you don't have an active public place where your work is showcased, then certainly a resume is a good (more) private way to provide a potential employer your skillset. Though certainly not the only other way.

<comment><USER2> Fair point, re-reading the original context I can see it was likely intended that way.

</comment></comment></comment><comment><USER4> Unfortunately most of the recruiters tend to rely on scale aka spam method instead of very targeted approach. The quality of this kind of work is mediocre at best. They are wasting everybody's time - candidates, employers and their own.

</comment><comment><USER5> I don't think "a language I don't use" is a big concern in these email, just like I don't think I should be tested on a specific language in job interviews. It's always a plus if I know the technical / implementation details of the platform, but if I know how to code and I know how to learn languages it's mostly moot, IMO. However I definitely hate it when people pitch me a job that's a "perfect match" for my background and they clearly have no idea what my background is. Don't be disingenuous. If you think it might be up my alley, just tell me about it.

</comment><comment><USER6> I actually got a recruiting email not too long ago from an agent that used AoL CaPs LiKe ThIs in his subject line.

I laughed. And then I deleted it.

</comment><comment><USER7> I guess most people don't like to be invited to jobs in a different country or where a different country is used?

I typically dwell on these offers more in actuality. My time studying, living, and working abroad were some of the best, even if the pay was substantially lower.

</comment><comment><USER8> There is a project on github that is very similar to the authors intentions -- [https://github.com/rowanmanning/joblint](https://github.com/rowanmanning/joblint)</comment>


New tutorial site for the MEAN stack (free trial) - <AUTHOR> https://masteringmean.com

<comment><USER2> Looks interesting. Just signed up, and it seems to be more of a learning web than a linear course, which is cool.</comment>


IETester – Multiple Internet Explorer versions on the same PC - <AUTHOR> http://kossovsky.net/index.php/2009/06/ietester-multiple-internet-explorer-versions-on-the-same-pc/ IETester is a free WebBrowser that allows you to have the rendering and javascript engines of IE8, IE7 IE 6 and IE5.5 on Vista and XP, as well as the installed IE in the same process. <comment><USER2> "Please don't submit so many links at once that the new page is dominated by your submissions."

(from <http://ycombinator.com/newsguidelines.html>)

<comment><AUTHOR> sorry...</comment></comment>