- as remote root on myhost
- yum install tigervnc
- yum install tigervnc-server
- yum install libXfont pixman
- yum install fluxbox
- yum install firefox
- as a remote user, myuser, on myhost
- vncserver :66 -localhost
- set a password, call it mypassword
- as local user
- ssh -L 5966:localhost:5966 myuser@myhost
- leave running and do next step in another local term
- vncviewer -encodings 'copyrect tight zrle hextile' localhost:5966
- authenticate with mypassword
- as a remote user, myuser, on myhost
- export DISPLAY=:66
- xterm &
- fluxbox &
- firefox &
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'.
Wednesday, 26 June 2013
xvfb
- sudo apt-get install xfonts-100dpi xfonts-75dpi xfonts-scalable xfonts-cyrillic
- sudo apt-get install xvfb
- sudo apt-get install xtightvncviewer
- apt-get install x11vnc
- sudo apt-get install fluxbox
- export DISPLAY=:1
- Xvfb :1 -screen 0 1024x768x16 &
- fluxbox &
- x11vnc -display :1 -bg -nopw -listen localhost -xkb
- export DISPLAY=:0
- vncviewer -encodings 'copyrect tight zrle hextile' localhost:5900
- you should see fluxbox running within another window which you can navigate
- try, for fun
- export DISPLAY=:1
- xterm
- pkill fluxbox
- fluxbox &
Gets weirder
- close the above vncviewer window
- x11vnc -display :1 -bg -nopw -listen localhost -xkb
- x11vnc -display :1 -bg -nopw -listen localhost -xkb
- x11vnc -display :1 -bg -nopw -listen localhost -xkb
- vncviewer -encodings 'copyrect tight zrle hextile' localhost:5900
- vncviewer -encodings 'copyrect tight zrle hextile' localhost:5901
- vncviewer -encodings 'copyrect tight zrle hextile' localhost:5902
- sudo apt-get install firefox
- DISPLAY=:1 firefox &
Note: if vncviewer is not available on the CLI, use xtightvncviewer instead, same thing
See: http://en.wikipedia.org/wiki/Xvfb
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
- Make a group
- create a new group under Infrastructure
- name it group001
- drag-and-drop a bunch of related servers into it
- Reports -> Multi-Graph Reports, left-nav
- Add Multi-Graph Report, bottom left-nav '+' sign
- name it report001
- Collections
- Add Collection
- def: a collection is just a previously defined set of devices
- like your group001
- name it collection001
- Group, in drop-down
- click on group001
- Add to Collection
- nav in 3.x sucks, click back on report name
- upper middle-nav "breadcrumb"
- Graph Definitions
- Add Graph
- name it graph001
- Graph Points
- Add DataPoint
- laLoadInt15_laLoadInt15
- hard to go wrong with this data point
- later, you can explore others
- naming can be very, very ugly
- e.g. os/interfaces/eth0/ifOutOctets_ifOutOctets
- nav sucks, click back on report name in breadcrumb
- Graph Groups
- Add Graph Group
- name it graphgroup001
- select
- collection: collection001
- graph definition: graph001
- method: All devices on single graph
- save
- nav sucks, click back on report name in breadcrumb
- View Report, upper, upper left-nav
- should see some points plotted on a graph for all servers in your "group
- one can always go back to reports main screen to view report
Labels:
collections,
data point,
datapoint,
graph points,
mulit-graph,
multi-point,
report,
reports,
sucks,
zenoss
Wednesday, 19 June 2013
tsunami-udp: faster than rsync
- build
- sudo apt-get install git gcc
- sudo apt-get install automake autoconf
- git clone git://github.com/rriley/tsunami-udp.git
- cd tsunami-udp
- ./recompile.sh
- sudo make install
- run
- you'll need a port open to allow direct connection from client to server
- unfortunately, this doesn't work through NAT firewalls alone
- firewall / port forwarding
- to server, TCP, 46224 by default
- to client, UDP, 46224 by default
- start up server
- tsunamid myfile.gz
- connect with client
- tsunami set rate 5M connect myserver.domain.com get myfile.gz
- it will flood your connection if you dont set rate properly
- documentation
- http://tsunami-udp.cvs.sourceforge.net/viewvc/tsunami-udp/docs/USAGE.txt
- splits files automatically
- allows wildcards when running server and client commands, "*", namely
- client will auto-find all files served, one after the next
- use forward-slash, i.e. get \*, for client command
- so bash doesn't intrepret the asterisk
- undocumented
- doesn't do subdirectories, better tar that up and have plenty of disk space
Tuesday, 18 June 2013
bash substring matching
- #!/bin/bash
- [[ "$(hostname -s)" =~ $'dev' ]] && exit
- echo "we are not a dev host"
Monday, 17 June 2013
telnet vs netcat
- netcat
- prints only what is sent by the remote host
- telnet
- not suitable for arbitrary binary data
- reserves some bytes as control characters
- quits when its input runs out
- you may not see what the other end sends
- doesn't do UDP
Friday, 14 June 2013
Fix bad/wrong aclocal version during make
- autoreconf -fi
- 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
Taken: http://stackoverflow.com/questions/8865093/should-a-configure-script-be-distributed-if-configure-ac-is-available
Thursday, 13 June 2013
Exclude domains in your google search results
- Put '-' in front of 'site:' operator
- e.g.
- Try: how to learn tibco -site:tibco.com -site:tibcommunity.com
- searches 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.
Monday, 10 June 2013
Out of inodes: file write error (No space left on device)
- df -hi
- proves you are out of inodes or not
- cause is most likely tons of small files in some "problem directory", poke around
- find <random_dir> -type f | wc -l
- give a count of file in that subdir
- common problem dirs
- /var/spool/<XYZ>
- /tmp
- find <problem_dir> -type f -delete
- deletes one file at a time
- rm will get stuck finding files first if you use wildcard like *
git push/pull just current branch
- git config --global push.default tracking
- git config --global pull.default tracking
Thursday, 6 June 2013
Zenoss: Linux SSH commands
- On CLI
- su - zenoss
- zenpack --list
- wget http://community.zenoss.org/servlet/JiveServlet/download/3435-6-2917/ZenPacks.zenoss.LinuxMonitor-1.1.5-py2.6.egg.zip
- unzip
- zenpack --install ZenPacks.zenoss.LinuxMonitor-1.1.5-py2.6.egg
- wget http://community.zenoss.org/servlet/JiveServlet/download/3493-6-3219/ZenPacks.community.LinuxMonitorAddOn-1.0-py2.6.egg.zip
- unzip
- zenpack --install ZenPacks.community.LinuxMonitorAddOn-1.0-py2.6.egg
- Restart zenoss so all stuff is picked up
- shouldn't be necessary, but Monitoring Templates were missing/erroring for me without
- Via web interface
- Drag-and-drop server from Device list into Interface -> Device classes -> Server -> SSH -> Linux
- Set that servers Configuration Properties
- zCommandUsername
- zCommandPassword
- This requires that you have at least one user that can SSH in via a password
Tuesday, 4 June 2013
Sunday, 2 June 2013
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
}
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
}
Subscribe to:
Posts (Atom)
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...
-
kubectl --cert=/tmp/tls.crt --key=/tmp/tls.key create secret tls tls-wc-ingress
-
apt-get install exim4 dpkg-reconfigure exim4-config Select: internet site; mail is sent and received directly using SMTP IP-addresses...
-
brew install python3 mkdir -p ~/bin/python3 python3 -m venv ~/bin/python3 source ~/bin/python3/bin/activate enjoy!