Dealing With Unfused JCOP Java Cards Sold from AliExpress or eBay

Recently I acquired a set of 5 JCOP J2A040 Java Cards with the intention of loading the GidsApplet on them for Windows Smart Card Logon with an Active Directory Domain Controller.

Upon receipt of the smart cards in the mail, I’ve ran into this error with GlobalPlatformPro:


pro.javacard.gp.GPException: STRICT WARNING: Unfused JCOP detected
at pro.javacard.gp.GlobalPlatform.printStrictWarning(GlobalPlatform.java:184)
at pro.javacard.gp.GlobalPlatform.select(GlobalPlatform.java:213)
at pro.javacard.gp.GPTool.main(GPTool.java:334)

After a few hours spent with Google and various search engines and some trial and error, I’ve put together an explanation on what an unfused JCOP card really is and how to perform the pre-personalization steps that a card manufacturer would have taken to enable the GlobalPlatform Card Manager so a developer can load a .CAP file on to the card for the end user to use.

Continue reading “Dealing With Unfused JCOP Java Cards Sold from AliExpress or eBay”

Using the Smarty Template Engine for your Custom WHMCS Addon Module

If you ever wondered how one uses the Smarty template engine in conjunction with WHMCS’s _output function for custom addon modules, here’s a snippet that you can use for WHMCS 5.3.x and PHP 5.3.x:


function _setup_template() {
global $templates_compiledir;
$template = new Smarty();
$template->compile_dir = $templates_compiledir;
$template->template_dir = __DIR__ . DIRECTORY_SEPARATOR . 'templates';
return $template;
}

Include this in your functions file or whatnot and be on your merry way on creating WHMCS modules for your business! *cough* *cough*

PowerShell cmdlet for Getting Your Bank Account Balance(s) at PC Financial

I’m just gonna dump this code block I wrote so I don’t have to click and point on PCF’s messed up website.

I’m going to assume you probably know how to use PowerShell modules and using that said function. In this case all you need to do with this function is:

Get-PCFBalance -CardNumber 6018871011111110 -Password InsertYourPasswordInPlainTextHere
Continue reading “PowerShell cmdlet for Getting Your Bank Account Balance(s) at PC Financial”

Making WordPress Domain Name Agnostic

When I was migrating this blog over to my own server at home reverse proxied at a VPS sitting somewhere, I ran into an issue where I could not figure out how the heck does one force the WordPress administration page to have a different subdomain from the where the site was installed to. Gave up on fixing it for a month or so and therefore, blog posts became… somewhat limited… Well it was limited anyways to start off with 😛

After trying out various solutions that mostly ended up in breaking the site, I’ve came across this idea:

http://wordpress.org/support/topic/no-site-url

The thread’s OP wanted a few different domains to point to his site regardless and not have WordPress further molest the URI’s being generated on the page. TL;DR the main idea was to use this:

$url = "http://".$_SERVER["HTTP_HOST"];

…inside the wp-config.php file.

And in turn:

define('WP_HOME',$url);
define('WP_SITEURL',$url);

Dang, lesson learned here – wp-config.php can be treated like a PHP script where you can call all sorts of variables, including the $_SERVER ones.

Of course, additional work is required on the nginx side to have the proxy to pass on the HTTP Host value as-is to the said internal site.

Tony of FreeSWITCH… Very Funny…

Ha Ha very funny of you…

In case if you’re wondering, yes Tony of FreeSWITCH did add that colorized banner in fs_cli.c with the effect of advertising that ClueCon is coming in a month…

For people who are getting annoyed at it, I’ve reverted that and you can use my patch to get rid of that banner:

From 23526fe0cbd306c9e993e31e679ff8f8f185f14b Mon Sep 17 00:00:00 2001
From: Jeff Leung 
Date: Sun, 15 Jul 2012 23:28:07 -0700
Subject: [PATCH] Haha very funny...

---
 libs/esl/fs_cli.c         |   11 ++++-------
 libs/esl/src/include/cc.h |    3 ---
 2 files changed, 4 insertions(+), 10 deletions(-)
 delete mode 100644 libs/esl/src/include/cc.h

diff --git a/libs/esl/fs_cli.c b/libs/esl/fs_cli.c
index 8532e23..408c946 100644
--- a/libs/esl/fs_cli.c
+++ b/libs/esl/fs_cli.c
@@ -916,18 +916,15 @@ static const char *banner =
        "* Paypal Donations Appreciated: paypal@freeswitch.org *\n"
        "* Brought to you by ClueCon http://www.cluecon.com/   *\n"
        "*******************************************************\n"
-       "\n";
-
-static const char *inf = "Type /help  to see a list of commands\n\n\n";
+       "\n"
+       "Type /help  to see a list of commands\n\n\n";

 static void print_banner(FILE *stream)
 {
-#include 
-
 #ifndef WIN32
-       fprintf(stream, "%s%s%s\n%s", output_text_color, banner, cc, inf);
+       fprintf(stream, "%s%s", output_text_color, banner);
 #else
-       fprintf(stream, "%s%s\n%s", banner, cc, inf);
+       fprintf(stream, "%s", banner);
 #endif
 }

diff --git a/libs/esl/src/include/cc.h b/libs/esl/src/include/cc.h
deleted file mode 100644
index 573a7f7..0000000
--- a/libs/esl/src/include/cc.h
+++ /dev/null
@@ -1,3 +0,0 @@
-

*Note: This patch isn’t meant to offend anybody. If it did, well there’s not much you can do about it 😛