Thursday, October 17, 2013

Plotting Multiple Lines in GNUplot.

The end goal is to take a comma separated file and plot each value on a line graph using Gnuplot.  Nice X and Y axis labels and a color coded key will be included.   


The input file (wireless-devices2.csv) looks like this:

1377617462, 73, 251, 262, 633, 708, 1476, 454, 386, 466, 145, 608, 294, 895, 606, 336, 7612
1377617753, 69, 238, 263, 610, 692, 1392, 445, 378, 453, 135, 645, 280, 914, 613, 357, 7504
1377618054, 71, 218, 257, 601, 681, 1399, 439, 377, 398, 126, 630, 298, 933, 598, 363, 7408
1377618348, 60, 205, 259, 595, 686, 1412, 441, 363, 394, 131, 680, 299, 948, 601, 366, 7462
1377618649, 70, 209, 268, 595, 679, 1429, 419, 358, 394, 126, 662, 314, 946, 622, 376, 7485
1377618958, 76, 228, 268, 632, 683, 1420, 415, 369, 419, 128, 669, 314, 957, 643, 378, 7617
1377619259, 75, 232, 264, 663, 681, 1414, 422, 389, 439, 140, 724, 317, 962, 642, 374, 7758
1377619555, 80, 247, 268, 669, 687, 1397, 421, 405, 476, 140, 712, 342, 981, 645, 364, 7852
1377619854, 88, 255, 266, 671, 687, 1377, 425, 403, 491, 133, 749, 360, 1000, 658, 365, 7946
1377620161, 96, 253, 259, 666, 669, 1331, 416, 421, 522, 151, 777, 364, 996, 682, 378, 8000

The Gnuplot configuration (wd-total.gnuplot) file looks like this:

set datafile separator ","
set terminal png size 2000,600
set title "Wireless Users"
set ylabel "Wireless Users"
set ytics autofreq 500
set xlabel "Date"
set xdata time
set timefmt "%s"
set format x "%m/%d"
set key left top horizontal
set grid
plot "wireless-devices2.csv" using 1:2 with lines title 'Broken Device', \
  "wireless-devices2.csv" using 1:3 with lines title 'Meru Guest', \
  "wireless-devices2.csv" using 1:4 with lines title 'Meru WUFI', \
  "wireless-devices2.csv" using 1:5 with lines title 'Meru WUFI-S', \
  "wireless-devices2.csv" using 1:6 with lines title 'S40 wustl-guest-1.0', \
  "wireless-devices2.csv" using 1:7 with lines title 'S40 wustl-1.0', \
  "wireless-devices2.csv" using 1:8 with lines title 'S40 wustl-encrypted-1.0', \
  "wireless-devices2.csv" using 1:9 with lines title 'wustl-guest-1.0', \
  "wireless-devices2.csv" using 1:10 with lines title 'wustl-1.0', \
  "wireless-devices2.csv" using 1:11 with lines title 'wustl-encrypted-1.0', \
  "wireless-devices2.csv" using 1:12 with lines title 'Cisco WUFI-S', \
  "wireless-devices2.csv" using 1:13 with lines title 'Cisco WUFI', \
  "wireless-devices2.csv" using 1:14 with lines title 'wustl-2.0', \
  "wireless-devices2.csv" using 1:15 with lines title 'wustl-guest-2.0', \
  "wireless-devices2.csv" using 1:16 with lines title 'wustl-encrypted-2.0', \
  "wireless-devices2.csv" using 1:17 with lines lw 3 title 'TOTAL'


From the command line execute Gnuplot with the configuration file and image redirection as follows:


$ gnuplot < wd-total.gnuplot > wirelessdevices.png

The resulting file should look like this:








Wednesday, October 2, 2013

Apache + StartSSL + SSL (Free SSL for Everyone) or why every site should be SSL enabled.

Quick reference for getting a StartSSL certificate on Apache and Ubuntu server.

0) Review how to enable SSL in Apache first: https://help.ubuntu.com/lts/serverguide/httpd.html#https-configuration

1) Generate the SSL CSR (certificate signing request) with no password:
openssl req -new -newkey rsa:2048 -nodes -keyout server.key -out server.csr

2a) Go to http://startssl.com

2b) Click Control Panel -> Validations Wizard -> Domain Validation (you must validate your domain first)

2c) Click Control Panel -> Certificate Wizard (skip automatic generation, paste the server.csr generated from the step 1, select your domain, enter additional domain names)

3) Copy the newly created server certificate from the website to a file called server.crt

4) Download the StartSSL CA bundel from: https://www.startssl.com/certs/sub.class1.server.ca.pem

5) Copy all the new files to the /etc/ssl directory:
cp server.key server.crt server.csr sub.class1.server.ca.pem /etc/ssl

6) Configure Apache with the following lines:
SSLCertificateFile "/etc/ssl/server.crt"
SSLCertificateKeyFile "/etc/ssl/server.key"
SSLCACertificateFile "/etc/ssl/sub.class1.server.ca.pem"

7) Restart Apache.

Use Puppet to manage iptables

I have made some updates to the puppet module to manage iptables on Ubuntu and RedHat.   Updates can be found here:

https://github.com/duxklr/iptables


There is still a lot more polishing that needs to be done.



Followers

Contributors