Showing posts from 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'.
 as remote root on myhostyum install tigervncyum install tigervnc-serveryum install libXfont pixmanyum install fluxboxyum install firefoxas a remote user, myuser, on myhostvncserver :66 -localhostset a password, call it mypasswordas local userssh -L 5966:localhost:5966myuser@myhostleave running and do next step in another local termvncviewer -encodings 'copyrect tight zrle hextile' localhost:5966authenticate with mypasswordas a remote user, myuser, on myhostexport DISPLAY=:66xterm &fluxbox &firefox &


sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillicsudo apt-get install xvfbsudo apt-get install xtightvncviewerapt-get install x11vncsudo apt-get install fluxboxexport DISPLAY=:1Xvfb :1 -screen 0 1024x768x16 &fluxbox &x11vnc -display :1 -bg -nopw -listen localhost -xkbexport DISPLAY=:0vncviewer -encodings 'copyrect tight zrle hextile' localhost:5900you should see fluxbox running within another window which you can navigatetry, for funexport DISPLAY=:1xtermpkill fluxboxfluxbox & Gets weirder close the above vncviewer windowx11vnc -display :1 -bg -nopw -listen localhost -xkbx11vnc -display :1 -bg -nopw -listen localhost -xkbx11vnc -display :1 -bg -nopw -listen localhost -xkbvncviewer -encodings 'copyrect tight zrle hextile' localhost:5900vncviewer -encodings 'copyrect tight zrle hextile' localhost:5901vncviewer -encodings 'copyrect tight zrle hextile' localhost:5902 Launch apps in the new display sudo apt-get install…

Zenoss: multi-graph report

Note: used version 3.x, other version nav my vary slightly
Make a groupcreate a new group under Infrastructurename it group001drag-and-drop a bunch of related servers into itReports -> Multi-Graph Reports, left-navAdd Multi-Graph Report, bottom left-nav '+' signname it report001CollectionsAdd Collectiondef: a collection is just a previously defined set of deviceslike your group001name it collection001Group, in drop-downclick on group001Add to Collectionnav in 3.x sucks, click back on report nameupper middle-nav "breadcrumb"Graph DefinitionsAdd Graphname it graph001Graph PointsAdd DataPointlaLoadInt15_laLoadInt15hard to go wrong with this data pointlater, you can explore othersnaming can be very, very uglye.g. os/interfaces/eth0/ifOutOctets_ifOutOctetsnav sucks, click back on report name in breadcrumbGraph GroupsAdd Graph Groupname it graphgroup001selectcollection: collection001graph definition: graph001method: All devices on single graphsavenav sucks, click back o…

tsunami-udp: faster than rsync

buildsudo apt-get install git gccsudo apt-get install automake autoconfgit clone git:// tsunami-udp./recompile.shsudo make installrunyou'll need a port open to allow direct connection from client to serverunfortunately, this doesn't work through NAT firewalls alonefirewall / port forwardingto server, TCP, 46224 by defaultto client, UDP, 46224 by defaultstart up servertsunamid myfile.gzconnect with clienttsunami set rate 5M connect get myfile.gzit will flood your connection if you dont set rate properlydocumentation files automaticallyallows wildcards when running server and client commands, "*", namelyclient will auto-find all files served, one after the nextuse forward-slash, i.e. get \*, for client command so bash doesn't intrepret the asteriskundocumenteddoesn't do subdirectories, better tar that up and have plenty of disk sp…

bash substring matching

#!/bin/bash[[ "$(hostname -s)" =~ $'dev' ]] && exitecho "we are not a dev host"

telnet vs netcat

netcatprints only what is sent by the remote hosttelnetnot suitable for arbitrary binary data reserves some bytes as control characters quits when its input runs outyou may not see what the other end sendsdoesn't do UDP

Fix bad/wrong aclocal version during make

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


Exclude domains in your google search results

Put '-' in front of 'site:' operatore.g.Try: how to learn tibco -site:tibcommunity.comsearches for materials on "how to learn tibco" while ignoring all Tibco's noise FYI: It seems there is a copyright, so searching for "SOA" instead might lead to more books with desired material covered.

Out of inodes: file write error (No space left on device)

df -hiproves you are out of inodes or notcause is most likely tons of small files in some "problem directory", poke aroundfind <random_dir> -type f | wc -lgive a count of file in that subdircommon problem dirs/var/spool/<XYZ>/tmpfind <problem_dir> -type f -deletedeletes one file at a timerm will get stuck finding files first if you use wildcard like *

git push/pull just current branch

git config --global push.default trackinggit config --global pull.default tracking FYI, these settings are saved in ~/.gitconfig

Zenoss: Linux SSH commands

On CLIsu - zenosszenpack --listwget --install ZenPacks.zenoss.LinuxMonitor-1.1.5-py2.6.eggwget zenpack --install zenoss so all stuff is picked upshouldn't be necessary, but Monitoring Templates were missing/erroring for me withoutVia web interfaceDrag-and-drop server from Device list into Interface -> Device classes -> Server -> SSH -> LinuxSet that servers Configuration PropertieszCommandUsernamezCommandPasswordThis requires that you have at least one user that can SSH in via a password

dead simple irc gui client

apt-get install lostirc

Fetch Cassandra keyspaces and column families from nodetool command via Ruby


require 'logger'

log ='/var/log/cassandra/repair.log', 'daily')
log.level = Logger::INFO
log.datetime_format = "%Y-%m-%d %H:%M:%S"

keyspaces = {}

result = %x[nodetool cfstats | egrep 'Keyspace:|Column Family:']
result = result.gsub(/\s/, '')

result.split("Keyspace:").each do | keyspace |
  keyname = keyspace.split("ColumnFamily:")[0]
  next if (keyname == nil)
  next if (keyname == 'OpsCenter' or keyname == 'system')
  cfs = keyspace.split("ColumnFamily:").drop(1)
  keyspaces[keyname] = cfs

keyspaces.keys.each {|x|
  keyspaces[x].each do |y|"Repair start: #{x} #{y}")
#    result = %x[nodetool getcompactionthreshold #{x} #{y}]
#"Repair end: #{x} #{y}")