Joined February 2012
·

Attila Györffy

developer, tinker at Unboxed Consulting
·
London, UK
·
·
·

@wojtekkruszewsk try to copy the text above, Coderwall is adding special parameters to the link href and basically breaks the link completely. There's nothing I can do I'm afraid.

I'd mention that there's select and reject alternatives on enumerable objects that do not mutate the original object (called the "receiver" in the context of message-passing). those come useful when you want to ensure the original object does not change but you need a filtered set of elements.

@spencer__d what version of OS X and XCode are you using?

Posted to Memory efficient Ubuntu VMs over 1 year ago

@hostmaster:

Yes I have looked into drop bear and it mostly works. Unfortunately the Official Ubuntu Package does not come with the scp command so you won't be able to securely copy files from within the guest machine to another host.

Please see the relevant issue on Launchpad:
https://bugs.launchpad.net/ubuntu/+source/dropbear/+bug/472264

This is might sound like a minor issue, however when you turn the virtual machine into a Vagrant Box, Vagrant will complain that the guest OS does not have SCP capabilities and will cancel the provisioning. Having said that, I'd rather prefer the OpenSSH server package over Dropbear for the reasons above, at least until Dropbear will support SCP as well.

Posted to Memory efficient Ubuntu VMs over 1 year ago

@unnali: Nicely spotted! Thank you for letting me know. Originally I was doing the whole configuration in interactive root shell. I've modified the post. \o/

Posted to Memory efficient Ubuntu VMs over 1 year ago

@firefishy1: Thank you, good point. I was expecting the installer to do exactly that, however it turns out that the minimal virtual install still sticks to the generic kernel (which I find interesting.)

Posted to Memory efficient Ubuntu VMs over 1 year ago

@steakknife: The purpose of this post is not to just spit some shell code into peoples' faces but to explain and help understanding what is going on.

On the other hand I obviously understand the benefits of having a repeatable script, as well. If you have one, please post it. Your current one does a little too much maybe. (Not everybody needs git for example)

Posted to Memory efficient Ubuntu VMs over 1 year ago

@honza: Yes! That was my intention since the beginning. I'll update the post when it's available.

Posted to Memory efficient Ubuntu VMs over 1 year ago

@carlzulauf:

Good point! This article was supposed to be an intro to the main steps towards memory optimisation but I guess I could profile individual kernel modules as well and update the article with the findings. I'll get some time to do it.

Other aspects of memory consumption that I was thinking of are mainly around common services on Ubuntu servers. For example using Nginx instead of Apache to lower the memory footprint, however these would be specific to individual use cases. (Not everybody is using a HTTP server, although it's quite common).

Posted to Pretty JSON for humans over 1 year ago

I'm sorry to be the bad guy here but I think user agent based content negotiation (using the user agent as the sole signal to branch the logic of your server-level code) is dubious at best and insecure at worst.

It should be the client's responsibility to format the response when necessary. There are really great browser extensions that do this.

Also, by looking at your code, you'd want to see human readable formatting when using cURL or wget as well. For that you could use the power of Unix and pipe the output of those commands into a post processor and implement the encode_json command locally on your machine.

This way you respect the basic principles of HTTP and keep your code clean and reliable.

Do the right thing.

Posted to Pretty JSON for humans over 1 year ago

I'm sorry to be the bad guy here but I think user agent based content negotiation (using the user agent as the sole signal to branch the logic of your server-level code) is dubious at best and insecure at worst.

It should be the client's responsibility to format the response when necessary. There are really great browser extensions that do this.

Also, by looking at your code, you'd want to see human readable formatting when using cURL or wget as well. For that you could use the power of Unix and pipe the output of those commands into a post processor and implement the encode_json command locally on your machine.

This way you respect the basic principles of HTTP and keep your code clean and reliable.

Do the right thing.

Posted to How to make a cool $() selector over 1 year ago

Nice writeup. I sometimes think that prototypal inheritance is so much more powerful than class-based inheritance. (That's assuming it's used the right way.)

@gevans: You need a newline at the end of the file to be able to easily omit file contents from within the Terminal. For example:

cat ".ruby-version" >> .gitignore

Posted to Autocomplete last command's param over 1 year ago

I wonder how ESC + dot works in different Terminal implementations... I know that it works in the Mac Terminal but I wonder if this should be approached from the shell's perspective.

In which case $_ might be a better alternative to use.

Posted to Switching Xcode version over 1 year ago

This could probably be simplified to sudo xcode-select -switch /Applications/Xcode.app/Contents/Developer/ as there should be only one xcode-select command in your PATH.

Achievements
1,391 Karma
63,220 Total ProTip Views