Skip to content

Instantly share code, notes, and snippets.

View AGiallelis's full-sized avatar
🎯
Focusing

Antonis Giallelis AGiallelis

🎯
Focusing
  • Greece
View GitHub Profile

Typing vagrant from the command line will display a list of all available commands.

Be sure that you are in the same directory as the Vagrantfile when running these commands!

Creating a VM

  • vagrant init -- Initialize Vagrant with a Vagrantfile and ./.vagrant directory, using no specified base image. Before you can do vagrant up, you'll need to specify a base image in the Vagrantfile.
  • vagrant init <boxpath> -- Initialize Vagrant with a specific box. To find a box, go to the public Vagrant box catalog. When you find one you like, just replace it's name with boxpath. For example, vagrant init ubuntu/trusty64.

Starting a VM

  • vagrant up -- starts vagrant environment (also provisions only on the FIRST vagrant up)
In general, a cache is a "more local" copy of a memory resource that you want to access.
Its a copy that is faster to access than the original, but that memory is also more expensive.
This link, provides some measurements that illustrate the benefits: http://norvig.com/21-days.html#answers
Disk cache is RAM memory, that contains a copy of the information on the disk.
Typically, when you access something on the drive, the whole page is brought into cache, on the assumption that the next access will be in that page.
The first disk seek might take 8ms, while seeks from cache 100 ns (many times faster - note nanoseconds instead of milliseconds)
Memory cache is the same concept, but the cache is located on the CPU chip. So the original memory access is 100ns, the L1 cache access can be 0.5 ns.
@AGiallelis
AGiallelis / .htaccess-mod_headers
Last active April 26, 2017 11:43
What is cache-control? Cache-Control is a HTTP header that defines the amount of time and manner a file is to be cached.
<IfModule mod_headers.c>
Header set Connection keep-alive
# Cache-control headers
# 2 HOURS
#<filesMatch "*"> All files
Header set Cache-Control "max-age=7200, must-revalidate"
#</filesMatch>
# 480 weeks - 290304000