Tuesday, August 3, 2010

Block URLs with an Automatically Downloaded Host File

 

This was originally taken from mraneri from the Linksys forum, but was heavily modified. And thanks to DD-Wrt Wiki 

#!/bin/sh

logger WAN up script executing
sleep 5
if test ! -s /tmp/dlhosts
then
cat >/tmp/dlhosts <<"EOF"
#!/bin/sh
logger Downloading http://www.mvps.org/winhelp2002/hosts.txt
wget -O - http://www.mvps.org/winhelp2002/hosts.txt |
grep 127.0.0.1 |
sed '2,$s/127.0.0.1/0.0.0.0/g; s/[[:space:]]*#.*$//g;' |
grep -v localhost |
tr ' ' '\t' |
tr -s '\t' |
sort -u >/tmp/hosts0
grep addn-hosts /tmp/dnsmasq.conf ||
echo "addn-hosts=/tmp/hosts0" >>/tmp/dnsmasq.conf
logger Restarting dnsmasq
killall -1 dnsmasq
EOF
chmod 777 /tmp/dlhosts
/tmp/dlhosts
fi
grep -q '/tmp/dlhosts' /tmp/crontab ||
echo "45 23 * * 5 root /tmp/dlhosts" >>/tmp/crontab


This script automatically downloads a host file from: "http://www.mvps.org/winhelp2002/hosts.txt" and redirects all the URLs in that file to 127.0.0.1. All those URLs are common malware or advertisement sites so is better to block them. You can also download the file, modify it with new URLs that you want to block or delete the ones you don't want to block and then upload to a web site and change the URL in the code to your custom one. Be aware that the more URLs in the file the more RAM that you will be eating from your router. Check the file size and your free memory to see if it will suit you. If not just erase some URLs... If you want to block all URLs since the router boots then just placed in the startup scripts.



Update by Aviad (A.K.A. Hotfortech): While the above works just fine, there are two main disadvantages of the above method:



1. The blocked content will be shown as "page cannot be displayed" within the websites advertisement segments and will cause the page to not load until the browser gives up on the missing object.



2. If you want to add sites to the block list, you have to do it on a per host bases... (tedious)



Enter shameless self promotion -> I have created a script on my wiki that deals with the above and more by using the pixelserv method described in the forum. you can find the script and a detailed explanation on how it works on my wiki: http://hotfortech.wikispaces.com/How+to+remove+advertisements+with+pixelserv+on+DD-WRT



Other Host Files



Thursday, May 13, 2010

Automated Silent Install Script for LogMeIn Free - UPDATED

Searching the web for a way to setup LogMeIn on my non-tech savvy friends computer without having to go to their homes I ran into the following post on msfn.org by slimbyte. a member of the forums. I would like to to give him full credit for the post below.

Update. Thanks Camelot_One for the Update

Link: http://www.msfn.org/board/Silent-Install-of-LogMeinmsi-t101432.html

Download Clean copy of Logmein.MSI: External link
Version 4.1.1310

1st Download Orca Tool from Microsoft to analyze LogMeIn.msi

Correct command line is:

logmein.msi /quiet USERPASSWORD=pcpassword USERVERIFYPWD=pcpassword USEREMAIL=email@email.com USERWEBPASSWORD=password LicenseType=free

logmein.msi /q ACCOUNTEMAIL=lmiwebsiteemail USERPASSWORD=pcpassword USERVERIFYPWD=pcpassword USEREMAIL=lmiwebsiteemail USERWEBPASSWORD=lmiwebsitepass LicenseType=0

Now we have to edit the MSI using ORCA

On the InstallExecuteSequence table:

1. right click on the right panel and select "Add Row":
ACTION: GetLMIRegistrationCookie CONDITION: NOT Installed SEQUENCE: 3710

2. right click on the right panel and select "Add Row":
ACTION: LMIGetLicense CONDITION: NOT Installed SEQUENCE: 3730

3. find CreateUser action and change condition
from: CANCREATEUSER AND PASSWORDSOK="true" AND VersionNT AND REMOVE<>"ALL"
into: VersionNT AND REMOVE<>"ALL"

4. find CreateUserSetProperty action and change condition
from: CANCREATEUSER AND PASSWORDSOK="true" AND VersionNT AND REMOVE<>"ALL"
into: VersionNT AND REMOVE<>"ALL"

5. Right click SetX64Path and select "Drop Row".

6. Right click SetX86Path and select "Drop Row".

On the Property table:

1. find LICENSETYPE and change condition
from: 5
into: 0
**next step not needed if you used the link above**

2. Right click on DEPLOYID and select "Drop Row"
Save and exit.

 

Now you can also build your own .MSI using Inno Setup Compiler and deploy it.

--------------- Example Code -----------------

Script generated by the Inno Setup Script Wizard.
SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define _AppName "Customized LogMeIn"
#define _AppVer "4.1.1310"
#define _AppPublisher "LogMeIn"
#define _AppUrl "http://www.logmein.com"
#define _AppSetup "LogMeIn"

#define LmiUsrMail "email@email.com"
#define LmiUsrPass "password"
#define LmiPCCode "pcpassword"

[Setup]
AppName = {#_AppName}
AppVerName = {#_AppName} {#_AppVer}
AppPublisher = {#_AppPublisher}
AppPublisherURL = {#_AppUrl}
AppSupportURL = {#_AppUrl}
AppUpdatesURL = {#_AppUrl}
OutputDir = .
OutputBaseFilename= {#_AppSetup}
Compression = lzma
SolidCompression = yes

AppVersion = {#_AppVer}
VersionInfoCompany = {#_AppPublisher}
VersionInfoCopyright = {#_AppPublisher}
VersionInfoTextVersion = {#_AppVer}
VersionInfoVersion = {#_AppVer}

WizardImageFile = files\SetupModern16.bmp
WizardSmallImageFile = files\SetupModernSmall16.bmp

CreateAppDir = no
CreateUninstallRegKey = no
UpdateUninstallLogAppName = no
Uninstallable = yes
DisableDirPage = yes
DisableReadyMemo = yes
DisableProgramGroupPage = yes
DisableReadyPage = yes

[Languages]
Name: "english"; MessagesFile: "compiler:Default.isl"

[Files]
Source: "files\logmein.msi"; DestDir: "{tmp}"; Flags: deleteafterinstall

[Run]
Filename: {tmp}\LogMeIn.msi; Parameters: ACCOUNTEMAIL={#LmiUsrMail} USERPASSWORD={#LmiPCCode} USERVERIFYPWD={#LmiPCCode} USEREMAIL={#LmiUsrMail} USERWEBPASSWORD={#LmiUsrPass} LicenseType=0 /q; StatusMsg: Installing and configuring LogMeIn! Please wait ...; Flags: waituntilterminated shellexec



 



Downloads



Thursday, May 6, 2010

DropBox for Android is out

Straight from the Drop box Forums. ran into this today after work.

 

Access your Dropbox on the go – All the contents of your Dropbox are available for viewing. You can even stream music and movies in your Dropbox straight to your Android device.

Make edits to your files and sync them back to Dropbox – Any changes you make to your files will sync back up to your Dropbox.

Download files for offline viewing – Add files to ‘Favorites’ and they’ll be accessible at any time.

Upload files and sync them to your Dropbox – Take a photo, shoot a video, or upload some audio from your Android phone and email its public link to a friend in less than a minute.

Share links to files in your Dropbox – Yes! Any file in your Dropbox!

And now for some eye candy (these were taken on a Motorola Droid):

image

 

 

Saturday, May 1, 2010

Android PC Apps

I ran into this website today listing some Android Apps that should make all our lives easier. In addition I looked up and posted updates links, websites, and downloads for the apps. Enjoy. Don't forget to visit http://www.sizzledcore.com/
Found at http://www.sizzledcore.com/2010/02/14/android-pc-software-roundup/

Friday, April 30, 2010

How To Improve HTC Battery Life

Original: http://www.talkandroid.com/guides/improve-htc-hero-battery-life/
There are many ways to improve or even double the battery life of your HTC Hero phone. Let's go over some of the most power-draining functions and features that can be disabled to save the life of your battery.

Getting ready for the HTC Incredible

incredible60015[1]So soon I will have an HTC Incredible from Verizon Wireless(http://phones.verizonwireless.com/htc/incredible/) . Finally a phone upgrade after living in the blackberry world of an 8830 world edition for a year. Don't get me wrong it has been a great phone, but its time for an upgrade. In the mean time i needed to start migrating my outlook contact and calendar somehow to my Gmail account.. Big Problem, normally this is not possible. at least not easily, but thanks to a program called Companion Link (http://www.companionlink.com/) which easily syncs my data from Outlook 2010 to my Gmail account with Photos and everything! Read the full review at Engadget (http://www.engadget.com/2010/04/19/droid-incredible-review/)

HTC Incredible Debug Driver Fix (ADB)


I Ran into this issue today when installing my Incredible using the SDK drivers. Drivers would not install, so here is the fix.