How to block TOR exit nodes from accessing your website on Apache and Nginx

If you ever want to block TOR users from your accessing website completely or block them from accessing specific file(s) / location(s) only for any reasons you may have and you’re running Nginx or Apache, hopefully this post can help you with that.

First thing first, the command used here for both Apache and Nginx were designed to be use in cron because TOR ip often change. But make sure that it’s scheduled for 1 hour at minimum to respect those that gives you free service to lookup tor ip =)

Getting a list of TOR IP Addresses

Before anything else we need to get a list of TOR IP Address, and to do that we have two options (but of course feel free to use your own source if you have one):

  • Use TOR Bulk Exit List from Torproject
  • Use an external sites that list TOR IP Address such as from dan.me.uk

Note: dan.me.uk website only allow you to fetch it every 1 hour only (even if you accidentally clicked it), i choose to not link to the ip address url directly because of that reason and so you have to copy the url directly

How to remove index files from URL on Nginx

So yesterday while i was idling on Freenode i saw someone asking in Nginx channel that he basically wants to remove the index.php file from the url or in other words he wants to redirect http://www.mydomain.com/index.php into http://www.mydomain.com/ … probably for canonicalization purpose (canonical url) and/or perhaps SEO purpose. He had tried this:

# And it causes redirect loop (also tested on my local box)
# Atlhough it works fine for simple php files but not on his vBulletin setup
# or other non simple php file (because i don't have access to vBulletin i tested it on other script)
# Note the | is for illustration
location =|~ /index.php {
	rewrite ^ http://www.domain.com/|/ permanent;
}

And being curious, i tried some testing to remove that index.php thing from the URL and found a way to do it and it was simple. So if you’re currently looking for a way to remove or redirect your index file from the URL and you’re using Nginx perhaps this simple tips can help you with that

First thing first is open your nginx configuration files that hold your virtual hosts configuration and then add this line inside the server directive:

How to remap / retasking Realtek onboard jacks / ports

If you’re using Realtek onboard soundcard and for whatever reasons wants to remap / retask the rear jacks or front panel jacks to anything you want hopefully you’ll find this useful

For example, in my case, because i’m not using a computer case (in other words, i just left my motherboard open) and i don’t have a standalone front panel and at the same time i want to connect my headphone to the rear grey jack / side speakers jack (by default headphone can be connected only to the front panel jack) while also connecting a 5.1 analog speakers setup to the rear jacks (green, black, and orange)

Anyway to make thing short, here’s the steps:

0. Download the latest driver available because there are differences between the pin numbers used if you’re using old drivers, uninstall the old driver, restart your system, install the new driver and then restart your system once again (at the time i write this, the latest version is R267, and so this post is based and tested using their R267 driver for the 64-bit systems)

Create RSS feed from any web page using Yahoo Pipes

In this post, i’m going to write a simple explanation / basic example about using Yahoo Pipes to fetch a webpage (you are free to use any pages you want assuming they allow Yahoo Pipes) and then create a RSS Feed from it so you can read it on your favorite rss reader

As an example, in this post i’m going to give an example of creating RSS Feed from HorribleSubs website (horriblesubs.org) that i’ve been using (for myself only) so i can keep track on their Gintama release easily (i read that they’re planning on doing a total makeover of their site so i guess it’s okay to use them as an example)

Yahoo Pipes HorribleSubs RSS Output example using Fetch Page module

Before anything else, please see the source of the pipe used in this example (you need to log in to Yahoo first) because you’ll need to be logged in to Yahoo to see or create a new pipe

How to boot Clonezilla and GParted from HDD on Windows

I’m pretty sure most of you already know about Clonezilla and GParted, and the usefulness of those two tools. And if you’ve been wondering on how to run Clonezilla and GParted directly from your HDD (frugal install) instead booting from a CD or a USB Flashdisk on Windows, perhaps this simple guide can help you with that

Before we get started, i have to mention that there are two ways to run Clonezilla and GParted on Windows although they both use the same thing, the first one is by installing / adding Grub4DOS manually and the other one is by using EasyBCD a GUI to install NeoGRUB / packaged Grub4DOS. And in this post i’ll focus on the later and that is using NeoGRUB

Prerequisite

  1. EasyBCD [download]
  2. Clonezilla Live [download]: You are free to choose between the ISO version or ZIP version. For me, i choose the AMD64-ISO version
  3. GParted Live [download]: Same goes here too, you are free to choose between ISO or ZIP
  4. 7-Zip / Winrar / etc: This is used to extract the file inside the ISO or ZIP

Boot Clonezilla and GParted with NeoGRUB / Grub4DOS

1. Install EasyBCD or Grub4DOS (instruction here if you prefer to use Grub4DOS rather than NeoGRUB), run and at the add new entry section choose NeoGRUB and install it

NeoGRUB

How to Install Squid Proxy on Windows

Back in 2006 or in the early days after i started this blog. I wrote about Installing Squid Cache on Windows. And i think i should rewrite it again because some parts in the old post is missing (back when this blog started, this blog is hosted at WordPress.com and when i moved to a self hosted solution there are some errors in the importing process and although i know about that since a long time ago i’m just too lazy to rewrite it again lol). But well … what’s done is done :)

Anyway, before we begin, make sure that you have downloaded Squid Windows Binary Package / Squid for Windows that can be downloaded from Acmeconsulting. And you have extracted it somewhere on your hard drive. In this post, i choose to extract it to “C:\Squid” due to hardcoded path and beside most people don’t like to read long post. So if you changed Squid location, make sure to adjust it accordingly. And don’t worry the actual installation process is fast. The other steps described here are optional unless you need it

And as a note, i wrote this post (tested) on Windows 7 x64 with UAC Enabled using Squid 2.7 Stable 8 and i’m pretty sure as it will work with earlier version of Windows as well. And No! you don’t need to turn off UAC because turning UAC off isn’t a good solution

And now let’s get started

How To: Realtime AC3 / Dolby Digital Encoding for Games

This simple how perhaps might be useful to those who are connecting their sound card to a receiver that doesn’t have analog input (like me for example) and using the Matrix Decoder on your receiver doesn’t sounds as good as using a Dolby Digital / AC3 encoded files. So what this simple how to trying to achieve is to do a realtime AC3 Encoding using software (in other word, using your CPU power to perform realtime Dolby Digital encoding) and then deliver that Dolby Digital / AC3 encoded material to your receiver. Although unfortunately it doesn’t come for free

Before i begin, please note that this tips is intended for use in Gaming only (or perhaps listening through your MP3/MP4s collection if you’re not using a music player that support realtime Dolby Digital Encoding from a plugin, like Winamp for example). Because for movie and music listening purpose the process is much simpler plus there’s no latency problem like this and you don’t need to spend money (unless you want to donate for the project) .. but i’m not going to describe the process for movie and music listening purpose here because as the title says this is for games :)

If you’re currently using below setup, then chances are you don’t need to spend $30 USD to get a realtime AC3 Encoder / Dolby Digital Encoder. But i haven’t tested it yet because i don’t have the required hardware

  • If your sound card belong to the Creative Audigy Series

    Then you can try using redocneXk combined with Creative ASIO Driver or KX Driver. As the documentation itself can be found here
  • If you have the new Creative X-Fi Series (a much better option for X-Fi series)

    Then you can spend $4.72 USD, and get the Dolby Digital Live and DTS Connect Pack from Creative Store

Otherwise, if your setup doesn’t match above configuration then unfortunately you’ll need to spend $30 USD for a software that is required for this purpose BUT if you don’t mind on spending more money and prefer to skip all this together, you can just buy Diamond Multimedia Xtreme Sound 7.1 DDL (equipped with Dolby Digital Live feature, which is unfortunately not available on where i live because there are no distributor for it here according to the official website) if you prefer a cheaper alternative to X-Fi (at least for me)

How to create custom npc on Mangos

Because i’ve seen several people asking on how to create custom npc on my previous mangos guide, i decided that perhaps it’ll be better if i create a separate guide on how to create custom npc in mangos and in this example we’re going to create a custom vendor npc plus repairer. And so let’s begin the guide

Requirements

A functional wow private server using Mangos

This is the most important thing, if you haven’t configured your wow server properly, please check how to configure mangos first

WoW Model Viewerhttp://code.google.com/p/wowmodelviewer/

How to install Google Android application from PC

I am sure that probably most people alredy know on how to install apk file(s) (Google Android Application) but because i just want to make sure that i don’t forget this because i just received an android phone last week as a gift and because i don’t have internet access on my mobile phone due to mobile connectivity here is just way to expensive for me, the only way for me to install Android apps is by downloading it on PC and then install it using the Android SDK from PC. Anyway here’s the steps:

1. Download Android SDK and install / extract it somewhere on your hard drive (and optionally download the usb driver, although in my case i don’t need to install the USB driver because i’ve installed the driver from Samsung)

2. Add the tools directory in your Android SDK directory to your environment variables (PATH)

3. Open command prompt and change to the directory where your put the android application