Wednesday, 23 April 2014

gnupg

  1. create
    1. gpg --gen-key
      1. if entropy taking too long
        1. sudo apt-get install rng-tools
      2. note your key ID from output
        1.  pub   4096R/B110C232 2014-04-23
        2. here it is: B110C232
  2.  push
    1. gpg --send-keys --keyserver keyserver.ubuntu.com B110C232
      1. replace B110C232 with the key ID output from above
  3. more to come

Thursday, 20 February 2014

Puppet 3.1.1 using Ruby 1.9.3 on Amazon Linux

UPDATE: Amazon Linux is now on Ruby 2.x, so below is DEPRECATED for new Amazon Linux images. But parts may be useful.
  1. yum -y remove ruby
  2. yum -y install ruby19
  3. gem install --no-rdoc --no-ri puppet --version=3.1.1 
  4.  /usr/local/bin/puppet -V
    1. add /usr/local/bin to $PATH of users that need it
  5.  vi /usr/local/share/gems1.9/gems/facter-1.7.5/lib/facter/ec2.rb
    1. change line 28 to:
      1. if (Facter::Util::EC2.can_connect?)
    2. Reference: http://projects.puppetlabs.com/issues/7559
    3. existing line 28 is much longer
 If you manage user passwords with Puppet
  1. yum -y install ruby19-devel
  2. yum -y groupinstall "Developer Tools"
  3. gem install --no-rdoc --no-ri ruby-shadow

Friday, 24 January 2014

Change email contents display font size of Thunderbird

Thunderbird email contents display appears to act similarly to a web brower, so hitting Ctrl and the '-'/'+' signs shrinks/enlarges the font size.

Note: this is not explained anywhere, and the preferences all change a different setting, AFAIK

Friday, 17 January 2014

MacBook and Openbox: mimic keyboard shortcut Cmd-tab application switcher

    <keybind key="W-Tab">
      <action name="NextWindow">
        <allDesktops>yes</allDesktops>
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>
    <keybind key="W-S-Tab">
      <action name="PreviousWindow">
        <finalactions>
          <action name="Focus"/>
          <action name="Raise"/>
          <action name="Unshade"/>
        </finalactions>
      </action>
    </keybind>

Macbook Air and Openbox: copy the Spotlight(TM) keyboard shortcut

    <keybind key="W-space">
      <action name="Execute">
        <command>dmenu_run</command>
      </action>
    </keybind>


apt-get install suckless-tools

LXC and Puppet dev env in 60 seconds


  1. lxc-create -n puppetmaster01 -t debian
  2. lxc-create -n puppetclient01 -t debian
  3. /etc/default/lxc-net
    1. find subnet defined by LXC_NETWORK
  4. vi /var/lib/lxc/puppetmaster01/config
    1. add ip addr ending in .100 to subnet
      1. for example, lxc.network.ipv4 = 10.0.1.100/24
  5. vi /var/lib/lxc/puppetclient01/config
    1. add ip add ending in .101 to subnet
      1. for example, lxc.network.ipv4 = 10.0.1.101/24
  6. lxc-start -d -n puppetmaster01
    1. don't forget the "-d" or you'll be stuck in tty session
  7. lxc-start -d -n puppetclient01
  8. lxc-attach -n puppetmaster
    1. apt-get install puppetmaster
  9. lxc-attach -n puppetclient01
    1. apt-get install puppet
    2. vi /etc/hosts and add entry "puppet" to point at pmaster
WARNING: for distro "saucy" as your container/host system, dnsmasq is broken, vms can not get DHCP IP address from dnsmasq. To attempt to fix, try:
  1. sudo iptables -t mangle -A POSTROUTING -o lxcbr0 -p udp --dport bootpc -j CHECKSUM --checksum-fill
  2. refresh vm IP
    1. stop and start vm, 
    2. or kill existing dhclient process on vm, and run dhclient by hand
      1. pkill dhclient
      2. dhclient -v eth0
  3. If that doesn't help your vm to get an IP address from dnsmasq
    1. delete the iptables rule you just created
      1. iptables -L -t mangle -n --line-numbers
        1. show existing rule numbers in left column
      2. iptables -t mangle -D POSTROUTING <rule #>
        1. for example, iptables -t mangle -D POSTROUTING 1


Sunday, 5 January 2014

Macbook Air and Openbox: Raise/Lower Volume, Up/Down Brightness

    <keybind key="XF86KbdBrightnessUp">
      <action name="Execute">
        <command>xbacklight +10</command>
      </action>
    </keybind>
    <keybind key="XF86KbdBrightnessDown">
      <action name="Execute">
        <command>xbacklight -10</command>
      </action>
    </keybind>
    <keybind key="XF86AudioRaiseVolume">
      <action name="Execute">
        <command>amixer -c 0 set Master 2dB+</command>
      </action>
    </keybind>
    <keybind key="XF86AudioLowerVolume">
      <action name="Execute">
        <command>amixer -c 0 set Master 2dB-</command>
      </action>
    </keybind>

Interview questions: 2020-12

Terraform provider vs provisioner Load balancing Network Load Balancer vs Application Load Balancer  Networking Layer 1 vs Layer 4 haproxy u...