Tuesday, November 6, 2012

Controlling an APC Remote Reboot from PHP

I wrote a quick PHP class that allows you to remotely control an APC "power bar" or "remote reboot" or whatever the kids are calling them these days.


Enjoy!

Saturday, September 29, 2012

Circumventing the Panera 30 Minute WiFI Limit

Apparently Panera has a 30-minute limit on WiFi use in its cafes over lunch. I find this to be appalling and un-American.

UPDATE: Download and run this script: Panera 30 minute reset and you'll be back for another 30 minutes instantly :).

Here's how to get around the 30-minute limit on your mac. Note that you'll have to do this every 30 minutes when your timer runs out:
1) Dis-associate from the wireless network "PANERA": Airport > Open Network Preferences > Airport > Advanced. Scroll down in the list of networks until you find "PANERA" and press the minus to remove it from your list. Then turn your airport off. Now turn your airport back on and DO NOT join the panera network yet.

2) Open Applications > Utilities > Terminal. This is going to bring up a terminal window (black and white text). Type "sudo su" and enter your password.

3) Now you should get a prompt that looks like a # sign instead of a dollar sign. At this prompt (which should look like sh-3.2 #), type this:


ifconfig en0 | grep ether | awk '{print $2}'

This command is going to print your mac address. Make a note of what it shows you so that you can set it back when you're done at panera.

Let's say your MAC address is: 68:a8:6d:09:ab:f2 -- these values are in hexadecimal, meaning that they can be 0-9 and a-f. Other letters will not work.

Change the last value in your MAC address to something different: if it's a 2, make it a 3, if it's a 9, make it an a, if it's an f, make it a 0, and so on.

4) When you've picked your new MAC address, set it like this:


ifconfig en0 ether 68:a8:6d:09:ab:f3

5) Now select the PANERA network in your airport menu. Panera thinks you're a different person now and you get to take up a table for another 30 minutes of free WiFi. 

Make sure to buy a soda during your second and third 30-minute period.

Thursday, June 7, 2012

Creating a for loop or a while loop in Asterisk PBX

The other day, I was updating a dialplan for a client and needed a for loop. They wanted us to test the status of ~100 extensions and ring a call to all of the extensions that were not forwarded at the same time.


It's crazy but there's really no easy way to create a loop in asterisk. You have to trick the dialplan into doing what you really need it to do. The inspiration on this was, of course, David Levinson from the indisputably awesome movie Independence Day / ID4. You know the quote right?


Anyway, here's the dialplan code:
[checkFWDNums]
exten => _X.,1,Set(MYEXTEN=${EXTEN:0:3})
exten => _X.,n,GotoIf($[${LEN(foo${SIPPEER(${MYEXTEN},callforward)})}=3]?checkFWDNums,${EXTEN},100:checkFWDNums,${EXTEN},204)
; make sure the phone is not on DND
exten => _X.,100,GotoIf($[${DEVICE_STATE(SIP/${MYEXTEN})} = NOT_INUSE]?checkFWDNums,${EXTEN},200:checkFWDNums,${EXTEN},204)
exten => _X.,200,GotoIf($[${LEN(foo${NUMS})}=3]?checkFWDNums,${EXTEN},201:checkFWDNums,${EXTEN},203)
exten => _X.,201,Set(NUMS=SIP/${MYEXTEN})
exten => _X.,202,Goto(checkFWDNums,${EXTEN},204)
exten => _X.,203,Set(NUMS=${NUMS}&SIP/${MYEXTEN})
exten => _X.,204,GotoIf($[${LEN(foo${EXTEN})}=6]?checkFWDNums,${EXTEN},300:checkFWDNums,${EXTEN:4},1)
exten => _X.,300,Set(SOURCEPRIORITY=$[${SOURCEPRIORITY} + 2])
exten => _X.,301,Goto(${SOURCECONTEXT},${SOURCEEXTEN},${SOURCEPRIORITY})
I pass in a list of extensions in standard dial format (SIP/404&SIP/405&SIP/406) type deal, and it gives me back a list of extensions that are not in use, ready to dial. Sweet! 

Monday, January 16, 2012

Installing the MegaRAID Storage Manager Server on CentOS 6.2

First download the MegaRAID Storage Manager server software package:

http://www.lsi.com/downloads/Public/MegaRAID%20Common%20Files/8.33-01_Linux_MSM.zip
 Then install the libs that it needs. Note that we're install libstdc++ x86 even if we're on an x64_86 OS.
yum install net-snmp net-snmp-utils libstdc++.i686 unzip csh
You should be able to log in to your MegaRAID device now via the MSM Console software from Windows! Cool!

Thursday, December 8, 2011

Dave's Tech Resources: Easy Fax to Email

Dave's Tech Resources: Easy Fax to Email: Attn.TO is a hot new service that provides drag and drop faxing right from your desktop.

Easy Fax to Email

It's been a while since my last post but I'm pretty psyched to be making this one. The company that I co-founded a few years ago is releasing a new product, call attn.to that make is really easy to send a fax online.


The attn.to system makes sending a fax from your computer as easy as copying files to a USB drive -- seriously! The interface is entirely drag-and-drop. You pick the files on your computer -- they can be image files too for those cheapo home scanners -- and drag and drop then into the file window on attn.to.


After you've uploaded your files, enter the recipient's name and fax number, your name and email address and the comments you'd like on the cover sheet. If the fax is one page or less, it's free. Seriously! If it's more than one page, the price is really straightforward -- just $1.29 per 5 pages, payable by PayPal. If something goes wrong with your fax and it's not received for whatever reason, you'll be automatically refunded by PayPal.


Just a few minutes after pressing send, you will receive your confirmation fax to email sheet. That's it -- no paper, no waiting, no hassle. Just super easy, quick internet faxing. Powered by attn.to!


If you didn't catch the URL that explains how to fax online, you can see how to fax at https://www.attn.to/


Enjoy!
Dave

Monday, September 12, 2011

Using RenWeb on a Terminal Server

RenWeb is a cloud-based school management program. It seems like it's a great little application and the price appears to be right too. A major problem with RenWeb is that it doesn't appear to be intended for a multi-user environment and can corrupt its own cache if you use it in a multi-user environment out of the box.

The solution is to create a temp directory for each user and then launch RenWeb from inside of the temp directory so that it creates a separate configuration file and cache directory for each user on the TS. Here are the steps to get this going on a TS environment:

  1. Create c:\RenWebUserData and make sure that all users have full access to it in the permissions tab
  2. Save the contents of the .vbs file (below) to a file called StartRenWeb.vbs
  3. Create a shortcut to StartRenWeb.vbs in the C:\Users\Public\Desktop folder
  4. Right click your new shortcut and change the icon to the RenWeb icon (can be found in c:\RenWeb, the base installation directory for RenWeb)
  5. Launch RenWeb for many users simultaneously and enjoy!
Place this script data into the StartRenWeb.vbs file by editing it with notepad (make sure there is not an extra .txt extension at the end of the name!)
On Error Resume Next  
Set objShell = WScript.CreateObject("WScript.Shell")
Set objNetwork = WScript.CreateObject("WScript.Network")

objShell.Run "cmd /C ""mkdir c:\RenWebUserData\" & objNetwork.UserName & """", 0, False

' now copy the renweb shortcut into that folder
objShell.Run "cmd /C ""copy c:\RenWebUserData\RenWeb.com.lnk C:\RenWebUserData\" & objNetwork.Username & """", 0, False

'  now run the program
objShell.Run "cmd /C ""cd c:\RenWebUserData\" & objNetwork.Username & " && C:\RenWebUserData\" & objNetwork.UserName & "\RenWeb.com.lnk""", 0, False
UPDATE: you also need to set  the "start in" parameter on the shortcut to renweb to be C:\RenWebUserData\%USERNAME%. Then you ALSO need to modify the file called 'Parameter' in the RenWeb.com folder, editing the value called START IN DIRECTORY and changing it to J:\z_IT_RenWeb\RenWeb.com