Posts

Showing posts from January, 2013

Vagrant: how to set vm memory and force gui mode

# -*- mode: ruby -*-
# vi: set ft=ruby :

Vagrant::Config.run do |config|

  config.vm.define :zenoss do |zenoss_config|
      zenoss_config.vm.box  = "quantal64"
      zenoss_config.vm.network :hostonly, "10.66.66.10"
      zenoss_config.vm.forward_port 80, 8885
      zenoss_config.vm.customize ["modifyvm", :id, "--memory", 1024]
  end

  config.vm.define :desktop do |desktop_config|
      desktop_config.vm.box  = "quantal64"
      desktop_config.vm.network :hostonly, "10.66.66.20"
      desktop_config.vm.boot_mode = :gui
  end

end

How to convert encryption keys: RSA to PEM

RSA to PEMssh-keygen -t rsaopenssl rsa -in ~/.ssh/id_rsa -outform pem > id_rsa.pem

Asterisk pre-reqs for compiling on Debian/Ubuntu

apt-get -y install make libncurses-dev libxml2-dev sqlite3 libsqlite3-dev libiksemel-dev libssl-dev  subversion

Redirection on CLI: greater-thans, ampersands and numbers

myCLIapp > /dev/null 2>&1Order is important, don't reverse the redirectsSee belowFirst redirect sends STDOUT to kernel's blackhole equivalentresult:  STDOUT is forgotten, never shownSTDOUT is implied when no number before '>' Second redirect sends STDERR to where STDOUT pointsSTDERR goes where STDOUT goesSo STDERR ends up in blackhole tooThe amphersand is necessaryto specify this is a "file handle" and not a filenameReverse mistakemyCLIapp 2>&1 > /dev/null Read left to right 2>&1Would 1st send STDERR to where STDOUT is pointing currentlyWhich is STDOUT so far> /dev/nullSTDOUT is implied since no number before '>' Send STDOUT to /dev/nullResult is STDERR being displayedSTDOUT being sent to blackholeRememberif no number given before '>', them implied is STDOUThttp://www.tldp.org/LDP/abs/html/io-redirection.html

Quick start howto for divish on Debian

PrepHere, there is one backup server and two client servers that need to be backed up Make sure root user on backup server can ssh to mybox01.mydomain.net and mybox02.mydomain.net without passwordLater, much later, see online for better, more secure ways install dirvish and rsync on server, rsync on clients apt-get install dirvishapt-get install rsyncClientsThe below are just example directories, use your own, the ones you want backed upmkdir -p /data/backups/mkdir -p /data/backups/etcmkdir -p /data/backups/var/logrsync -av /etc/ /data/backups/etc/rsync -av /opt/ /data/backups/opt/Make a cron job to do the rsyncs above nightly Servermkdir -p /backup/dirvish/mybox01/dirvishmkdir -p /backup/dirvish/mybox02/dirvish vi /backup/dirvish/mybox01/dirvish/default.confget contents below vi /backup/dirvish/mybox02/dirvish/default.confget contents belowdirvish --vault mybox01 --initdirvish --vault mybox02 --initVerifyBacked up files should now be under /backups/dirvish on backup servertree /backu…

Install lex on Debian

sudo apt-get install byacc flex

Quick start how-to graphite base install on Debian

UPDATE: Also see Latest Graphite on Amazon Linux at AWS.

This only gets graphite working on your local Linux box. Left to user to translate to remote server installation thereafter.

NOTE: Do everything as root user

make sure apache2 is installed and working with wsgiapt-get install apache2 -yapt-get install libapache2-mod-wsgi -ya2enmod wsgiwsgi needs a place for its socketsmkdir /etc/apache2/runmkdir /var/run/wsgi chmod 777 /etc/apache2/run /var/run/wsgithis seems undocumented, thanks! Install dependenciesapt-get install -y libapache2-mod-wsgi python-twisted python-memcache python-pysqlite2 python-simplejsonapt-get install -y python2.6 python-pip python-cairo python-django python-django-taggingInstall graphite elementsmkdir -p /root/graphite-installcd /root/graphite-installgit clone https://github.com/graphite-project/graphite-web.gitgit clone https://github.com/graphite-project/carbon.gitgit clone https://github.com/graphite-project/whisper.gitgit clone https://github.com/graphite-…