Archive for category Internet
Workaround for Comcast blocking port 25
Comcast just started blocking port 25 outgoing. I have several computers at home configured to send email reports of cron jobs. Of course they do this by trying to send mail on port 25 from inside the house to my mail server outside. Now that Comcast is blocking that, I need some other way for my emails to be delivered.
The easiest solution I could come up with was to tell my mail server to listen on another port such as 587, and have my firewall route requests for port 25 to port 587. Here is the iptables rule to do that!
iptables -t nat -A PREROUTING -p tcp -i eth0 -d xx.xx.xx.xx --dport 25 -j DNAT --to-destination :587
Where xx.xx.xx.xx is the IP address of my mail server. Now all the computers inside think they are communicating with my mail server on port 25, but the firewall secretly passes the request on to port 587 instead.
Am I really the only one who knows what street I grew up on?
The top trending topic on Twitter the other day was #twitterpornname. This seemingly innocent meme prompts you to find your Twitter porn name by combining the name of your first pet with the street you grew up on, or some variation. Thousands of people began shouting out this information on their Twitter profiles.
At this point, little red flags may be going off in your head if you realize that another place you may have seen these questions is… the security questions for your online bank account! “The name of your first pet” and “the street you grew up on” are common security questions asked by many websites, and probably you’ve signed up on a few websites that have asked you these.
This meme quickly caused people to seriously think about online security. On one hand, you have people freely giving out the answers to their security questions for their online banking accounts, their student email accounts, etc.
On the other hand, you have businesses treating this information as if you are the only one who could possibly know it. The whole point of a password is that nobody knows it except you. If I log in to a website and provide my password, the website can be reasonably sure that it is really me logging in. When security questions can be used to reset a password, you’d better be sure that nobody else knows the answers to the security questions.
Why, then, do businesses assume that you are the only one who knows the answers to “what street did you grow up on” or “what is your mother’s maiden name”? Surely you can think of a few other people in your life who know the answers, because they grew up with you, or they are related to you.
So while it’s generally a bad idea to give out the answers to your security questions on Twitter, there is really a bigger issue here.
Note: You may have arrived at this post because you saw my tweet which included my SSN and credit card number. Be assured: this was not my actual SSN or CC#. I was making fun of the fact that people give up personal information so easily.
IMAP Authentication for Wordpress 2.7.1
Posted by aaron in Internet, Server Software on February 13th, 2009
Due to some significant changes to the Wordpress authentication mechanism, my original IMAP Authentication plugin stopped working in version 2.7.1. I have updated the plugin to work in 2.7.1. The only difference is that users are no longer automatically created in Wordpress if they have a valid IMAP account. I will try to add that back in soon, but for now this will do.
Download imap-authentication1.2.php
IMAP Authentication for Wordpress
Posted by aaron in Internet, Server Software on August 28th, 2008
UPDATE 2/13/09: There is a newer version of the IMAP Authentication plugin for Wordpress 2.7.1.
It seems like IMAP authentication would be a pretty basic plugin to find for Wordpress. A google search doesn’t turn up much. I found this one which was apparently written for an older version of Wordpress. Never having written a Wordpress plugin before, naturally I decided to fix it to work with version 2.6.
Below is the result of my efforts. I started with Norman’s code, and modified it until it worked with version 2.6. I apologize if it is written poorly or if I missed something terribly obvious; I’ve never written a Wordpress plugin before.
Download imap-authentication2.php
Google Treasure Hunt – Question 2
I just stumbled across Google’s Treasure Hunt. They’re always doing neat things, so I checked it out. It’s a series of four problem-solving puzzles released one week at a time. I found out about it after the first question was already over, so I jumped in starting with the second question.
Question 2: File sum and multiplication problem
In this problem you are given a zip folder with hundreds of text files nested in folders an arbitrary number of levels deep. The question asks to find the sum of the nth line of all files with abc in their path, ending in .xyz. You do this twice, then calculate the product of the two sums. You can download the file I got from them at the link below.
googletreasurehunt.zip
My question is below:
Sum of line 3 for all files with path or name containing jkl and ending in .rtf
Sum of line 5 for all files with path or name containing stu and ending in .rtf
Multiply all the above sums together and enter the product below.
I thought this would be a good chance to practice my bash scripting, so I decided to give it a shot.
$ find . -type f -wholename "*jkl*\.rtf"
-type f restricts the search to files, not directories. -wholename searches for files matching that pattern. Once we run this, we get a list of all the files we’ll need to process. Now we need to create a running total of the values in the nth line in each file. This is where a bash ‘for’ loop and ‘awk’ come in handy.
$ for x in $(find . -type f -wholename "*jkl*\.rtf")
The ‘$’ tells bash to execute that command and return the result. The ‘for’ loop looks at the output line by line, and the variable x will contain each filename.
$ awk 'NR==3' filename.txt
This is an awk command that prints the 3rd line of filename.txt. If we can stick this into the ‘for’ loop, we can get a running total.
sum1=0 for x in $(find . -type f -wholename "*jkl*\.rtf") do sum1=$(( `awk 'NR==3' $x` + $sum1 )) done echo $sum1
Now we just repeat for the other pattern, and we end up with our sum in two variables. Calculating the product is simple.
echo $(( $sum1 * $sum2 ))
Personally, I thought this puzzle was a little bit simplistic. I would have expected them to throw in some tricks, so that a poorly written search command would return some other files that would mess with your result. Now that I’ve said that, I hope I got it right! I find out in 10 hours if my answer is correct.
Feel free to comment if you have a different and/or better solution to this problem!
Phone as a Wifi access point!
This is pretty much the coolest thing in the world! I am posting from my laptop which is connected to my cell phone’s wifi connection, using Sprint’s EVDO connection to the internet. The software that enables me to do this is called wmwifirouter. Earlier this month they released their first final version of the software, and started charging for it. It’s not outrageously priced, but you can still find the earlier free versions on the internet if you search for versions 0.90 or 0.89.
Sprint’s EVDO connection is actually pretty speedy. Of course it’s not like having a cable connection, but it’s definitely faster than dialup. I downloaded a 2mb file at a solid 85kb/s. Also see below for a traceroute to this server.