Thursday, 27 June 2013

Redhat: vnc to remote server

NOTE: if the vncserver insists on starting on a port other than 5966, like 6099, wipe the ~/.vnc directory and start over again. If that doesn't help, change the second instance of 5966 below to 6066 in the port forwarding ssh command, e.g. '-L 5966:localhost:6066'.
  1.  as remote root on myhost
    1. yum install tigervnc
    2. yum install tigervnc-server
    3. yum install libXfont pixman
    4. yum install fluxbox
    5. yum install firefox
  2. as a remote user, myuser, on myhost
    1. vncserver :66 -localhost
      1. set a password, call it mypassword
  3. as local user
    1. ssh -L 5966:localhost:5966 myuser@myhost
      1. leave running and do next step in another local term
    2. vncviewer -encodings 'copyrect tight zrle hextile' localhost:5966
      1. authenticate with mypassword
  4. as a remote user, myuser, on myhost
    1. export DISPLAY=:66
    2. xterm &
    3. fluxbox &
    4. firefox &

Wednesday, 26 June 2013

xvfb


  1. sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
  2. sudo apt-get install xvfb
  3. sudo apt-get install xtightvncviewer
  4. apt-get install x11vnc
  5. sudo apt-get install fluxbox
  6. export DISPLAY=:1
  7. Xvfb :1 -screen 0 1024x768x16 &
  8. fluxbox &
  9. x11vnc -display :1 -bg -nopw -listen localhost -xkb
  10. export DISPLAY=:0
  11. vncviewer -encodings 'copyrect tight zrle hextile' localhost:5900
  12. you should see fluxbox running within another window which you can navigate
  13. try, for fun
    1. export DISPLAY=:1
    2. xterm
    3. pkill fluxbox
    4. fluxbox &
Gets weirder
  1. close the above vncviewer window
  2. x11vnc -display :1 -bg -nopw -listen localhost -xkb
  3. x11vnc -display :1 -bg -nopw -listen localhost -xkb
  4. x11vnc -display :1 -bg -nopw -listen localhost -xkb
  5. vncviewer -encodings 'copyrect tight zrle hextile' localhost:5900
  6. vncviewer -encodings 'copyrect tight zrle hextile' localhost:5901
  7. vncviewer -encodings 'copyrect tight zrle hextile' localhost:5902
Launch apps in the new display
  1. sudo apt-get install firefox
  2. DISPLAY=:1 firefox &
Note: if vncviewer is not available on the CLI, use xtightvncviewer instead, same thing

See: http://en.wikipedia.org/wiki/Xvfb

Tuesday, 25 June 2013

Zenoss: multi-graph report


Note: used version 3.x, other version nav my vary slightly
  1. Make a group
    1. create a new group under Infrastructure
    2. name it group001
    3. drag-and-drop a bunch of related servers into it
  2. Reports -> Multi-Graph Reports, left-nav
    1. Add Multi-Graph Report, bottom left-nav '+' sign
      1. name it report001
      2. Collections
        1. Add Collection
          1. def: a collection is just a previously defined set of devices
            1. like your group001
          2. name it collection001
            1. Group, in drop-down
            2. click on group001
            3. Add to Collection
        2. nav in 3.x sucks, click back on report name
          1. upper middle-nav "breadcrumb"
      3. Graph Definitions
        1. Add Graph
          1. name it graph001
          2. Graph Points
            1. Add DataPoint
              1. laLoadInt15_laLoadInt15
                1. hard to go wrong with this data point
                2. later, you can explore others
                3. naming can be very, very ugly
                  1. e.g. os/interfaces/eth0/ifOutOctets_ifOutOctets
          3. nav sucks, click back on report name in breadcrumb
      4. Graph Groups
        1. Add Graph Group
          1. name it graphgroup001
          2. select
            1. collection: collection001
            2. graph definition: graph001
            3. method: All devices on single graph
            4. save
        2. nav sucks, click back on report name in breadcrumb
    2. View Report, upper, upper left-nav
      1. should see some points plotted on a graph for all servers in your "group
      2. one can always go back to reports main screen to view report

Wednesday, 19 June 2013

tsunami-udp: faster than rsync


  1. build
    1. sudo apt-get install git gcc
    2. sudo apt-get install automake autoconf
    3. git clone git://github.com/rriley/tsunami-udp.git
    4. cd tsunami-udp
    5. ./recompile.sh
    6. sudo make install
  2. run
    1. you'll need a port open to allow direct connection from client to server
      1. unfortunately, this doesn't work through NAT firewalls alone
      2. firewall / port forwarding
        1. to server, TCP, 46224 by default
        2. to client, UDP, 46224 by default
    2. start up server
      1. tsunamid myfile.gz
    3. connect with client
      1. tsunami set rate 5M connect myserver.domain.com get myfile.gz
      2. it will flood your connection if you dont set rate properly
  3. documentation
    1. http://tsunami-udp.cvs.sourceforge.net/viewvc/tsunami-udp/docs/USAGE.txt
    2. splits files automatically
    3. allows wildcards when running server and client commands, "*", namely
      1. client will auto-find all files served, one after the next
      2. use forward-slash, i.e. get \*, for client command 
        1. so bash doesn't intrepret the asterisk
  4. undocumented
    1. doesn't do subdirectories, better tar that up and have plenty of disk space

Tuesday, 18 June 2013

bash substring matching


  1. #!/bin/bash
  2. [[ "$(hostname -s)" =~ $'dev' ]] && exit
  3. echo "we are not a dev host"

Monday, 17 June 2013

telnet vs netcat


  1. netcat
    1. prints only what is sent by the remote host
  2. telnet
    1. not suitable for arbitrary binary data 
      1. reserves some bytes as control characters 
    2. quits when its input runs out
      1. you may not see what the other end sends
    3. doesn't do UDP

Friday, 14 June 2013

Fix bad/wrong aclocal version during make


  1. autoreconf -fi
    1. updates generated configuration files
This was necessary when building tsunami-udp from cvs repository, the configure files were old/incompatible.

Taken: http://stackoverflow.com/questions/8865093/should-a-configure-script-be-distributed-if-configure-ac-is-available

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...