Posts

Showing posts from 2013

SSID design considerations with multiple band access point

I have a Netgear WNDAP360 ap which is pretty hard core for home use.  It was an upgrade from a previous netgear prosafe ap that just 802.11b/g.  The WNDAP360 is 802.11a/b/g/n and supports dual radio data pathing for much faster throughput. When I had just the single radio AP I used 2 different SSIDs, one for the trusted wireless network at home and one for the untrusted.  Why 2 for home?  Well, when family members visit with Microsoft boxes they clearly get put on untrusted, while Linux and Apple generally go on the trusted side. So when I implemented the dual radio AP, I initially created SSIDs with the same name on each of the different radios.  So for the A radio, I used untrusted and trusted SSIDs.  Then on the B radio, I used untrusted and trusted.  I figured that devices would happily discover both untrusted and both trusted and pick the radio that was the fastest.  In practice however, that was not the case.  Devices seemed to lock the SSID name to a particular band which re

Fedora 19, Nvidia proprietary driver, control-c

https://bugzilla.redhat.com/show_bug.cgi?id=1028272 Recently hit this bug where terminals (urxvt256c) were not getting the ^C interrupt.  It is amazing how many times you use this combination in normal work. The Redhat guys think it is the Nvidia driver which sucks, but at least there is work around.  I used a script to start my xterms so I just added an intermediate shell call. New script for xfce4 to call: ~/bin/generic/run-urxvt #!/bin/bash # wrapper to work around ^C bug exec /bin/csh -c "$0.real $@" Which calls: ~/bin/generic/run-urxvt.real #!/bin/bash cd || ( echo "can't cd to ${HOME}" > /dev/console; exit 127) COLOR[0]=cyan COLOR[1]=green COLOR[2]=orange COLOR[3]=red COLOR[4]=white COLOR[5]=yellow COLOR[6]=lightskyblue COLOR[7]=#B94949 COLOR[8]=#FDCB54 COLOR[9]=mistyrose COLOR[10]=GhostWhite COLOR[11]=khaki COLOR[12]=SlateGray COLOR[13]=mediumaquamarine COLOR[14]=#7459C5 COLOR[15]=violet COLOR[16]=orang

When VNC through systemd/xinetd fails

So there has been a lot of updates to KDM and GDM as of late in the Fedora line.  This has broken my ability to use xinetd for automatic VNC starting.  The problem is that the display manager never gives me a prompt.  So I have had to fall back to manual processes. From your local box: ssh <normal options> -L 5901:127.0.0.1:5901 (on the remote box) vncpasswd screen Xvnc -geometry 1280x720 -desktop remotedesktop -NeverShared -SecurityTypes VncAuth -PasswordFile ~/.vnc/passwd :1 ^ac lxsession -d :1 ## or your favorite wm vncviewer -PreferredEncoding Tight localhost:5901

Sun Java memory fun with logstash

I am working on a distributed logstash deployment in AWS. I'm using the Elasticcache-Redis provided by AWS as the store between the syslog receiver and the elasticcache writer (aka the worker). I keep getting OOM errors on the worker like this {:timestamp=>"2013-10-22T08:18:58.592000+0000", :message=>"Failed to flush outgoing items", :outgoing_count=>34, :exception=>java.lang.OutOfMemoryError: Java heap space, :backtrace=>[], :level=>:warn} I was aware of the ability to change the heapsize allocated to the jvm, but wasn't sure how to find it.  Luckily google helped.  I took the command line I was using to run elasticsearch and compared how the 3 settings affected the defaults java -Xms512m -Xmx512m -Xss256k -XX:+PrintFlagsFinal -version > /tmp/1 java -XX:+PrintFlagsFinal -version > /tmp/2 diff /tmp/1 That helped me figure out which default settings were important. Now, I just have to figure out how to give logstash enough

ipcalc where have you been hiding

Somehow I've lived this long and never stumbled upon ipcalc.  It made scripting a secondary interface and route file very easy. I wanted to be able to dynamically configure /etc/sysconfig/network-scripts/route-eth1 during boot.  I was working on my own convoluted sed script to get the right values, but ipcalc was already there and simplified my work. Normally, I'd put something like: ADDRESS0=6.6.1.0 NETMASK0=255.255.255.0 GATEWAY0=6.6.1.1 But in Amazon, some of these values can vary and for puppet to be able to distribute to any of my environments across my AZs: VPC_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${ETH0_MAC}/vpc-ipv4-cidr-block" SUBNET_CIDR_URI="http://169.254.169.254/latest/meta-data/network/interfaces/macs/${ETH1_MAC}/subnet-ipv4-cidr-block" ADDRESS0=`ipcalc -n ${VPC_CIDR_RANGE} | sed -e's/^NETWORK/ADDRESS0/'` NETMASK0=`ipcalc -m ${VPC_CIDR_RANGE} | sed -e's/^NETMASK/NETMASK0/'` GAT

Getting tab copy and paste right with rxvt-unicode option

I  have always liked xterm, but moved to rxvt years ago for a couple of its features.  Recently I moved to urxvt256c for all my terminal needs. When I use the AWS cli tools, which output tabs as whitespace, my double click selection has started including the tabs.  Maybe it has done this for a while, I don't know exactly when it started, but it is annoying since a double click selection which grabs a tab can screw up a command line paste if there is 1 file in the directory. So you get: ssh $(i2ip thisisthe1localfile.txt i-1234567) instead of ssh $(i2ip i-1234567) thanks to bash's autocomplete. After some googling I found what I should have found originally: https://github.com/jhelwig/rxvt-unicode-ppa/blob/master/doc/rxvt.1.pod -ptab|+ptab If enabled (default), "Horizontal Tab" characters are being stored as actual wide characters in the screen buffer, which makes it possible to select and paste them. Since a horizontal tab is a cursor movement and not an

Bash functions to simply finding instance IPs when using AWS CLI

We have both EC2 and VPC nodes. Sometimes it is convenient to run bash commands without having to copy and paste the values from the WebUI. Here are a couple of bash functions to do that: function i2ip () {   local NAME="$1"   local IP   for IP in `ec2-describe-instances --filter instance-state-name=running --filter instance-id=${NAME:?MISSING_VALUE} | grep ^INSTANCE | awk '{ if ( $4 ~ /^ec2/ ) print $4; else print $12; }'` ; do   echo ${IP}   done } function n2ip () {   local NAME="$1"   local IP   for IP in `ec2-describe-instances --filter instance-state-name=running --filter tag:Name=${NAME:?MISSING_VALUE} | grep ^INSTANCE | awk '{ if ( $4 ~ /^ec2/ ) print $4; else print $12; }'` ; do   echo ${IP}   done } you might do something like this: rsync -av --progress logstash $(n2ip rpmbuild-node):/tmp/. where "rpmbuild-node" was the value of a tag "Name" on the instance. I decided to return all of the values so I could handle t

YAML Syntax Highlighting in gedit

Reference URLS: http://blog.dentcat.com/2009/09/highlighting-yaml-in-gedit_02.html http://codesauce.com/posts/gedit3-yaml-syntax-highlighting/ http://superuser.com/questions/353391/custom-gedit-syntax-highlighting-for-dummies sudo yum install subversion cd /tmp && svn checkout http://masood.googlecode.com/svn/trunk/yaml-language-spec/ cd yaml-language-spec/ sudo cp yaml.lang /usr/share/gtksourceview-3.0/language-specs/ sudo chmod 644 /usr/share/gtksourceview-3.0/language-specs/yaml.lang

The importance of /var/lock/subsys

I was experimenting with shutdown scripts today when I discovered the importance of the /var/lock/subsys  directory. I didn't realize that there was code in /etc/rc that checked for the existence of a lock file before trying to stop a service.  I guess I never had need to really look at this before.  I banged my head repeated only why the K* scripts I had created weren't working.  Until I finally looked at /etc/rc and realized it was only executing K* scripts for services that had touch /var/lock/subsys/<SERVICENAME>. Duh, should have looked there first.

Fedora 17 on Dell 530s

yum -y update (umask 022; sudo http_proxy=http://proxy:3128 ftp_proxy=http://proxy:3128 yum install yum-plugin-fastestmirror yum-plugin-{downloadonly,keys,priorities,remove-with-leaves,show-leaves,verify} nedit rxvt-unicode-256color xscreensaver\* xorg\*font\*Type1 xorg\*font\*misc screen dump rxvt rxvt-unicode-256color) yum groupinstall LXDE yum install kernel-devel gcc bison vi /etc/yum.repos.d/google-chrome.repo [google-chrome] name=google-chrome baseurl=http://dl.google.com/linux/chrome/rpm/stable/x86_64 enabled=1 gpgcheck=1 gpgkey=https://dl-ssl.google.com/linux/linux_signing_key.pub chmod 644  /etc/yum.repos.d/google-chrome.repo chown root:root  /etc/yum.repos.d/google-chrome.repo yum install google-chrome-stable sudoedit /etc/default/grub # s/rhgb quiet/verbose/ sudo grub2-mkconfig -o /boot/grub2/grub.cfg (umask 022; sudo yum -y groupinstall "Development Tools" "Development Libraries") Installing virtualbox curl http://download.virtua