Posts

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 &

xvfb

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://github.com/rriley/tsunami-udp.gitcd 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 myserver.domain.com get myfile.gzit will flood your connection if you dont set rate properlydocumentationhttp://tsunami-udp.cvs.sourceforge.net/viewvc/tsunami-udp/docs/USAGE.txtsplits 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.

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

Exclude domains in your google search results

Put '-' in front of 'site:' operatore.g.Try: how to learn tibco -site:tibco.com -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 http://community.zenoss.org/servlet/JiveServlet/download/3435-6-2917/ZenPacks.zenoss.LinuxMonitor-1.1.5-py2.6.egg.zipunzipzenpack --install ZenPacks.zenoss.LinuxMonitor-1.1.5-py2.6.eggwget http://community.zenoss.org/servlet/JiveServlet/download/3493-6-3219/ZenPacks.community.LinuxMonitorAddOn-1.0-py2.6.egg.zipunzip zenpack --install ZenPacks.community.LinuxMonitorAddOn-1.0-py2.6.eggRestart 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

#!/usr/bin/ruby

require 'logger'

log = Logger.new('/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/, '')
#log.debug(result.inspect)

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

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