From 8f968d6c14aa6f55f606c4442e72ebcfcbe98d25 Mon Sep 17 00:00:00 2001 From: Alice Harris Date: Sun, 6 Jul 2014 19:01:24 +1000 Subject: [PATCH 1/3] update Vagrantfile to use my habitrpg box and with performance improvements --- Vagrantfile | 31 ++++++++++++++++++++++++++++++- 1 file changed, 30 insertions(+), 1 deletion(-) diff --git a/Vagrantfile b/Vagrantfile index 113c688efc..89f2526fd2 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,11 +5,40 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.box = "thepeopleseason/habitrpg" + config.vm.box = "habitrpg" config.ssh.forward_agent = true config.vm.hostname = "habitrpg" config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true config.vm.usable_port_range = (3000..3050) config.vm.provision :shell, :path => "vagrant.sh" + + # http://www.stefanwrobel.com/how-to-make-vagrant-performance-not-suck + # also http://docs.vagrantup.com/v2/synced-folders/nfs.html + # Required for NFS to work, pick any local IP + config.vm.network :private_network, ip: '192.168.50.50' + # Use NFS for shared folders for better performance + config.vm.synced_folder '.', '/vagrant', nfs: true + + # http://www.stefanwrobel.com/how-to-make-vagrant-performance-not-suck + # Use all CPU cores and 1/4 system memory + config.vm.provider "virtualbox" do |v| + host = RbConfig::CONFIG['host_os'] + # Give VM 1/4 system memory & access to all cpu cores on the host + if host =~ /darwin/ + cpus = `sysctl -n hw.ncpu`.to_i + # sysctl returns Bytes and we need to convert to MB + mem = `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 4 + elsif host =~ /linux/ + cpus = `nproc`.to_i + # meminfo shows KB and we need to convert to MB + mem = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / 4 + else # sorry Windows folks, I can't help you + cpus = 2 + mem = 1024 + end + v.customize ["modifyvm", :id, "--memory", mem] + v.customize ["modifyvm", :id, "--cpus", cpus] + end + end From 8cfcf8db101ff9d396ae20da20f722427f717039 Mon Sep 17 00:00:00 2001 From: Alice Harris Date: Sun, 13 Jul 2014 16:09:43 +1000 Subject: [PATCH 2/3] make it really obvious that you can choose a class later --- views/shared/modals/classes.jade | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/views/shared/modals/classes.jade b/views/shared/modals/classes.jade index c2ae60cd32..5eac56aeea 100644 --- a/views/shared/modals/classes.jade +++ b/views/shared/modals/classes.jade @@ -5,6 +5,8 @@ script(type='text/ng-template', id='modals/chooseClass.html') =env.t('chooseClass1') | a(href='http://habitrpg.wikia.com/wiki/Class_System' target='_blank')=env.t('chooseClass2') + |  + =env.t('chooseClass3') .modal-body.select-class .container-fluid .row @@ -76,4 +78,4 @@ script(type='text/ng-template', id='modals/chooseClass.html') .modal-footer button.btn.btn-sm.btn-danger(ng-click='user.ops.disableClasses({}); $close()', popover-placement='top', popover-trigger='mouseenter', popover=env.t('optOutText'))=env.t('optOut') - button.btn.btn-primary(ng-disabled='!selectedClass' ng-click='changeClass(selectedClass); $close()')=env.t('select') \ No newline at end of file + button.btn.btn-primary(ng-disabled='!selectedClass' ng-click='changeClass(selectedClass); $close()')=env.t('select') From 157acf9b6b0aac2b189cb3010f73535003ee7728 Mon Sep 17 00:00:00 2001 From: Alice Harris Date: Sun, 13 Jul 2014 16:14:46 +1000 Subject: [PATCH 3/3] put Vagrantfile back the way it's meant to be --- Vagrantfile | 31 +------------------------------ 1 file changed, 1 insertion(+), 30 deletions(-) diff --git a/Vagrantfile b/Vagrantfile index 89f2526fd2..113c688efc 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -5,40 +5,11 @@ VAGRANTFILE_API_VERSION = "2" Vagrant.configure(VAGRANTFILE_API_VERSION) do |config| - config.vm.box = "habitrpg" + config.vm.box = "thepeopleseason/habitrpg" config.ssh.forward_agent = true config.vm.hostname = "habitrpg" config.vm.network "forwarded_port", guest: 3000, host: 3000, auto_correct: true config.vm.usable_port_range = (3000..3050) config.vm.provision :shell, :path => "vagrant.sh" - - # http://www.stefanwrobel.com/how-to-make-vagrant-performance-not-suck - # also http://docs.vagrantup.com/v2/synced-folders/nfs.html - # Required for NFS to work, pick any local IP - config.vm.network :private_network, ip: '192.168.50.50' - # Use NFS for shared folders for better performance - config.vm.synced_folder '.', '/vagrant', nfs: true - - # http://www.stefanwrobel.com/how-to-make-vagrant-performance-not-suck - # Use all CPU cores and 1/4 system memory - config.vm.provider "virtualbox" do |v| - host = RbConfig::CONFIG['host_os'] - # Give VM 1/4 system memory & access to all cpu cores on the host - if host =~ /darwin/ - cpus = `sysctl -n hw.ncpu`.to_i - # sysctl returns Bytes and we need to convert to MB - mem = `sysctl -n hw.memsize`.to_i / 1024 / 1024 / 4 - elsif host =~ /linux/ - cpus = `nproc`.to_i - # meminfo shows KB and we need to convert to MB - mem = `grep 'MemTotal' /proc/meminfo | sed -e 's/MemTotal://' -e 's/ kB//'`.to_i / 1024 / 4 - else # sorry Windows folks, I can't help you - cpus = 2 - mem = 1024 - end - v.customize ["modifyvm", :id, "--memory", mem] - v.customize ["modifyvm", :id, "--cpus", cpus] - end - end