Everyday cybercrimes - TED talk by James Lyne

Correct, short and illustrative talk on aspects of informational security that even IT people are missing. Also we always need to remember that all our tracks in the Network are quite easy to find.

Russian subtitles are available


Learn Node.js - books, materials, courses

Learning Node.JS

Collection of free resources to dive into Node.js.

I prefer quite small, useful and clear articles/books (and I would not be so clever to post official docs links here, I hope you have already found it and know what to do in case of emergency :)).
I'll try to order it from very basic to more sophisticated, so if you don't know where to start... just start from the very beginning of the list.


Read more ...

Yii2 dev digest #4 Dec'13

The last digest this year.
I wish all of us to dive deep in new exciting projects with Yii2 in the next year (as I am sure there will be a stable release relatively soon, according the progress ;))
Stay in touch with development process, grow your skills with it, grow faster then it !

Read more ...

Autoupdate VirtualBox Guest Additions in Vagrant

vagrant

While using Vagrant (I'll leave the question "Why should I use it?" for some future post) and taking ready made Boxes from http://vagrantbox.es - the fist issue I have faced was a warning about inconsistency of VirtualBox Guest Additions and actual VirtualBox version I am using.

Why is this happening ?

Because VirtualBox Guest Additions - it is drivers etc. installed inside the Box (that you are downloading somewhere) and for each new VirtualBox version new Guest Additions are required.
It can work with old version in general, but very essential parts could fail - like shared folders etc.

How to fix it manually

You could go to VirtualBox downloads server and find yourself needed ISO, download it inside Vagrant box via wget for example, mount it and install. But it is boring :)

Autoupdate Guest Additions via Vagrant plugin

vagrant-vbguest comes to help us with it.

Install

vagrant plugin install vagrant-vbguest

Configure

Add one line in your Vagrantfile

Vagrant.configure(VAGRANTFILE_API_VERSION) do |config|
...
  config.vbguest.auto_update = true
...
end

and restart Vagrant box vagrant up

If you are lucky - everything else will happens automatically and you will be notified about version of Guest Additions that is being installed.

Also go through Configuration docs for vbguest to see other useful params.


How Redis expires keys

redis

I am often asked by my "junior" colleagues - what happens with Redis keys after expiry time, are these expired keys automatically being deleted or are they just "hang in RAM till The End Of Times" ? *Dramatic music! :)*
Fine, if you are to lazy to read docs...

Redis keys are expired in two ways: a passive way and an active way.

Active

When client access key and the key is found to be timed out - it is being deleted.

Passive

The most interesting - what happens with keys that are expired are are never accessed after expiry.
10 times per second Redis check 100 random keys with associated expiry time from the keyspace and remove expired keys.
If more than 25 keys were expired, start check again.

This is a probabilistic algorithm, where the percentage of keys that are likely to be expired is under 25%. This means that at any given moment the maximum amount of keys already expired that are using memory is at max equal to max amount of write operations per second divided by 4. That means that about 1/4 of RAM occupied by Redis could be used to store "expired" keys.


Ievgen
Kuzminov "iJackUA"
Web Team Lead
at MobiDev (Kharkiv, Ukraine)
Code in Ruby and Elixir, but still love PHP. Explore ES6 and Vue.js. Explore databases, use Ubuntu and MacOS, think about IT people and management

Notes