Setting up MikroTik/RouterOS with Conditional DNS Forwarding (UnoTelly/UnblockUS)

I have a MikroTik RouterOS device that has some custom DNS settings and therefore I cannot change the DNS servers it provides to clients, which is a requirement to use UnoTelly or Unblockus. Instead I found the following article very helpful, it allows you to configure Conditional DNS forwarding for specific domains.

https://www.dalemacartney.com/2012/12/29/dns-conditional-forwarders-with-mikrotik-routeros/

This works well because I use MediaHint to swap back and forth for NetFlix US and Canada, but use only the US Amazon Prime.

1
2
3
4
5
/ip firewall layer7-protocol add name=domain.com regexp=domain.com
/ip firewall mangle add chain=prerouting dst-address=<routeripaddress> layer7-protocol=domain.com action=mark-connection new-connection-mark=domain.com-forward protocol=tcp dst-port=53
/ip firewall mangle add chain=prerouting dst-address=<routeripaddress> layer7-protocol=domain.com action=mark-connection new-connection-mark=domain.com-forward protocol=udp dst-port=53
/ip firewall nat add action=dst-nat chain=dstnat connection-mark=domain.com-forward to-addresses=<UnoTellyDNSServerIPAddress>
/ip firewall nat add action=masquerade chain=srcnat connection-mark=domain.com-forward

How to Disable the Displet Pop WordPress Plugin on Specific Pages

You won’t find much within the support forums in-regards to how to stop the Displet Pop plugin from loading on specific pages. However, I was able to find some pre-created code that does accomplish the task and just modified it for the Displet Pop plugin.

1
2
3
4
5
6
7
8
9
function remove_displet_pop() {
    $ids = array(1358,1226); // ID's of the pages you don't want displet pop to run on
    if(is_page($ids)):
        remove_action('wp_print_styles', 'displetpop_scripts');
        remove_action('wp_head', 'displetpop_action');
        wp_dequeue_script( 'displetpop_scripts' );
    endif;
}
add_action('wp_head', 'remove_displet_pop', 1);

WordPress Plugin Wordtwit Add Twitter Account Not Working (Setup Instructions)

If you’ve recently upgraded Wordtwit, you’ll notice some changes which are specifically to address the old Twitter API being deprecated. You will need to create a Twitter Application for Wordtwit to be able to add a Twitter account.

The developer has provided some instructions on how to correctly create a Twitter application for Wordtwit:Creating a custom application for WordTwit

Make sure that you set the callback URL to your websites URL, which is what I had skipped and caused the “Add Account” button under Twitter accounts to not function at all.

 

 

Receiving Windows 7 File In Use Errors or File Locked By Process Errors

For some reason I’ve been getting issues with applications trying to update themselves, file lock errors will occur. Today it started happening with Steam, it downloaded an update and tried to run but was unable to remove the Steam.exe file stating that it was in use.

I did a bit of googling and found that this may occur if the Application Experience service is disabled, of which it was. Once I set it to “Manual” and started the service, Steam could update correctly with any file lock errors.

As for how this was disabled, I have no idea but I believe it may have been an SSD guide or a guide on how to disable non-essential Windows 7 services.

Export DHCP Leases to HTML or CSV in Windows Server 2003/2008

If you’re looking to export your DHCP leases on your Windows Server into a readable format, then the following article will help.

http://theadminguy.com/2009/10/14/export-dhcp-leases-to-html-using-powershell/

You can also simply run the following command and copy and paste it into excel and it should match the columns correctly.

1
netsh dhcp server 1.1.1.1 scope 1.1.1.0 show clients 1

 

OpenClinica Tomcat Error When Setting JAVA_OPTS on Ubuntu 10.04

I’ve setup OpenClinica a number of time and never really touched the JAVA_OPTS for Tomcat because I’ve never really had any issues. On the OpenClinica Installation Documentation it states that the JVM performs well when using the following JAVA_OPTS

https://docs.openclinica.com/3.1/installation/installation-linux#content-title-5460

1
export JAVA_OPTS="$JAVA_OPTS   -Xmx1280m -XX:+UseParallelGC -XX:ParallelGCThreads=2 -XX:MaxPermSize=180m -XX:+CMSClassUnloadingEnabled"

However, if you’re running Ubuntu 10.04 LTS, you will receive an error when modifying the /etc/default/tomcat6 JAVA_OPTS.

1
Conflicting collector combinations in option list; please refer to the release notes for the combinations allowed

The two options that cause this error are “-XX:+UseParallelGC -XX:ParallelGCThreads=2″, if you remove these then the errors go away. Looking into this further, I’ve found some documentation but not much. The commands are related to garbage collection, and the following article sheds some light on the above two commands as well as “-XX:+UseParNewGC”

http://stackoverflow.com/questions/2101518/difference-between-xxuseparallelgc-and-xxuseparnewgc

Upon remove the two recommended options and adding¬†”-XX:+UseParNewGC” tomcat6 starts without error.

If anyone has any information on why this is, it would be great to know.

Apache Tomcat Native library Not Found Error on Ubuntu

Sometimes you might get the following error message in your logs for your Tomcat instance under Ubuntu.

1
The APR based Apache Tomcat Native library which allows optimal performance in production environments was not found

To fix this issue, simply run the following command to install the appropriate library.

1
apt-get install libtcnative-1

The error should go away!

Dual or Triple Monitors and Multiple Taskbars for Windows 7

If you have a dual or a triple monitor setup, and you wish to have a taskbar on the second or second and third monitor. Then you should take a look at Dual Monitor Taskbar.

It’s a free opensource program for Windows 7 that puts a taskbar on your second monitor if you have dual monitor setup or on your second and third monitor if you have a triple monitor setup. I haven’t tried a quad monitor setup or beyond, please let me know if you have in the comments.

Here is a list of configuration options.

  • General
    • Automatically start with Windows
    • Check for Updates
  • Taskbar Appearance
    • Show lables
    • Show clock
    • Mirror mode
    • Use small icons
    • Show notification area
    • Show start button
    • Use custom font
    • Auto-hide the taskbar
  • Taskbar location
    • Mutliple display support
    • Options for Bottom, Left, Right, Top

Below is a screenshot of the settings, and notepad on a second monitor. As you can see, it’s hard to tell the different from a normal Windows 7 taskbar.

dual-monitor-taskbar-screenshot

If you have a program running on your second or third screen, it will show on the taskbar for that monitor, so it makes it easy to locate your programs windows.

There is similar software that you can purchase, however Dual Monitor Taskbar seems to get the job done and is free.

Dual Monitor Taskbar Homepage