Skip to content

Using NetSuite’s Token Based Authentication with SuiteTalk

NetSuite’s OAuth is very different from the standard oauth flow: setting up a user for token based auth is very cumbersome. It requires digging around in the NetSuite GUI, creating roles, and copy/pasting various keys. Why use token based authentication? The alternative is email + password based authentication. This method works fine, but passwords expire every six months; resetting passwords every six months is a huge pain for a SAAS product that integrates with NetSuite. Plus, email + password auth is much less secure (an attacker can login to the GUI with a email and password). Here’s a guide to getting setup with token based authentication. Note that you must be using a SuiteTalk API versions greater than 2015_2. 1…

Continue Reading

Fixing Invalid DATABASE_URL Reference on CircleCI

I’ve become a huge fan of CircleCI—it’s the best CI tool for small-medium projects that I’ve found. Recently I ran into an issue setting up a new rails project with Postgres as the database backend with circle: However, when I looked at my database.yml the constant DATABASE_URL was clearly not being used. DATABASE_URL was properly being used as the lookup string for an ENV reference: I was stumped for a while until I ssh’d into circle and noticed that somehow the single quotes were stripped from DATABASE_URL: Circle’s build inference process involves generating a database.yml file which uses the original database.yml file to some extent…

Continue Reading

Sending Dokku Container Logs to Papertrail

I’m a huge fan of Heroku. Although it’s expensive compared to a raw DigitalOcean droplet or EC2 instance, it’s so easy and it just works. However, there are some use-cases that Heroku doesn’t handle well. Business integration systems (eCommerce NetSuite integration, for example) often require handling requests that may take longer than the 30 second request timeout. Dokku is the next-best alternative to using heroku (if you don’t have enormous scaling needs: dokku apps are restricted to a single host). Here’s how to push your dokku app logs running to PaperTrail, or another syslog-compatible cloud hosting provider (I’m sure this approach would work for Loggly or CloudWatch)…

Continue Reading

3 Email Efficiency Tips

I wanted to share a couple quick email efficiency tips that have been helpful over the last couple weeks. When scheduling a meeting, instead of asking “What time would be good to meet?” suggest a exact time and day with two alternatives that work for you. Also provide a link to your full public calendar with event details hidden (I use ScheduleShare for this). For example: Would 2-2:30pm on Thursday the 12th work for you? If not, would Wednesday at 10:00am or Thursday at 11:00am work?..

Continue Reading

Steps to Refocus, Regroup, and Get Productive

After a series of unrelated meetings or going through a full inbox, it’s easy to feel scattered, unfocused, and distracted. This has happened to enough times, that I’ve written out an instruction manual for myself to enable me to quickly get refocused and back on the right track: Record everything in your head. Dump all tasks into your favorite task manager (ToDoist is mine!). Don’t attempt to label, prioritize, or organize tasks. Collect scattered tasks. Get all tasks, ideas, or unorganized bits of information in a centralized location. Run through any written information and transcribe any actionable items. I’d recommend setting up a “paper inbox” to throw all paper, notes, mail, etc so it’s easy to process…

Continue Reading

Action Steps for Doubling Morning Productivity

Here’s my system for engineering an incredibly productive distraction-free work block from when you wake up to 12:30pm. Although I don’t follow this routine all of the time, when I do I’ve hugely increased my ability to cut through the urgent and ensure that most important tasks for the day get completed. Download Focus App. Setup a weekly schedule to block all distractions from 4:30am to 12:30pm on all weekdays. If you want to impress your friends, block all distractions everyday. In addition to the stock list of websites, here are some applications I block: Mail. If you use the gmail web interface, download MailPlane so you can easily block it…

Continue Reading

Depositing Transaction Records in NetSuite

Moving transactions in NetSuite from "Not Deposited" to "Deposited" is not straightforward when using NetSuite SuiteTalk. You need to ensure that undocumented requirements for each record type are met. After you’ve validated that your records are properly configured, you can include them in a new deposit using the following structure: Note that you don’t need doc, type, or any of the other fields available on the a DepositPayment item. It’s also important to note that the other fields on the DepositPayment don’t actually effect how NetSuite handles the referenced transaction record. deposit, id, and payment_amount are the only fields that matter when referencing a NetSuite transaction on a deposit.

Continue Reading

Using Browser Sync with Rails and Local SSL

I’ve always been a fan of LiveReload since I first saw it years ago. However, the rack-livereload gem hasn’t been updated in a long while, and the livereload parent project seems to have died out too. rack-liveload doesn’t support reloading on local HTTPS connections, which was a requirement on a recent project—I needed a new tool. BrowserSync came to the rescue. In most cases, using BrowserSync’s proxy mode to reverse proxy a rails app running via a *.dev pow domain works well. For this particular project, there were a couple of specific issues: Many pages on the project force HTTPS…

Continue Reading

Using HTTPS Locally: Pow, SSL, Rails, and Apache

Using HTTPS local development or testing environments is a hassle. A common practice is to disable SSL in development, but I’ve had too many cases of minor bugs creeping in when routing works differently between environments. I also don’t like manually having to let my browsers know that a self-signed certificate is valid. Here’s the configuration that I use to easily add https support on my development machine to any application served—or proxied—through port 80. Pow I use Pow as my development rails server. However, because I often work with other languages as well, I run Apache (you could just as easily use nginx) and reverse proxy Rails application requests to Pow. To do this, you’ll need Pow to bind to a port that is not port 80…

Continue Reading