Category Archives: Tech Tips

Subnet calculator

I’ve had trouble with some clients abusing sites in the past.  There are many ways to address this type of problem such as Captcha, and other rate control mechanisms.  When all else has failed, I’ll typically enforce an IP tables rule that will simply block an address range of IP addresses at the network interface on my server.  Often simply blocking a single IP address will not prevent the abuse for long, and I usually have to resort to blocking an entire range.  Subnet calculations are not terribly difficult but here is a link to a tool that will help you compute the subnet mask for a range of IP addresses quickly and easily that i like to use.

http://bonomo.info/coyote/ip-calculator.php

Remove URL field from WordPress comments

I got tired of people spamming my site with tools like scrapebox and similar programs.  In a small effort to thwart some of the spam, I’ve removed the comment url field from my blogs in wordpress.  Here is how you can do it

From your root html directory edit the file named wp-includes/comment-template.php

Find the section that looks like this and comment out the two lines in red below as shown.

Magicjack Windows 8 on Linux

I recently worked out how to run MagicJack working on my Centos box.  It’s really easy, here is what you need to do.

1) Install VirtualBox.  If you use yum try running yum install VirtualBox-4.2.x86_64

Alternatively just do a yum search for VirtualBox and get the latest version for your system

2) Install Windows 8.  Through the beginning of 2013 MS is offering the beta of Windows 8 for download (link removed, but you can find it via google).

3) Launch virtual box and set it up for windows 8.  I’m not going to cover the details here, there are plenty of instructions on this if you search for them.  Here is the guide I followed for CentOS 6.x (link removed)

Note: You’ll need to make sure you enable USB support correctly in VirtualBox

4) When you launch VirtualBox you’ll see the VirtualBox Manager.  Select the Windows 8 image and then click the settings button.  On the USB menu make sure “Enable USB Controller” is clicked, then select the + button on the right side and you should see something like “TigerJet Network, Inc. USB Internet Phone by TigerJet”  If you see it you’re almost done.

5) Actually boot the Windows8 virtual box image so you’re now looking at Windows.  You many need to go to the windows explorer and manually launch the autorun.exe file for MagicJack.  You should immediately see it start downloading the MJ software.

6) Finally, when MJ software is done, if you pick up the handset and don’t hear a dialtone, make sure you adjust the volume control.  It took me a minute to realize this and for a moment I thought there was something wrong…it was just the windows volume control for MJ was turned down.

Enjoy.

Galaxy Mini 2 Remove bloatware unwanted apps

1) Make sure you have root access on your phone – http://forum.xda-developers.com/showpost.php?p=27596546&postcount=1

2) Get to root console via adb and mount the system folder as read / write

# adb shell

# su

# mount -o rw,remount -t yaffs2 /dev/block/mtdblock3 /system

3) cd to the /system/apps folder

4) Here is a list of bloatware apps and their corresponding apk file names for the stock Samsung Galaxy 2 image

  • AllShare – Dlna.apk
  • News & Weather – GenieWidget.apk
  • Think Free Office – thinkdroid.apk
  • FM Radio – FmRadio.apk
  • YouTube – YouTube.apk
  • Voice Recorder – VoiceRecorder.apk
  • Keis – KeisAir.apk and Keis.apk
Here is another good resource to help you with figuring out what’s what and if it’s safe to remove or not: http://forums.androidcentral.com/optimus-v-rooting-roms-hacks/156703-guide-apks-their-purpose-safe-not-remove-big.html

Samsung Galaxy Mini 2 (S6500D) recovery steps

I accidentally allowed for a samsung software update on my rooted galaxy mini 2.  After that, it wouldn’t boot.

I’ll write up more detailed instructions but this article was basically how I was able to recover it.

1) Download and install the USB driver for the S6500D

http://www.tsar3000.com/Joomla/index.php?option=com_content&view=article&id=388:samsung-original-usb-drivers&catid=55:samsung&Itemid=82

1.1) Download and install ODIN 1.85 – http://www.android.gs/download-odin-1-85/

1.2) Download the stock firmware for the S6500D – http://www.tsar3000.com/Joomla/index.php?option=com_content&view=article&id=567:samsung-s6500d-galaxy-mini2-firmwares&catid=55:samsung&Itemid=82

2) Boot the phone into download mode.  Make sure it isn’t plugged into the computer, turn off the phone.  Then press and hold the down volume + ok button + power button until you see a screen that warns you about downloading images and asks you if you want to proceed to press the up volume key.  Do so now (and you can let go of those other three keys as soon as you get to that warning screen).

3) Connect your phone to the computer and start Odin v. 1.85 on your PC.  Odin is used to download firmware to android devices.

4) Make sure ODIN can see your phone.  You may have to reboot your PC after installing the USB drivers.

5) In Odin, chose the PDA button and select the tar.md5 stock firmware file you downloaded in step 1.2 above.

6) Push the “start” button in Odin and wait.  Make sure Odin reports success and a green box appears in Odin.  Your phone should automatically reboot itself and be working again.

After recovery you’ll have to re-root the phone following these steps

http://forum.xda-developers.com/showpost.php?p=27596546&postcount=1

iptables: Unknown error 18446744073709551615

After a recent VPS upgrade to the container by my provider I noticed that anytime I attempted to add a simple iptables rule (e.g.

The cause of this error was exceeding a new limit that my provider imposed on the VPS containers to cap the rule count.  I had a lot of rules and when I reduced them to be within the value set in numiptent I was again able to add rules to iptables without errors.

I’m running CentOS – here is how you can check to see the limits and current values of the numiptent settings.

cat /proc/user_beancounters | grep numiptent

Output will be in the format

resource held maxheld barrier limit failcnt

How to convert FLAC to MP3

FLAC stands for Free Lossless Audio Codec and you can read more about this audio file format here: http://en.wikipedia.org/wiki/FLAC

Want to convert your flac files to mp3?  Here is a simple bash script that will do the trick for you.

Should I buy a new laptop

QUESTION: We have 3 older laptops, one not that old, but they all run super slow and I’d just like to turn them into internet stations.  What defrag, cleanup, speed up, type tasks can you recommend?

ANSWER:

First – the industry unwritten rule for laptop design life is about 3 years.  However, usually, the only two things that go wrong with a 3+ year old laptop are 1) Battery life 2) Hard drive failure.  The later being a bigger problem…my father just lost his hard drive but it was on a 6 year old laptop….it happens and when it does you will wish you had backed up your data.
That said, if your computers are 2-4 years old and you just want to use them for simple things like email/web browsing etc. they should be just fine from a hardware standpoint.
The sure fire way (and what I tend to do) is to avoid all the headaches of trying to ‘clean up’ an old computer and simply reinstall Windows fresh.  It takes about an hour, and is easier than you think, especially for name brand laptops like HP with well supported hardware.  Of course, you will need a copy of Windows 7 to do that.
PS – Internet Explorer is probably one of the worst (and slowest) browsers to use.  You should just download Chrome – free, fast, and super good.  It’s what I use…always.
Buying a new laptop is a function of Apple vs. Windows and if Windows, then 300-500 vs. 500-1000 vs. 1000+ price points.  Apple hardware isn’t any better than most 500-1000 PC’s from HP.  You can buy less expensive PC’s from other companies like Lenovo (China), or Samsung (Korea) which may work just fine for you too, but usually have lower quality components.  It boils down to you usually get what you pay for.  For ‘everyday use’ like email, browsing, photos and movies, a 400-500 new HP laptop is going to be all you need for another 3-4 years.
Final note: I would suggest buying a laptop with Windows 7.  Windows 8 is coming out soon and the general views are somewhat sketchy.  Historically Microsoft has a good release followed by a disaster followed by a good release and so on.
Windows 97 and Windows ME -> BAD
Windows XP -> GOOD
Windows Vista -> BAD
Windows 7 -> GOOD
Windows 8 ->  ???  I’d place my money on BAD.
This is an updated version of the last laptop I bought for everyday use.  It’s solid and priced about 550 USD.