Thursday, September 12, 2013

Dinner Quest...or trying not to eat out for a full month.

So lately we've been eating out a bit and frankly this was cutting into our monthly budget and also not helping out my health, to say the least. So I decided, with my lovely wife Chelsea, to try to not eat out for the whole month of September, or at least from the 8th onward, since that's when I got this idea. We had already done most of our shopping for month so I wrote down all the proteins we had in the house and decided to come up with lunch ideas, mostly via allrecipes.com and also just searching Google.

Below is my full list. I will be posting daily about each food item, sharing pictures where possible and if I plan on making it again. As you may notice today is the 12th so I have to go back to the 8th and start there, but it should be fun and enjoyable for anyone interested.

By the way I realize not all of these are healthy food items, I just wanted to cook/bake instead of going out. And yes I actually made everything so far.  I told my wife I would gladly take care of cooking through the 28th and I plan on sticking to it. I am thinking about continuing this through October 8th to see if we really can go a full month without eating out.  Also the other cool thing about this is almost every recipe seems to be big enough to allow for leftovers the next day for lunch!

9/8 - Sunday - Bread - Pretzels/Sandwiches

9/9 - Monday - Ground Beef - Cheeseburger Pie

9/10 - Tuesday - Bottom Round - Slow Cooker Pot Roast w/ Broccoli 

9/11 - Wednesday - Chicken Breasts - Slow Cooker Chicken Taco Soup

9/12 - Thursday - Pork Chops - Baked Pork Chops w/ Mashed Potatoes

9/13 - Friday - Chicken Breasts - White Chicken Chili

9/14 - Saturday - Bacon - Bacon Wrapped Stuffed Chiles

9/15 - Sunday - Kielbasa - Kielbasa and Cabbage

9/16 - Monday - Top Sirloin - Sirloin Steak w/ Garlic Butter w/ Potatoes and Onions

9/17 - Tuesday - Ground Beef - Italian Spaghetti Sauce with Meat Balls (w/ spaghetti)

9/18 - Wednesday - Lentils - Lentils w/ Tomatoes

9/19 - Thursday - Chicken Breasts - Ultimate Chicken Fingers w/ Baked Fries

9/20 - Friday - Tuna - Tuna Salad Sandwiches (or w/ crackers)

9/21 - Saturday - Beans - Baked Beans

9/22 - Sunday - Bottom Round - Bottom Round Roast w/ Onion Gravy

9/23 - Monday - Top Sirloin - Sirloin Marinara (w/ vegetables)

9/24 - Tuesday - Pork Chops - Mustard Onion Pork Chops w/ vegetables

9/25 - Wednesday - Chicken Breasts - Garlic Chicken w/ beans

9/26 - Thursday - Pizza - Homemade Pepperoni Pizza

9/27 - Friday - Top Sirloin - Navy Bean soups / Sirloin Tips

9/28 - Saturday - Pork Chops - White Pork Chili

Tuesday, August 27, 2013

So, Suddenlink, really?

So I was working from home when my VPN dropped and I didn't notice - it happens.

Instead of going to an internal site I ended up on the web interface for an Arris Cable modem.

I was of course confused because I have a Motorola cable modem.
So being the curious type I put in a new IP address and another cable modem, this time SMC.

Well now I got curious I opened up Angry IP Scanner.
I did a scan on the /24 first then expanded it to a /16, although I only got IPs within a /21.
Either way there 1976 hosts that showed up.
A lot of them with port 80, 22, or 23 open to them.
I went to a lot of the web interfaces.

I then found this PDF http://www.answersthatwork.com/Download_Area/ATW_Library/Networking/Network__4-List_of_default_Router_Admin_Passwords_and_IP_addresses.pdf
Apparently a lot of these cable modems, if they do have usernames and passwords at all are accessible via what's listed there.

Well I figured if I can do this, surely someone else can.
So I though I need to report this to my ISP, Suddenlink.
Here's how that went down...

So Suddenlink has a chat with a tech thing I thought that would be great so I can document this and they can fix it.

Nope...

Below is my initial post to them.

Long story short I was working from home and assumed my VPN was connected, I attempted to access an internal site, but instead was redirected to an Arris cable modem, as it turns out my vpn had disconnected. However I then realized this wasn't my cable modem. Looking further I found (using Angry IP Scanner) that I can access the web/telnet/ssh interfaces for some 1976 cable modems. Am I supposed to be able to do this?

Surprisingly I wasn't in queue at all, I got straight through to a technician.

This is what I got in response:

Thank you for choosing Suddenlink Online Support. Be sure to ask us about the all new Any-Room DVR and Stream powered by TiVo, which will allow you to enjoy your favorite TV programming anywhere!
You have been connected to Mayra P..
Mayra P.:  Hi Benjamin! Thank you for choosing Suddenlink Online Support. My name is Mayra and I would be happy to assist you today.
Mayra P.:  Thank you! One moment please while I pull up your account.
Mayra P.:  For security purposes, can you please provide me with the last four digits of the Social Security number on the account?
Benjamin Warriner:  <redacted>
Mayra P.:  Thank you. Just one moment please.
Mayra P.:  Thank you for your patience.
Mayra P.:  You should not be able to see other modems. There is a program running that shouldn't be. What we can do is report this to our internal IT department and then reset your modem. If you are still able to see the other modems I would consult your IT department directly because there may be a virus on your computer. It could be the back door that a hacker is using to access your information.
Benjamin Warriner:  Yeah, I doubt that.
Mayra P.:  Well, sir I do apologize however you shouldn't be able to see other peoples modems. If you are there is something wrong.
Benjamin Warriner:  There isn't anything running on my mac. Well that's why I brought this to your attention. I assumed this wasn't correct
Mayra P.:  We can try to fix it from here but if you were in your VPN and it was disconnected but you were able to see other modems.
Mayra P.:  I can alert our IT department but your program should not do what it did and we can not assist you with what the program did.
Benjamin Warriner:  Perhaps you misunderstood me - I thought my VPN was still connected - you see we use a <redacted> IP range at work. Apparently you (suddenlink) use that same range. My VPN isn't connected anymore. I even tried this from another device, an ipad that's never been connected to my VPN and it can also access these devices. That is to say there is no program being used to do this, just the Internet connection you're providing me
Mayra P.:  We only handle residential accounts in this department and we can not assist you with your VPN services. Those services are through your company.
Mayra P.:  You would have to speak with your IT department. We are unable to assist you with VPN access for any company.
Benjamin Warriner:  I am not asking for assistance
Benjamin Warriner:  I am saying I believe there is a flaw in some equipment, perhaps a missing ACL or other issue that is mistakenly letting me see and access other customers cable modems. I am only brining this to your attention so you can forward it to someone who can actually do something about it.
Mayra P.:  Sure, I have alerted our IT department about this issue. Is there anything else that I can assist you with?
Benjamin Warriner:  That was it, thanks.
Mayra P.:  You are very welcome. It has been a pleasure assisting you today Benjamin. Once again, my name is Mayra and thank you for choosing Suddenlink Online Support.
Your session has ended. You may now close this window.

So, I am not sure if anything will come of it, but ...

Wednesday, March 27, 2013

Bacula Errors and Other Fun Stuff

So I recently upgraded PostgreSQL from 8.3 to 8.4 and more or less at the same time upgraded Bacula to 5.2.14 from some earlier version, I don't remember what can I say.

Anyway in the process I ran into this error when opening bconsole:

JobId 0: Fatal error: Pool Default not in database. sql_create.c:189 pool record Default already exists

I couldn't for the life of me figure this out.

So I eventually got into pgsql as bacula and did a select statement


bacula=> select * from pool
;
 poolid |  name   | numvols | maxvols | useonce | usecatalog | acceptanyvolume | volretention | voluseduration | maxvoljobs | maxvolfiles | maxvolbytes | autoprune | recycle | actiononpurge | pooltype | labeltype | labelformat | enabled | scratchpoolid | recyclepoolid | nextpoolid | migrationhighbytes | migrationlowbytes | migrationtime 
--------+---------+---------+---------+---------+------------+-----------------+--------------+----------------+------------+-------------+-------------+-----------+---------+---------------+----------+-----------+-------------+---------+---------------+---------------+------------+--------------------+-------------------+---------------
      1 | Default |      44 |     800 |       0 |          1 |               0 |      2592000 |              0 |         40 |           0 |           0 |         1 |       1 |             1 | Backup   |         0 | stor2-      |       1 |             0 |             0 |          0 |                  0 |                 0 |             0
      1 | Default |      44 |     800 |       0 |          1 |               0 |      2592000 |              0 |         40 |           0 |           0 |         1 |       1 |             1 | Backup   |         0 | stor2-      |       1 |             0 |             0 |          0 |                  0 |                 0 |             0
(2 rows)

As you can see my default pool is listed twice, oh man...

So I couldn't think of a clever way to fix that so I did a Google Search which led me to Stack Overflow 

http://stackoverflow.com/questions/1746213/how-to-delete-duplicate-entries-in-postgresql

and on to this function

CREATE OR REPLACE FUNCTION remove_duplicates(text, text) RETURNS void AS $$
DECLARE
  tablename ALIAS FOR $1;
  duplicate_column ALIAS FOR $2;
BEGIN
  EXECUTE 'CREATE TEMPORARY TABLE _DISTINCT_' || tablename || ' AS (SELECT DISTINCT ON (' || duplicate_column || ') * FROM ' || tablename || ' ORDER BY ' || duplicate_column || ' ASC);';
  EXECUTE 'DELETE FROM ' || tablename || ';';
  EXECUTE 'INSERT INTO ' || tablename || ' (SELECT * FROM _DISTINCT_' || tablename || ');';
  EXECUTE 'DROP TABLE _DISTINCT_' || tablename || ';';
  RETURN;
END;
$$ LANGUAGE plpgsql;
Of course I also had to run CREATE LANGUAGE plpgsql; first
Then I ran 
bacula=> SELECT remove_duplicates('pool','poolid');
 remove_duplicates 
-------------------
 
(1 row)

bacula=> select * from pool
;
 poolid |  name   | numvols | maxvols | useonce | usecatalog | acceptanyvolume | volretention | voluseduration | maxvoljobs | maxvolfiles | maxvolbytes | autoprune | recycle | actiononpurge | pooltype | labeltype | labelformat | enabled | scratchpoolid | recyclepoolid | nextpoolid | migrationhighbytes | migrationlowbytes | migrationtime 
--------+---------+---------+---------+---------+------------+-----------------+--------------+----------------+------------+-------------+-------------+-----------+---------+---------------+----------+-----------+-------------+---------+---------------+---------------+------------+--------------------+-------------------+---------------
      1 | Default |      44 |     800 |       0 |          1 |               0 |      2592000 |              0 |         40 |           0 |           0 |         1 |       1 |             1 | Backup   |         0 | stor2-      |       1 |             0 |             0 |          0 |                  0 |                 0 |             0
(1 row)

Now there are no more messages in bconsole and no more errors!

Remove Stale/Old Active Sync Devices from All Mailboxes

I had an issue where several users that no longer work here still had active sync devices in AD for whatever reason so I needed to get rid of them.

Quick Google Search found this Technet thread

The long and short of it are these two lines that gather all the active sync devices that haven't checked in within the past 30 days and then removes them.

For my purposes I changed it 90 days the first time through, however I now run this script once monthly.

-- Powershell Start --

$DevicesToRemove = Get-ActiveSyncDevice -result unlimited | Get-ActiveSyncDeviceStatistics | where {$_.LastSuccessSync -le (Get-Date).AddDays("-30")}

$DevicesToRemove | foreach-object {Remove-ActiveSyncDevice ([string]$_.Guid) -confirm:$false}

-- Powershell End --

Now let's say the user doesn't have a mailbox on Exchange anymore.

You first have to temporarily recreate the mailbox

-- Powershell Start --

Enable-Mailbox -Identity:'OU/User'

-- Powershell End --

Then rerun the above script.

If you don't create the mailbox you get a can't find recipient error.

Then after the active sync devices are gone simply run

-- Powershell Start --

Remove-Mailbox -Identity:'OU/User'

-- Powershell End --

If for some reason you still can't remove the Active Sync devices you can open ADSI Edit and look for

CN=ExchangeActiveSyncDevices container under the user object

Then simply remove that.

Tuesday, March 26, 2013

A quote

A lack of scientific certainty should never be allowed to undercut our ability (and responsibility) to act on imperfect information. People who think science is certain don't understand science. We only ever have contingent knowledge - the most robust scientific thinking at a given moment - and this thinking is always subject to change. That's what makes it science. But just because the thing is imperfect does not actionable. Newtonian science is not perfect but it's enough to get us to the moon and back.

Mark Jannot - Editor-in-Chief Popular Science February 2012

Thursday, March 21, 2013

FreeBSD Update Script



This is a script I stole from someone else and modified.
It originally used portupgrade, but portmaster is better in my opinion.
The script basically looks for all out of date ports and runs through upgrading them.
Additionally it asks you to configure them and does this for all dependencies as well.

This isn't one of those set it and forget scripts you can put in crontab - you actually need to pay attention when upgrading ports and this script needs your full attention.

There a few pre-requisite things that must be addressed:
1) Make sure ports is installed or if it is installed, up to date

To Install Ports:
portsnap fetch extract

To Update Ports:
portsnap fetch update

2) Install portaudit

cd /usr/port/ports-mgmt/portaudit
make install clean

3) Install portmaster
cd /usr/ports/ports-mgmt/portmaster
make install clean

4) Create a log file /var/log/freebsd-update.log
touch /var/log/freebsd-update.log

--Script Start--
#!/bin/sh

LOG_FILE="/var/log/freebsd-update.log"

echo "Starting updates: `date`" | tee -a ${LOG_FILE}
echo "***"
echo "*** Checking for FreeBSD patches..."
echo "***"
/usr/sbin/freebsd-update fetch | tee -a ${LOG_FILE}
/usr/sbin/freebsd-update install | tee -a ${LOG_FILE}

echo "***"
echo "*** Updating ports tree..."
echo "***"
/usr/sbin/portsnap fetch update | tee -a ${LOG_FILE}

echo "***"
echo "*** Looking for ports to update..."
echo "***"
/usr/local/sbin/portmaster -a --force-config -d -b -t -v -y -t | tee -a ${LOG_FILE}

echo "***"
echo "*** Checking installed ports for known security problems..."
echo "***"
/usr/local/sbin/portaudit -Fva | tee -a ${LOG_FILE}
echo "Finished updates: `date`" | tee -a ${LOG_FILE}
--Script End--

Word of note if you need to exclude something add a -x after the -t and put in the name or partial name of a port such as:

/usr/local/sbin/portmaster -a --force-config -d -b -t -v -y -t -x LSOF | tee -a ${LOG_FILE}

You'll need to do a separate -x for each port you want to exclude.

I don't have a clue

I'm so very tired. It's almost all the time now.