Brainleak

Blog as external memory

OpenVZ Moving Containers

OpenVZ moving containers

When moving OpenVZ containers on the hdd to another location you have to do some other changes to :

  • Edit /etc/vz/conf/.conf and change private path to new location
  • Drop vzquota on container vzquota drop

Then you probably should reinitialize quota and turn it back on again, but that’s for another time. Need to look into it.

Internal Storage

Storage server

Using a Raspberry PI model B with external hdd’s as a NAS. Device is identified as ‘storage’ on the network. HDD’s are mounted in /mnt. Right now only data-1 is mounted. Clients use /data-1 as mountpoint.

NFS mounts

storage:/mnt/data-1 /data-1 nfs defaults 0 0

TODO

  • Setup rights so that clients can write to it
  • Create bootscript so that all necessary services are started

    After booting storage NFS can not be started because rpcbind is not started. First start rpcbind then nfs-common and nfs-kernel

Books to Read

  • The Banker’s Clothes
  • The Housekeeper and the Professor
  • The Circle
  • Oil on the Brain: Adventures from the Pump to the Pipeline
  • The Quest [Daniel Yergin]

    Read first part it. Very interesting. Puts current crisis in perspective.

  • The Goal
  • Grand Pursuit [Sylvia Nasar]

Rails 4 Engines Test

Testing is broken out of the box! This is how you fix it :

test/test_helper.rb

# Configure Rails Environment
ENV["RAILS_ENV"] = "test"

require File.expand_path("../dummy/config/environment.rb",  __FILE__)
require "rails/test_help"

Rails.backtrace_cleaner.remove_silencers!

# Load support files
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }

# Load fixtures from the engine
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)

class ActiveSupport::TestCase
  fixtures :all
end

#fixes other problems with controller tests (url helpers)
class ActionController::TestCase
  setup do
    @routes = Users::Engine.routes
  end
end

Chef Fails on Bootstrapping the First Time

= Problem

shops.suwappu.net Installing Chef Client...
shops.suwappu.net --2014-06-17 10:12:40--
https://www.opscode.com/chef/install.sh
shops.suwappu.net Resolving www.opscode.com (www.opscode.com)... 184.106.28.90
shops.suwappu.net Connecting to www.opscode.com
(www.opscode.com)|184.106.28.90|:443... connected.
shops.suwappu.net ERROR: The certificate of `www.opscode.com' is not trusted.
shops.suwappu.net Starting first Chef Client run...
shops.suwappu.net bash: line 85: chef-client: command not found
[master][/Code/suwappu/chef-resto/chef-repo-new] librarian-chef

Using SSO

These are some notes for the internal SSO Provider.

  • Add before_filter :sign_in to actions that need to be secured
  • Use current_user to get to the signed in User
  • Add Omniauth initializer

  • Something else

OpenVZ Container TUN/TAP

While trying to use an OpenVZ container as an OpenVPN client, it seemed the container could not create the TUN device.

See https://openvz.org/VPN_via_the_TUN/TAP_device

OpenVZ containers have no TUN/TAP device. It is possible to grant the container access to tun/tap by doing :

CTID=101
  vzctl set $CTID --devnodes net/tun:rw --save
  vzctl set $CTID --devices c:10:200:rw --save
  vzctl set $CTID --capability net_admin:on --save
  vzctl exec $CTID mkdir -p /dev/net
  vzctl exec $CTID mknod /dev/net/tun c 10 200
  vzctl exec $CTID chmod 600 /dev/net/tun