Category Archives: Reference

DD-WRT – Block Traffic When the VPN Conection Fails

I did a bunch of research and testing and found a solution for a hardware like kill switch within DD-WRT. This is where you want to basically block traffic when the VPN conection fails or gets blocked for many reasons.

This was some of the things I tested for:

1. When the OpenVPN process dies all LAN/wireless traffic will not leak to the WAN port and bypass the VPN tunnel.
2. When the router boots up LAN/wireless traffic will not leak to the WAN port and bypass the VPN tunnel.
3. When OpenVPN is blocked downstream, ex. blocking UDP 1194, LAN/wireless traffic will not leak to the WAN port and bypass the VPN tunnel.
4. Unplugging/plugging any port on the router will not cause LAN/wireless traffic to leak to the WAN port and bypass the VPN tunnel.

I use a regular router, router #1, downstream (Fios router from Verizon) and use DD-WRT, router #2, only when I want to use the VPN. I connect the WAN port of the DD-WRT router into the LAN port of the Fios router. I then manually connect devices which I want to use the VPN into the LAN ports OR associate them with the wireless AP in the DD-WRT router.

If you only wanted to use one router and not two as I have described above, then you would need to use a policy based solution where some devices would tunnel over the VPN and other you could selectively allow to bypass the VPN. See my comments at the very end for this solution.

These are the firewall commands I added to my WZR-HP-G300NH v1 router (ADMINISTRATION – COMMANDS):

iptables -I FORWARD -i br0 -o tun0 -j ACCEPT
iptables -I FORWARD -i tun0 -o br0 -j ACCEPT
iptables -I FORWARD -i br0 -o eth1 -j DROP
iptables -I INPUT -i tun0 -j REJECT
iptables -t nat -A POSTROUTING -o tun0 -j MASQUERADE

Make certain you click “Save Firewall”.

The last line is a duplicate from the OP, but doesn’t seem to cause any issue. I also own a whr-g54s which required the same above command, but eth1 was replaced with vlan1. Each router will have different interfaces, so these firewall commands might be different for your router. You can use the route command to see what interfaces you have.

This is where I found this information: https://airvpn.org/topic/4287-how-to-block-all-traffic-with-dd-wrt-if-vpn-connection-fails/

For a policy based solution where you want to allow some machines to go around the VPN, go here: http://www.dd-wrt.com/phpBB2/viewtopic.php?p=777788

 

I double posted this on PIA forums:

https://www.privateinternetaccess.com/forum/discussion/comment/22021/#Comment_22021

Set airplane mode automatically when you are connected to WIFI (Android)

You can set airplane mode automatically when you are connected to WIFI on you favorite Android (4.2+) phone provided you have:

1. 4.2+ Android Phone

2. Root Access

3. Tasker

4. Secure Settings

General instructions here:

https://groups.google.com/d/msg/tasker/HgjCbDOvGp4/DexKczO4d3YJ

This is not for novice users. Gaining root access and using Tasker/Secure Settings is not an easy path.

WordPress Comment Spam and Disqus

Delete wp-comments-post.php from the base directory of your WordPress installation when using the Disqus plugin.

Sadly, this will need to be done each time WordPress is upgraded or reinstalled.

This script should be disabled by default and automatically when any other comment system is being using in WordPress. I guess the is a feature request.

http://beta.beantin.se/wordpress-comment-spam-disqus/

Thanks James!

Handbrake Retain/Keep Interlaced Video h.264/x.264 for Encoding

Interlaced handbrake 0.9.8 support:
1) set to dvd preset
2) add :tff OR :bff in the advanced tab, put at end (append).
3) turn off all filters: set to off, set fps to same as source and constant.
Use mediainfo and set to sheet to find if tff or bff
4) feel free to set resolution, etc

This will allow your TV or device to perform the de-interlacing which is far superior than removing half the motion resolution as 98% people and/or software encoders do by default.

Inspired by:
http://www.hardwareheaven.com/audio-video-editing-encoding/218040-encoding-interlaced-source-into-interlaced-x264-format.html

Slingbox Remote Files for Popbox 3D

Here are the files you will need to add a custom remote to your Slingbox/Slingplayer so that you can control your Popbox 3D remotely 🙂

http://www.hifi-remote.com/forums/dload.php?action=file&file_id=9810

As discussed here:

http://www.hifi-remote.com/forums/viewtopic.php?p=98070#98070

Install the files with these directions:

Here.

Cross posted from: http://forum.popbox.com/showthread.php?tid=1336

Instructions for PBXes.org, Google Voice, and Sipdroid with a Google Apps Account

This was driving me crazy!

ATTN GOOGLE APPS CUSTOMERS: You need to manually add a temporary gmail account to your android phone (This would be under settings -> “Accounts & sync”, “Add account” -> “Google” -> “Next” -> “Create” -> etc…). Once that happens, you will see the button on the home screen of sipdroid to configure your PBXes account.

Use your temporary gmail account username and password. You will ALSO need to select a username for PBXes.org.

Once this process completes, you will now be able to use outbound calling ONLY since your temp account will NOT have a Google voice number, but who cares, keep reading…

Log into PBXes.org with your username you selected on registration an the password from your temp gmail account, re-read that twice.

Once you are in, select “trunks” from the left menu and click on “GTALK/tempgamail@gmail.com. From there, change your username and password from the temp gmail account to your Google apps account. Click “Submit Changes”.

From there you may have to reload Sipdroid, but outgoing and incoming calls should work fine. Be certain that Google Chat (your google apps mail address) is selected/enabled as a forwarded phone (inside Google Voice web portal) in order for inbound calling to work on Sipdroid.

Feel free to delete your temporary gmail account from Google’s site AND remove the account from your android phone as a sync account. This would be under settings -> “Accounts & sync”, select the temp gmail account, and touch “Remove account”. Cheers.

Info from here:
http://androidforums.com/android-applications/252222-free-voip-calling-using-google-voice-sipdroid.html#post2152875 Thanks grimlock
and
http://code.google.com/p/sipdroid/issues/detail?id=753#c8
and
http://androidforums.com/android-applications/252222-free-voip-calling-using-google-voice-sipdroid-4.html#post2447641

Roku XDS Component Cable

Thanks to a Roku forum user for this one:

Part number CRE-ZVM-AV-STR sold from ITDirec ships for less than $4.00.

It’s a Creative Zen video cable, but the pin out is the same as the pricey component cable sold from Roku.

The original post is here.

You will need to plug the cables in according to this chart:

The RED RCA jack goes to Y or GREEN RCA input
The WHITE RCA jack goes to Pb or BLUE RCA input
The YELLOW RCA jack goes to Pr or RED RCA input

The above chart and cable are just for component video. You will also need to use either the RCA stereo audio cables that came with your XDS or connect to your TV or receiver with your own digital audio cable.

Pinout information here is:
1 = Ground, 2 = Red, 3 = Blue, 4 = Green. Also verified that it is the same as the component cable supplied with the WD TV Live and Live+ units. For reference, pin 1 being closest to the jacket and pin 4 being the tip of the jack.

See picture and more information on the pin out here:

Microsoft Security Essentials (MSE) Scheduled Scan Tips for Sleeping-Hibernated Computers

I kept noticing my wife’s laptop was not doing it’s scheduled scan at 2am on Sunday. I did a little more research and found that by default MSE does not attempt to wake a sleeping PC/laptop to do the scheduled scan.

To fix this you need to go into the control panel and open up the Task Scheduler. Then select “Advanced” from the pull down menu and then select “View Hidden Tasks”.

From there you should see a task named “MP Scheduled Scan”. If you select the properties you’ll see a settings tab. In the settings tab you’ll see a power management box. You should check:
“wake the computer to run the task”
and
“stop this task if battery mode begins”

This works for Windows XP. In my opinion it’s an oversight.

As far as Windows 7 and Vista. I know my main PC does not seem to wake at 2am on Sunday to scan the PC. I can not find the task, hidden or otherwise shown, for MSE. This could also be an oversight on Microsoft’s part.

So in the case of Windows & and Vista, you might have to manually add a scheduled task by using the MpCmdRun.exe command and setting it to wake the PC.

“MpCmdRun.exe -Scan” is the correct syntax.

Update: I did a bit more digging in Windows 7/Vista and found the hidden task for MSE!

It can be found by launching “taskschd.msc” from the start menu. You then expand “Task Scheduler Library” to find “Microsoft”. From there you will see “Microsoft Antimalware” and then “MP Scheduled Scan”.

Under the properties select the “Conditions” tab. Under the “Power” section check:

“Stop if the computer switches to battery power.”
and
“Wake the computer to run this task”

For the life of me, I do not know why these options are not default”

Lots of good info here:
http://www.thewindowsclub.com/command-line-utility-for-microsoft-security-essentials