<?xml version="1.0" encoding="UTF-8"?>
<!--Generated by Squarespace Site Server v5.11.81 (http://www.squarespace.com/) on Thu, 09 Feb 2012 10:57:23 GMT--><rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:rss="http://purl.org/rss/1.0/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:cc="http://web.resource.org/cc/"><rss:channel rdf:about="http://www.morepackets.com/blog/"><rss:title>Blog</rss:title><rss:link>http://www.morepackets.com/blog/</rss:link><rss:description></rss:description><dc:language>en-IE</dc:language><dc:date>2012-02-09T10:57:24Z</dc:date><admin:generatorAgent rdf:resource="http://www.squarespace.com/">Squarespace Site Server v5.11.81 (http://www.squarespace.com/)</admin:generatorAgent><rss:items><rdf:Seq><rdf:li rdf:resource="http://www.morepackets.com/blog/2012/1/28/office-365-reclaiming-licenses.html"/><rdf:li rdf:resource="http://www.morepackets.com/blog/2011/5/1/clean-out-old-items-from-your-downloads-folder-using-find-cr.html"/><rdf:li rdf:resource="http://www.morepackets.com/blog/2011/3/13/ruby-script-remaining-mobile-bb-data-allowance.html"/><rdf:li rdf:resource="http://www.morepackets.com/blog/2011/2/18/troubleshooting-cisco-877-on-eircom-adsl2.html"/><rdf:li rdf:resource="http://www.morepackets.com/blog/2011/2/7/configuring-a-cisco-877-integrated-services-router-on-eircom.html"/><rdf:li rdf:resource="http://www.morepackets.com/blog/2011/2/4/collected-thoughts-on-ipv6.html"/><rdf:li rdf:resource="http://www.morepackets.com/blog/2011/1/22/my-attempt-at-a-nowplaying-app-for-mac-os-x.html"/><rdf:li rdf:resource="http://www.morepackets.com/blog/2010/7/16/opsviewnagios-check-for-blacknightie-status-page.html"/><rdf:li rdf:resource="http://www.morepackets.com/blog/2010/6/7/recovering-a-corrupt-ldap-db-on-os-x-server.html"/><rdf:li rdf:resource="http://www.morepackets.com/blog/2010/4/3/my-mifi.html"/></rdf:Seq></rss:items></rss:channel><rss:item rdf:about="http://www.morepackets.com/blog/2012/1/28/office-365-reclaiming-licenses.html"><rss:title>Office 365 : Reclaiming licenses</rss:title><rss:link>http://www.morepackets.com/blog/2012/1/28/office-365-reclaiming-licenses.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2012-01-28T21:25:53Z</dc:date><dc:subject>Office365 Scripting licensing msonline powershell</dc:subject><content:encoded><![CDATA[<p>Migrated to Office 365? Running low on licenses and want to do a review of existing license assignments?</p>
<p>In work, we recently had to do a reclamation of licenses from users who had left the company but had somehow managed to retain their licensing status in Office 365.</p>
<p>To help with this I created a powershell script that would get a list of disabled Active Directory accounts who had a UPN (UserPrincipalName) that was formatted for use in Office 365 and cross reference that with the list of licensed users in Microsoft Online Services. Surprisingly Microsoft haven't included something like this in the existing views. I'm sure it'll be added in an upgrade...</p>
<p>Behold the results! Make sure you change the UPN value being queried below as I'd be surprised if ye're using DOMAIN.COM! All comments and suggestions on improvements are welcome. I'm relatively new to Powershell.</p>
<pre class="brush: powershell">Import-Module ActiveDirectory
Import-Module msonline

Connect-MsolService -Credential (Get-Credential)

#$ErrorActionPreference = $SilentlyContinue

# Create counter and results array
[int]$i = 0
$results = @()

# Query AD for all accounts with UPN needed for Office365 that are disabled and save to array
$disabledUsers = Get-ADUser -Filter ({UserPrincipalName -like "*@DOMAIN.COM" -AND enabled -eq $false}) | select UserPrincipalName

# For all entries in $disabledUsers, query their licensing status on MS Online and save to $results
for ($i=0; $i -le ($disabledUsers.count-1); $i++) {
	$results += get-msoluser -UserPrincipalName $disabledUsers[$i].UserPrincipalName -ErrorAction SilentlyContinue
}
# For all $results where isLicensed is TRUE, output the DisplayName and License status
for ($i=0; $i -le ($results.count-1); $i++){
	if ($results[$i].isLicensed -eq "True"){
		$results[$i] | select DisplayName, IsLicensed 
	}
}
</pre>]]></content:encoded></rss:item><rss:item rdf:about="http://www.morepackets.com/blog/2011/5/1/clean-out-old-items-from-your-downloads-folder-using-find-cr.html"><rss:title>Clean out old items from your Downloads folder using find &amp; crontab</rss:title><rss:link>http://www.morepackets.com/blog/2011/5/1/clean-out-old-items-from-your-downloads-folder-using-find-cr.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2011-05-01T22:03:55Z</dc:date><dc:subject>Scripting bash crontab</dc:subject><content:encoded><![CDATA[<p>I got a bit lazy when it came to cleaning out my downloads folder. Old .DMG files, installer files and other detritus were bloating my Download folder so that the stack view in my Dock was becoming a pain to use.</p>
<p>I decided to adopt a bash script we run in the office at home to aid me in my quest for a tidy Downloads folder! By leveraging the find command in bash, a user can create a script that can find any files in a directory that match certain criteria, e.g. type, file name and date created/modified.</p>
<p>In my case, once found, the files will be deleted. Instead of using -mtime to determine age, you can also use -atime or -ctime. <a href="http://www.brandonhutchinson.com/ctime_atime_mtime.html">I'll leave it up to yourselves to read about that though</a>! For a downloads folder and maybe for different file types, &nbsp;-atime may be more appropriate for some of you. However, since I'm dealing with installer files, -mtime will suffice!</p>
<p>Once the script has been created, apply to your user crontab at whatever interval you so desire!</p>
<pre class="brush: bash">#!/bin/bash
#
# &nbsp; &nbsp; &nbsp; Delete files older than 21 days in Downloads.
#
echo "Deleting (M)PKG, DMG and ZIP files that are older than 21 days in Downloads."
&nbsp;
# Delete all (M)PKG's older than 21 days
find ~/Downloads/ -name "*.pkg" -type f -mtime +21 -delete
find ~/Downloads/ -name "*.mpkg" -type f -mtime +21 -delete
&nbsp;
# Delete all DMG's older than 21 days
find ~/Downloads/ -name "*.dmg" -type f -mtime +21 -delete
&nbsp;
# Delete all ZIP's older than 21 days
find ~/Downloads/ -name "*.zip" -type f -mtime +21 -delete
</pre>]]></content:encoded></rss:item><rss:item rdf:about="http://www.morepackets.com/blog/2011/3/13/ruby-script-remaining-mobile-bb-data-allowance.html"><rss:title>Ruby Script: Remaining Mobile BB Data Allowance</rss:title><rss:link>http://www.morepackets.com/blog/2011/3/13/ruby-script-remaining-mobile-bb-data-allowance.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2011-03-13T22:17:00Z</dc:date><dc:subject>Scripting mobile broadband ruby three</dc:subject><content:encoded><![CDATA[<p>I recently changed to Three.ie as my mobile broadband provider. They provide a nice handy way of checking remaining monthly data allowance via their "my3.three.ie" service. Signing in is handled automatically on their side based on the network you're using. Handy!</p>
<p>Since I've been messing around with Ruby a bit I figured I'd try and make a ruby script that would check my remaining data for me! My efforts are below!</p>
<p>Please comment on any improvements that you think I can make. Especially relating to the instance vs. class variables!</p>
<p>I use this script in combination with a bash script to display data on my desktop using GeekTool. The bash script attempts to ping the mobile gateway's IP address. If it is available, the ruby script is executed. Simples!</p>
<p>&nbsp;</p>
<p>&nbsp;</p>
<pre class="brush:bash">#!/bin/bash
#
#	Pings once to see if my Huawei B260a mobile gateway is reachable
#	if yes, execute Ruby data allowance checker
#	else, exit
#
ping -c 1 -t 2 192.168.4.1 &gt;/dev/null
if [[ $? == 0 ]]; then
	ruby ~/Programming/Ruby/MyStuff/threeMobileBroadband.rb
else
	exit
fi
</pre>
<p>&nbsp;</p>
<p>&nbsp;</p>
<pre class="brush:ruby">#!/usr/bin/env ruby
#
require 'rubygems'
require 'mechanize'

class ThreeMobileBroadband

@@baseURL = "https://my3.three.ie"
  
def login
  @agent = Mechanize.new

  # First Single Sign On page
  @landing1 = @agent.get 'https://my3.three.ie/myaccount/postPayFreeUnits.do'
  @landing2 = @agent.get @landing1.links[0].uri
  # Then click the continue button presented to get to account options section
  @@usagePage = @agent.post("#{@@baseURL}#{@landing2.forms[0].action}")
end

def getRemainingData
  # Parse for remaining data table
  @usageValue =  @@usagePage.parser.xpath('//div/div/div/div/table/tbody/tr/td').to_s
  # Get the data, and sub out HTML, then sub out whitespace, then split into array at a close bracket
  @data = @usageValue.gsub(/&lt;\/?[^&gt;]*&gt;/, "").gsub(/\s+/, "").split(/\)/)
  return @data[1]#.inspect
end

def remainingDataAsOf
  # Parse for caption containing the date &amp; time the remaining data was checked
  @asOfDate = @@usagePage.parser.xpath('//div/div/div/caption/span').to_s.gsub(/&lt;\/?[^&gt;]*&gt;/, "").gsub(/\*\s+/, "")
  return @asOfDate
end

end

three = ThreeMobileBroadband.new
three.login

puts "3 Mobile Broadband Pro"
puts "-----------"
puts "#{three.getRemainingData} MB remaining\n"
print "#{three.remainingDataAsOf}\n"
puts "-----------"
</pre>
<div></div>]]></content:encoded></rss:item><rss:item rdf:about="http://www.morepackets.com/blog/2011/2/18/troubleshooting-cisco-877-on-eircom-adsl2.html"><rss:title>Troubleshooting: Cisco 877 on Eircom ADSL2+</rss:title><rss:link>http://www.morepackets.com/blog/2011/2/18/troubleshooting-cisco-877-on-eircom-adsl2.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2011-02-18T16:26:30Z</dc:date><dc:subject>877 Networking adsl2+ annex m broadband business cisco eircom</dc:subject><content:encoded><![CDATA[<p>During the actual configuration of the Cisco 877s 2 weeks ago some issues arose which needed some debugging! All commands shown below were entered via global configuration mode.</p>
<p>&nbsp;</p>
<p><a title="Cisco 877 with a Linksys WAG160N on top! by f0ehammer, on Flickr" href="http://www.flickr.com/photos/john-long/5506361748/"><img src="http://farm6.static.flickr.com/5098/5506361748_2962718d94.jpg" alt="Cisco 877 with a Linksys WAG160N on top!" width="500" height="374" /></a></p>
<p><strong>DNS lookups and SSL connection issues:</strong></p>
<p>Initially we had some issues with DNS lookups and connections to SSL secured services like HTTP and IMAPS. It turned out that I had failed to alter the MTU values! I didn't actually think that I had to! My bad!</p>
<p>&nbsp;</p>
<p>The internal VLAN interfaces needed their maximum segment size (MSS) values &nbsp;adjusted to compensate for the 8 extra bytes needed by the PPPoE header.</p>
<blockquote>
<pre>int vlan1</pre>
<pre>ip tcp adjust-mss&nbsp;1452</pre>
<pre>exit</pre>
</blockquote>
<p>The GRE tunnel interfaces also needed some adjustment. This presented as being unable to access services on the other end of the VPN. Again, the MSS values needed to be lowered to account for the GRE header and IPsec headers.</p>
<p>&nbsp;</p>
<blockquote>
<pre>int tun0</pre>
<pre>ip tcp adjust-mss 1300</pre>
<pre>exit</pre>
</blockquote>
<p>&nbsp;</p>
<p><strong>ADSL2+ sync problems</strong></p>
<p><strong><span style="font-weight: normal;">There was also some issues getting DSL sync and proper downstream/upstream speeds. Initially, with the ATM interface set to automatic, it was only getting 7meg down. To achieve the full speed I set the DSL operating mode explicitly to ADSL2+.</span></strong></p>
<p>&nbsp;</p>
<p>Still no joy though! I lost DSL sync. This was countered by setting the DSL sync mode to ANSI on the ATM interface. Once that was done, the DSL sync'd and proper speeds were achieved.</p>
<p>Below are the commands used on the interface.</p>
<blockquote>
<pre>int atm0</pre>
<pre>dsl sync mode ansi</pre>
<pre>dsl operating-mode adsl2+</pre>
<pre>exit</pre>
</blockquote>]]></content:encoded></rss:item><rss:item rdf:about="http://www.morepackets.com/blog/2011/2/7/configuring-a-cisco-877-integrated-services-router-on-eircom.html"><rss:title>Configuring a Cisco 877 Integrated Services Router on Eircom Business Broadband</rss:title><rss:link>http://www.morepackets.com/blog/2011/2/7/configuring-a-cisco-877-integrated-services-router-on-eircom.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2011-02-07T01:55:02Z</dc:date><dc:subject>877 Networking adsl2+ annex m broadband business cisco eircom</dc:subject><content:encoded><![CDATA[I decided to finally go ahead and get some Cisco gear!
<br>
<br>
To start off nice and easy, I elected to get some devices that would prove useful at home. To that end, I decided to get two Cisco 870 Series Integrated Services Routers. These would allow for me to experiment more with IOS out of college as well as providing some more security related services for Dad. Namely, a site-to-site VPN linking home with the office.]]></content:encoded></rss:item><rss:item rdf:about="http://www.morepackets.com/blog/2011/2/4/collected-thoughts-on-ipv6.html"><rss:title>Collected thoughts on IPv6</rss:title><rss:link>http://www.morepackets.com/blog/2011/2/4/collected-thoughts-on-ipv6.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2011-02-04T01:46:44Z</dc:date><dc:subject>Networking</dc:subject><content:encoded><![CDATA[So at 14:30 today (3/2/11) the IPv4 unicast address space was declared fully depleted.
<br><br>
ARIN (<a href="@TeamARIN">@TeamARIN</a>), the body in charge of US Internet regulation released the blog post linked below.
<br><br>
<a href="http://teamarin.net/education/v6adoption/">http://teamarin.net/education/v6adoption/</a>
<br><br>
Their post links to the summary of the event that occurred earlier today. It also contains links for an IPv6 specific wiki.
<br>]]></content:encoded></rss:item><rss:item rdf:about="http://www.morepackets.com/blog/2011/1/22/my-attempt-at-a-nowplaying-app-for-mac-os-x.html"><rss:title>My attempt at a #nowplaying app for Mac OS X!</rss:title><rss:link>http://www.morepackets.com/blog/2011/1/22/my-attempt-at-a-nowplaying-app-for-mac-os-x.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2011-01-22T19:35:02Z</dc:date><dc:subject>Programming</dc:subject><content:encoded><![CDATA[<p><span class="full-image-block ssNonEditable"><span><img src="http://www.morepackets.com/storage/Screen shot 2011-01-22 at 19.39.04.PNG?__SQUARESPACE_CACHEVERSION=1295725229088" alt="" /></span></span></p>
<p>For a video, click here :: <a href="http://www.twitvid.com/AWSBQ">http://www.twitvid.com/AWSBQ</a></p>]]></content:encoded></rss:item><rss:item rdf:about="http://www.morepackets.com/blog/2010/7/16/opsviewnagios-check-for-blacknightie-status-page.html"><rss:title>OpsView/Nagios check for Blacknight.ie Status Page</rss:title><rss:link>http://www.morepackets.com/blog/2010/7/16/opsviewnagios-check-for-blacknightie-status-page.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2010-07-16T11:54:09Z</dc:date><dc:subject>Scripting</dc:subject><content:encoded><![CDATA[<p>As part of my placement, we monitor websites hosted by Blacknight.ie.</p>
<p>If Blacknight are having issues we tend to get alerts messages about "Connection Refused" which tend to cause some consternation!</p>
<p>To cut down on the amount of clicking, I've wrote a small bash script that can be run by OpsView/Nagios that will check the Blacknight Status Page and return a count of the number of times that the "NOTOK" image is shown!</p>
<p>&nbsp;</p>
<p>If that number is more than one, Blacknight's servers are reporting problems!</p>
<pre class="brush: bash">#!/bin/bash
#
#       Nagios Check Plugin for Blacknight.ie
#       Displays message if Blacknight are having technical issues with any of their servers
#
NOTOK=`curl --silent "http://www.blacknightstatus.com/server_monitor.php" | grep -E "http://blacknightstatus.com/statusmon/images/notok.gif" | wc -l`

if [ "$NOTOK" -eq "0" ] ; then
{
echo "Plugin failure: Information not found, log incident with N&amp;S";
exit 1;
}
elif [ "$NOTOK" -eq "1" ] ; then
{
echo "All OK";
exit 0;
}
elif [ "$NOTOK"  -ge "2" ] ; then
{
echo "Blacknight Status Page reporting issues";
exit 2;
}
else
{
echo "Plugin failure: Unexpected output!";
exit 2;
}
fi
</pre>]]></content:encoded></rss:item><rss:item rdf:about="http://www.morepackets.com/blog/2010/6/7/recovering-a-corrupt-ldap-db-on-os-x-server.html"><rss:title>Recovering a corrupt LDAP DB on OS X Server</rss:title><rss:link>http://www.morepackets.com/blog/2010/6/7/recovering-a-corrupt-ldap-db-on-os-x-server.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2010-06-07T22:00:27Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[<div id="_mcePaste">
<div id="_mcePaste">This weekend a problem arose with the OS X Server back home. I initially noticed it when I couldn't gain SSH access to the machine.</div>
<div id="_mcePaste"></div>
<br />
<div id="_mcePaste">Using verbose output the SSH connection would reach the status of "entering interactive session" but would proceed no further.</div>
<div id="_mcePaste"></div>
<br />
<div id="_mcePaste">When a user attempted to log on locally to the machine, even though the password and username were correct it would still display a logon failed message.</div>
<div id="_mcePaste"></div>
<br /><br />
<div id="_mcePaste">Using the local administrative account I determined that slapd wasn't starting up.</div>]]></content:encoded></rss:item><rss:item rdf:about="http://www.morepackets.com/blog/2010/4/3/my-mifi.html"><rss:title>My MiFi!</rss:title><rss:link>http://www.morepackets.com/blog/2010/4/3/my-mifi.html</rss:link><dc:creator>John Long</dc:creator><dc:date>2010-04-03T00:01:29Z</dc:date><dc:subject></dc:subject><content:encoded><![CDATA[Update!!

After repeated charging cycles I noticed the battery began to swell. Apparently this is an issue that affects both the 2352 and the 2372.

See here more for info :: <a href="http://www.umpcportal.com/2010/05/official-info-on-the-mifi-2372-battery-issue">http://www.umpcportal.com/2010/05/official-info-on-the-mifi-2372-battery-issue</a>
<br><br>
---------------------
<br><br>
This week I took delivery of a Novatel 2352 MiFi device. MiFi is a concept whereby a mobile broadband connection is shared to a limited number of clients via 802.11 wireless technology.
<br><br>
Here's my experience so far!]]></content:encoded></rss:item></rdf:RDF>
