Prevent spam in blogengine

Posted by Mike Dwyer | Filed under

Ok, so having my blog has been nice, especially when I started receiving comments.  Little did I realize the comments were auto comments that was just spam so people can post their website info for advertising.  Well, after a while it got annoying trying to clean the comments.  What I realized is, in the comments section, people can post a website url, which is the reason for the advertising.  My first thought was I created a stored proc as follows:

create procedure dbo.spRemoveSpam as

delete from be_postcomment where isnull(Website,'')<>''

and isnull(Website,'') not like '%mypersonalwebsitehere%'

 I then ran that every night.  I could have created a trigger, but I just don't like them since I forget they exist and weird stuff happens!  I also could have just scheduled this to run all the time.  What I decided to do instead, was just add code into the file in the core dll file dbLogProvider.cs in the UpdateComments method, before the execute query, I changed the last line in that method:

 cmd.ExecuteNonQuery();

 TO

if (dpWebsite.Value == string.Empty) cmd.ExecuteNonQuery();

This will ensure that if someone fills in the website field, it just won't save.  I will eventually put text on the page as well stating that, but thus far the only people that post in the website field are spammers. 

 I suppose a CAPTCHA would be nice, and I am sure there is a module somewhere, I am just being lazy!

 

12/1/2009 UPDATE
I found a better way to handle this.  In the User Controls folder is a file called CommentsView.ascx.cs.  Do a search for:

if (website.Trim().Length > 0)

 {

if (!website.ToLowerInvariant().Contains("://"))

Right above the second IF statement, put a return.  This will stop the post altogether from moving forward and emailing you.  Final code looks like:

if (website.Trim().Length > 0)

 {

return;

if (!website.ToLowerInvariant().Contains("://"))

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Vibe Streamer vs Orb Streamer

Posted by Mike Dwyer | Filed under

I figured after all these years, surely there would be a lot of choices for those that want to stream music and videos from their home computer to their work computer or mobile device.  Well, turns out that I was wrong.  The background is this, though I really like Pandora and Last.FM, sometimes I just want to hear some of my own tunes.  I am one of those people that like to put all my music on one device to always have with me so I don't have to reconnect and remove and add music.  When I had my Zune, I put in the 80gb drive just so I could accomplish this.  Then I bought my crappy Samsung i-760 phone and realized I could put my music on there.  Well, that is nice except I only get 8gb of space on that tiny little card, that just didn't cut it. 

 That is when I switched to Pandora and Last.FM, however sometimes I want control over what I am listening too, or I want to hear a whole album, so that just didn't work.  The problem I had to solve was how to stream my music from home to work, when at work we block almost every port except the basics, so I need something that runs on port 80.  At this point, I found Vibe Streamer and Orb.  The biggest difference off the bat is Vibe Streamer only handles music, whereas Orb handles music, photos, videos. 

So, at first I started with Vibe Streamer.  It was easy to install, I put a mapping in my router to route traffice to my computer, and played music stored on my freenas server.  Worked great.  The interface was really good, easy to create on the fly playlists, etc. Everything plays as a flash file, so no need to worry about codecs.  The downside with Vibe is it does not work on mobile devices, and does not play videos.  The videos really doesn't bother me too much, though it would be nice to have.  The fact that it doesn't play on my windows mobile device though was kind of annoying.   Vibe does not run as a service, which to be honest is pretty stupid.  It does have a setting to load automatically on startup, but on 2 seperate computers that has not worked.  Plus, the app has to be loaded with an icon on the taskbar, would prefer it to be a background task.  There is a way through the windows resource kit to have it run as a service, I will be testing that later.  As far as I know, there is no iphone app to work with this, or any mobile device for that matter, at least until they have flash support.

After a hard drive crash and a system rebuild, I decided to give Orb a shot.  Orb, though runs on your local machines, has its hands in the orb.com servers.  No worries, your music and files stay on your own computer, I think they just keep a list for quicker management.  Once I installed the software and logged into my orb account, I was instantly pretty confused.  I just wanted to play my music.  Eventually I got it figured out, I think it was just running slow because it was still indexing my files.  The first thing to note is, on my system, everything runs in Windows Media Player instead of flash.  Personally, I don't like media player as it seems slow to buffer and play.  I have noticed a longer than expected pause between songs, and a lot of times when the song starts up it starts in almost a slow motion sound then picks up to regular speed.  The web interface I think is pretty clugy.  I have not figured out how to just quickly add songs to my list that I want to listen too, or randomize play.  More importantly, to me, is I can not see what is currently playing, unless I look at the window media player window.  We tested ORB on an iphone.  We can watch videos through the free iphone app, but you have to pay $10 to be able to listen to music.

I then tried to watch a video on my phone on the train.  Now, keep in mind, my Samsung i-760 is a piece of junk and has terrible reception, the video did not use the whole screen and was really choppy and was just continually trying to buffer.   Orb is nice here because it detects your connection rate and adjusts the video before playing it, but I think because my phone is a piece of junk that it just does not maintain a constant connection rate.  Would like to hear from others on the video on phones.

So, my overall opinion?  Well, I will be reinstalling Vibe Streamer for my music.  The interface was just that much better and easier to use.  When I switch to a google phone sometime early next year, I may try Orb again, or I may just have orb run on another port altogether, if that is even an option. 

Vibe streamer can be found at: www.vibestreamer.com
Orb can be found at: www.orb.com

Please let me know if you have found something better!

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5

Windows 7 Professional

Posted by Mike Dwyer | Filed under

So, recently I had a hard drive go out (thanks Seagate), which left me the option to either reinstall Vista, or just install Windows 7.  Well, not a real tough choice as any Vista user will tell you.  I figured Windows 7 had good reviews, and really, it just couldn't be worse than Vista.  I put in a fresh new drive, and let the install go.  Keep in mind, my machine is a quad 64 bit processor, so it is a little beefy, and I have 3 monitors hooked up (foreshadow...).  After 20 minutes of the windows 7 install, with me really having no interaction with the install, the computer rebooted and the screen was just black.  Personally I thought since it has only been 20 minutes, the install must just be getting ready to start.  However the screens stayed black, though on one of the screens I could see the mouse cursor.  I tried rebooting and the same thing.

Welp, I of course went to google (sorry Bing) and did a search.  It turns out that even in the beta version, people with multiple monitors connected had problems.  The solution?  Well, just disconnect all but one monitor.  Once I did that, the machine booted to Windows 7.  I couldn't believe it, the install was done in only 20 minutes.  About a half hour of windows updates, and all my monitors were connected back up and working.  To be honest, the monitor setup was so much easier than Vista.

 My personaly opinion on Windows 7 thus far is, it really is much better than Vista, though I have some getting used to certain things.

1. The task bar is nice.  My problem is I am accustomed to the task bar having all my apps spread out along the bottom for easy navigation for me.  Now they are all within one icon on the task bar.  This is nice to a point, but will take some time getting used to.  The cool thing about this though, is when you click on the icon, you can see previews of what is on the screen.  If you mouseover the preview, Windows 7 brings it to the foreground temporarily, and quickly for you to preview.  Amazing how fast this works.  The other nice thing is you can close windows from the listing as well.

2.  MSN Messenger kept loading, and I couldn't see any way to turn it off.  Turns out you have to press "alt" key to have the menu appear.  Not sure why Microsoft would do that as it is a little silly, but I guess that is what MS is known for.

3.  Same as Vista, but I could not edit and save the hosts file, unless I open up notepad in administrator mode (type notepad in the search box, right click it in the list, and run as administrator).

4.  The pop up boxes everytime I want to install something gets annoying.  Though, to be honest, I do not install stuff all too often.  But since this was a new build and I had to get all my software on there, it did get in the way.  No where near as annoying as Vista though.  There is a feature to make it so it doesn't grey out the entire screen when prompting you, which I of course did.  It would really be nice if they found a way to not ask me if I double click an application to run.  I think the assumption should be if I double click a setup file, then I really want to run it, no need to pop up asking me.

5.  All my apps loaded and ran just fine.  I have had no incompatibilities with drivers or programs (yet...).  This includes Visual Studio.net, sql server 2008, Adobe Photoshop CS, etc.

6.  File copying is MUCH faster than Vista.  I don't know how Microsoft screwed up file copying in Vista, but it seems to be fixed in Windows 7.  I haven't tried copying to a USB drive, which used to be dreadfully slow with my Vista machines, but am hoping that has been taken care of as well.

7.  The licensing is hard to understand.  From what I understand, you can upgrade from Vista to Windows 7, only if Vista is installed AND activated.  Now, the problem here is, my hard drive crashed.  Why would I want to reinstall the piece of junk Vista first instead of doing a fresh install?  Secondly, some people will have to call to have Vista activated again.  So, instead of a 20 minute install, I would have had to reinstall Vista (which takes a good hour), then call and speak to someone I can barely understand and read an insanely long key, which he can't understand, then he reads back a long key that I can't understand, then I would be able to install Windows 7.  Not a very smart approach.  Secondly, Windows XP users can not upgrade to Windows 7 from what I understand.  I think this is a poor policy, especially since the reason most people didn't upgrade was because Vista was a poor choice.  I think XP users should be able to buy the upgrade version, and do a fresh install with it. 

Though I think Windows 7 is a much better operating system than Vista, I still think Microsoft has a long way to go to understanind its users.  It may want to try to listen a little closer and treat them with respect, instead of force (i.e. forcing users to buy full version instead of upgrades).  But, as we have seen with Vista, Zune, Windows Mobile (which is really bad), Microsoft is definately not going to listen to users anytime soon!  I do recommend the upgrade to Windows 7 though, as I think most users will really like it, even XP users.

Thus far I have been very happy with Windows 7.  We'll see how it holds up over time now.

 

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5