Igor's Blog

There are different approaches to inserting a UUID into an Oracle Database table, ranging from Java to various ways of doing it in PL/SQL (as described here). Not many of these seemed appealing to me so I came up with my own approach using a trigger.

There was a bug in earlier versions of Oracle on AIX that caused SYS_GUID() to generate non-unique IDs so if you're still on an older version and using AIX, check this Oracle Support Note first: DUPLICATE SYS_GUID generated on AIX can lead to ORA-1 errors during enqueue (Doc ID 1371805.1).

Ok so triggers are a little bit like PL/SQL, but you don't have to worry about calling them, just create the trigger on a table and you're done. In my example below I assume that there is a table with the name MY_TABLE which has a column named MY_UUID of type VARCHAR2(36) that will hold the UUID.

Here's the code for the trigger...
 UUID Trigger
l_sysguid varchar2(32);
SELECT LOWER(SYS_GUID()) into l_sysguid FROM dual;
substr(l_sysguid, 1, 8) || '-' ||
substr(l_sysguid, 9, 4) || '-' ||
substr(l_sysguid, 10, 4) || '-' ||
substr(l_sysguid, 15, 4) || '-' ||
substr(l_sysguid, 20, 12)
INTO :new.MY_UUID FROM dual;

[Read More and Comment]  

, , ,

After struggling with emails not being being delivered to subscribers using SMTP over at travelblog.ws I started to look at alternatives to sending email and came across SendGrid. With SendGrid it's possible make use of your existing code that sends emails while taking SMTP completely out of the picture, at least on your end.

The problem that I was having was that my host (GoDaddy) has a very poor MX reputation. Some email providers like Microsoft (live.com, hotmail.com, outlook.com) outright block any email coming from such hosts. Furthermore it is also not possible to use a 3rd party SMTP service on my host since any outbound SMTP connections are blocked. It's a catch-22 situation, you either stick with bad reputation and risk your emails not being delivered or...well there is no or, unless you use a service like SendGrid.

SendGrid solved both of my issues. First they have a good reputation so your emails will get delivered and second the service can be accessed in a RESTful manner so you're not connecting to any SMTP server. Best of all, you get the first 12k emails in the month for free, which for me was more than enough.

Over at travelblog.ws it took less than an hour to go from signing up to having a fully functional SendGrid based email subsystem in place. Lets see how I went about it.

I signed up for a Free 12k $0.00 account.

After all the usual account verifications I created an API key. The admin console is very intuitive and easy to navigate, I was impressed already.

Because I was going to use this API key for actual sending, I created a General key (under Settings > API Keys). When creating a new key, it's possible to limit what functionality it would have access to, I set it to Full Access for all the features I wanted and No Access for features that I was never going to use. I didn't bother with any Read Only settings.

[Read More and Comment]  

, , , ,

I've been writing about G Suite for some time now and thought that I should share these discount coupons now too. By using these you'll get 20% off in your first year which means you'll only be paying $48 for your first year of using G Suite (if you have one user).

These are some of the previous articles I've written about G Suite:


So if you want to make a saving, here are the coupons to use:

Remember when you sign up to G Suite your first 30 days are free of charge!

[Read More and Comment]  

, , ,

Recently I've become interested in whether it wcould be possible to hide the Google Analytics or Google AdSense publisher IDs from online tools like SpyOnWeb.com and any lay people who may be looking at your site's code. This is when I came across this article that talked about de-obfuscating JavaScript encoded with JJencodep. After reading that article I had a few ideas and over a number of iterations came up with something that fit the bill.

First a bit of a disclaimer though - this approach is not 100% guaranteed to hide the publisher IDs, it's only meant to make it harder for the casual onlooker to see what the ID is. For someone determined this would be possible to bypass with a some effort, after all it is all client-side code.

In case you're wondering why you'd want to hide your publisher ID - well that's simply if you reuse the same ID across all of your web sites, it makes it easy for anyone to track down all of your sites and that's not always desirable.

So lets get started. I will show the easy case here, which is the Google Analytics (GA) ID, but the same process can be adapted to AdSense. A typical GA ID looks like this: UA-12345678-1.

Somewhere in the GA code there is a line that looks like this...
_gaq.push(['_setAccount', 'UA-12345678-1']);

The idea is to hide the GA ID and make it not appear directly in the code. Looking at the format of the ID and assuming it doesn't vary we can take a shortcut and encode just the numerical portion of it. This can be done by creating an object with properties that store numbers between 0 and 9. Then that object is used to concatenate the numbers into a string representing the GA ID. Since JavaScript is very flexible with variable names we already have something that's hard to read in the code below.
 JavaScript - First Version
/* object with number values */
$: 0,
_: 1,
$_: 2,
$$: 3,
__: 4,
_$: 5,
$$$: 6,
$$_: 7,
$__: 8,
___: 9
/* UA-12345678-1 */
var gaId = 'UA-' + _._ + _.$_ + _.$$ + _.__ + _._$ + _.$$$ + _.$$_ + _.$__ + _.___ + '-' + _._;

However it is still very easy to see what that code is doing. Furthermore that code defines a global variable that is readily accessible after the code is long done executing so you can access it any time again and again.

[Read More and Comment]  

, , ,
Follow me on...

Projects and Sites

My current and past projects
Igor and Elise's Travels
Riverside Expressway Cam
StrFunc() Online
300 George St Blogumentary
Guru JSON-RPC Tester
Extrudifier Object Designer

Recent Blog Posts

Automatically insert a UUID value into a table with Oracle

Taking SMTP out of your web app, a quick start with SendGrid

G Suite coupon for 20% discount in the first year

Playing with JavaScript variable obfuscation to hide Google Analytics and AdSense IDs

The right way to migrate from Gmail to G Suite email

Pulse Secure VPN not working on macOS Sierra and how to fix it

Multiple page PDF scanning does not work in macOS Sierra

Removing temporary email addresses from Google G Suite user admin console

VMware Fusion stops working after macOS Sierra upgrade

Fix G Suite SMTP error when adding another owned email address

Recent Galleries

Hardwood garden bench with clear resin void filler

Fixing a 3D printer extruder that stopped heating up

Easily increase disk space in a Lenovo Ideapad 100S 14" laptop with an M.2 SSD

Making a multi-piece 3D printed solder spool holder stand

DIY indoor apartment grow light wiring

Good Friday Electronics fun Easter Bunny LED PCB Kit IBEABU-01.0

DIY Aurora LED Color Light Cube Chromatography Glass Clock Kit

Building of the Hardwood Tiger Stripe TV Unit

Hardwood Tiger Stripe TV Unit

Kre-O Star Trek miniature kits

Top Categories

Blogs I follow

Matt Moores Blog
Georgi's FlatPress Guide
Perplexing Permutations
The Security Sleuth


RAWS Parts Online
Alpha Dimensions Hosting
Kristensen Photography
Ilia Rogatchevski
Travelling Fairy

Blog Activity

Blog Activity
RSS Feed  
Please follow me on...