node.js, npm, and git: How to create deployable node.js code
0 Comments Published October 17th, 2011I wasted days of my life trying to figure out how to create a solid deployment of node.js applications across heterogenous environments. Maybe I can spare you some of the trouble.
To me, deployable means that the application should be
- able to be rolled out, with 100% confidence across development, quality assurance, and production environments, with no modification to the codebase.
- Require only a minimal subset of pre-installed libraries. In the case of node.js, this means each environments should only guarantee the correct node version and npm version. Nothing else.
- The application can be monitored for uptime, and can be restarted like any other unix service.
So, I have written a node.js application. I have provided a package.json file. I run npm install in the application’s folder. All the dependencies are installed correctly and my application runs. Great!
I then git add the application to the repository. And then I go to another server and do a git pull of my current branch. I try to start my application, and it fails, due to missing libraries. Why?
The problem is that npm-installed modules include instructions to the developer’s source code management tool. Instructions such as svn ignore, or git ignore. The files are included in their code when they export their modules to the archive.
So if you are unlucky enough to be using the same source code management tool as the module developer, you might be running afoul of the instructions the developer gave to his or her own repository.
So, as a git user, when I install my node modules and then issue the git add command, the downloaded modules are not allowing git to add their dependencies, because of the included .gitignore files telling git to ignore the node_modules directories. Thus, the application works locally, but not when you try to pull into another environment.
Developers need to ignore their own dependencies during development and packaging. This is appropriate. But they should also be removing their source code management tool’s helper file before they share their code.
That, however, is not going to happen, so it’s up to us to resolve.
So what I do now before adding and committing new code in a node module is this:
for f in ` find . -type f -name '.gitignore'`; do
sed -i'' -e '/^node_modules/ d' "$f"
done
which removes all the references in the .gitignore instructions for node_modules directories.
Then, when I git add, *all* the npm installed code gets added to the repo, not just the top-level dependencies. Pulling the code into another environment now retrieves all the dependencies, even three or four levels down.
I will follow up with some suggestions covering the other points I made about making a node.js app deployable.
MacTech Magazine interview on AppleJack
1 Comment Published July 30th, 2010 in Reviews & Notices, ToolsJosh Long, of MacTech Magazine, interviews Kristofer Widholm, lead developer of AppleJack, for an episode of MacTech Live. We delve into some of the parts of the hidden “expert mode,” and talk about the history of AppleJack. You can hear the somewhat boisterous (and embarrassingly geeky) interview here.
AppleJack 1.6 released. Snow Leopard compatibility at last.
0 Comments Published July 12th, 2010 in Reviews & Notices, ToolsThe long (and somewhat bitterly) awaited AppleJack 1.6 with support for Snow Leopard has been released and is immediately available from http://sourceforge.net/projects/applejack.
CREDITS
Current Version: There would probably be no AppleJack for Leopard or Snow Leopard without the yeoman efforts of Steve Anthony. He put in countless hours into solving the Leopard startup riddle, thereby giving Leopard compatibility a chance at seeing the light of day. Also, I wish to thank Dave Provine at Premier Mac for helping kickstart the development process by providing 3 test partitions of Snow Leopard for me to mess with. A big thank you.
Testers: Thanks also to Charly Avital, Joshua Long (MacTech Magazine), John Stiver, Thomas Ungricht, and Matthew Weinman for risking their files (and their sanity) by helping test AppleJack before release on repeated occasions. Thanks also to all of you (too many to name) who have pitched in with the occasional bug report or test results.
CHANGE LOG
#1.6
+ Snow Leopard compatibility [feature 2845796] (Thanks again to Steve Anthony)
– Improved limits on output from syslog to STDOUT
– Simplified startup of services on Leopard and Snow Leopard
– Fixed bug in creation of user account lists in Snow Leopard where system accounts would show up
+ S.M.A.R.T. status verification is now being done in the expert mode. I still want to implement this using smartmontools, but for now diskutil will do.
+ Blessing of Mac OS X System folders on attached volumes is now possible. This is a primitive bless, ie, it does not create boot files, but simply blesses the chosen System folder and (optionally) sets it to be used for startup on next launch.
I was saddened to see that the lovely, generous, and top-notch independent developer Peter Borg decided to quit developing his sharp little text editor “Smultron” (which is Swedish for wild strawberry, in case you’re wondering).
The package is still available from sourceforge.net, of course, but if you are a Mac OS X tiger user like I am, you might be discouraged to note that none of the recent releases work with Tiger, and there are no release notes or comments indicating which file is the most up-to-date Tiger-compatible release.
I did some brute-force testing, and discovered that version 3.1.2 of Smultron is the last release that supported Tiger.
You can download Smultron for Tiger here: http://sourceforge.net/projects/smultron/files/
One of the reasons I like Smultron so much is that it supports bash syntax highlighting, something BBEdit has never done. (I might also add, incidentally, parenthetically, sotto voce, etc, that the bash syntax hightlighting was a feature Mr. Borg generously included due to me literally begging for it.)
Now I’m sure he’s working on the next great thing. Meanwhile, a fork of Smultron has been created (aptly named Fraise, French for strawberry) and development goes on.
Courtesy of twitter user @hotdogsladies (). Pithy, always brilliant:
via @hotdogsladies (June 3, 2009)
“Star Reviews
(ordered by typical usefulness)1. ★★★
2. ★★
3. ★★★★
4. ★★★★★
5. ★”
AppleJack wins MacWorld Editor’s Choice Award
Closed Published January 9th, 2009 in Reviews & NoticesA UPS delivery woman appears. There’s a big box on her shoulder.
—Please sign here, she says.
I sign. I look at the address of origin. Not even the faintest flicker of recognition. Who or what?
I open the box. Inside the box is the largest and heaviest trophy I’ve ever received. It’s a sixteen inch, bronze and gold plated statue featuring an androgynous, futuristic, vaguely human being holding aloft—what is it, a Mac SE 30? At it’s base, the words: “2008 MacWorld Editor’s Choice Awards, AppleJack 1.5, The Apotek.” Come to think of it, the statue shares some characteristics with an Academy of Motion Picture Arts and Sciences award (a.k.a. the Oscar): mute, muscular, angular, yet poised for eternal calm.
Continue reading ‘AppleJack wins MacWorld Editor’s Choice Award’
Background
I sometimes use my Treo 680 as a voice recorder to capture ideas for songs. For a long time I thought all the files were being backed up to my Mac. It wasn’t until I had to do a hard reset, that I realized they were not restored to the Voice Memo application as selectable voice memos. They were still on my Treo, but I couldn’t get to them or play them.
When I looked through my Palm user data files on my Mac I saw that they were in the backup folder as vpad.pdb files.
[ ~/Documents/Palm/Users/palm_username/Backups] $ ls -al | grep Vpad
-rw-r--r-- 1 user user 5430 Jul 5 20:13 07-10-22-16-32-Vpad.pdb
-rw-r--r-- 1 user user 3782 Jul 5 20:13 07-10-22-16-322-Vpad.pdb
-rw-r--r-- 1 user user 188406 Jul 5 20:13 07-11-14-1-24-Vpad.pdb
-rw-r--r-- 1 user user 64214 Jul 5 20:13 07-11-20-18-22-Vpad.pdb
-rw-r--r-- 1 user user 11590 Jul 5 20:13 07-11-20-18-222-Vpad.pdb
-rw-r--r-- 1 user user 79030 Jul 5 20:13 07-11-20-18-23-Vpad.pdb
-rw-r--r-- 1 user user 84390 Jul 5 20:13 07-11-20-18-25-Vpad.pdb
-rw-r--r-- 1 user user 40790 Jul 5 20:13 07-11-25-19-38-Vpad.pdb
-rw-r--r-- 1 user user 60518 Jul 5 20:13 07-3-16-21-37-Vpad.pdb
-rw-r--r-- 1 user user 107014 Jul 5 20:13 07-3-20-0-19-Vpad.pdb
-rw-r--r-- 1 user user 28038 Jul 5 20:13 07-3-20-0-23-Vpad.pdb
-rw-r--r-- 1 user user 43270 Jul 5 20:13 07-3-20-0-25-Vpad.pdb
-rw-r--r-- 1 user user 425270 Jul 5 20:13 07-7-24-1-45-Vpad.pdb
-rw-r--r-- 1 user user 131254 Jul 5 20:13 07-8-5-0-25-Vpad.pdb
-rw-r--r-- 1 user user 317942 Jul 5 20:13 07-8-5-22-36-Vpad.pdb
-rw-r--r-- 1 user user 333974 Jul 5 20:13 07-9-17-23-06-Vpad.pdb
-rw-r--r-- 1 user user 278870 Jul 5 20:13 08-2-10-18-31-Vpad.pdb
-rw-r--r-- 1 user user 85606 Jul 5 20:13 08-5-20-21-25-Vpad.pdb
However, there were no playable audio files where I expected to find them (/Users/username/Documents/Palm/Users/palm_username/Voice%20Memo/). That was when I realized that the hotsync conduit for Voice Memo did not work, and never had been working. There seems to be some incompatibility between the Treo 680 voice memo files and Mac OS X. I don’t see why this has not been fixed yet, but whatever the cause of this negligence on the part of the developers, I was stuck with a bunch of Vpad.pdb files that I could no longer access on my Palm or play on my Mac. Some of them were extremely important to me, containing ideas for an upcoming album.
Details of my scenario:
Palm Treo 680 running Palm OS Garnet v. 5.4.9
Voice Memo version 1.4
HotSync Voice Memo conduit version 1.0 (so that's why!!! :-) )
Mac OS X 10.4.11
Nevertheless, I felt fairly confident that embedded in these pdb files were some kind of normal audio file format. I could not imagine that Palm would have invented an entirely proprietary compressed audio format.
Continue reading ‘Recovering vpad.pdb files from a Palm Treo 680 with Mac OS X’
While BBEdit has a great tool for comparing and applying changes between files, it does not generate standard .patch files that can be used for bug reports, code fixes, and change logging.
BBDiff will compare the contents of the frontmost window to the contents of the window just behind it, and will use the diff command line tool to generate diff output which is then pasted into a new BBEdit window for saving or pasting into a Web site.
The command line called by BBDiff by default is:
diff -up newfile oldfile
You can modify this by simply changing the diffopts property at the top of the script.
Using your t-mobile Treo 680 as internet access point via Bluetooth with Mac OS X
11 Comments Published April 23rd, 2007 in TechniquesHere is the technique I used in order to be able to connect my MacBook Pro to the Internet through my t-mobile Treo 680′s internet access. Please note: You need full internet access from t-mobile, not just the $5.95/month e-mail and WAP package they sell.
This worked for me, but I make no guarantee that this will work for you. I’m posting it in the hopes it will be helpful to you, but I do not intend to offer support or advice through this posting, as there are too many factors involved for me to do it effectively without turning it into a full-time job. So, yes, you’re on your own, but at least you might get some ideas and hints here. While I will not be posting or responding to questions for help; if you have any edits or suggestions in order to make this posting clearer or otherwise better, I will certainly welcome such feedback.
Background: While reading this thread on this topic at TreoCentral <http://discussion.treocentral.com/newreply.php?do=newreply&p=1153461>, I noticed there were no instructions or hints being provided for the Mac, so I decided to see if it could be done.
Technorati Tags: bluetooth, DUN, internet access, Mac OS X, palm, t-mobile, treo 680
[QUOTE=TopTenTodd;1153461]How about for Mac?[/QUOTE]
I did the following steps using a MacBook Pro running Mac OS X 10.4.8, with the “palm Treo 680 PDA Phone (Unlocked)” (PALM) over t-mobile’s network.
Continue reading ‘Using your t-mobile Treo 680 as internet access point via Bluetooth with Mac OS X’
Convoluted title, eh? After many years of intermittently being miffed when I couldn’t just type cd /NameofAlias and have the bash shell transport me into the directory the alias pointed to, I finally decided to do something about it.
First stop: Mac OS X Hints, where I looked at these two hints:
Enable ‘cd’ into directory aliases from the Terminal
A script to reveal alias paths in the Terminal
From the insight gained there, I cobbled together my one-step solution to the problem…
Continue reading ‘Making the Mac OS X bash shell alias and symlink agnostic’
Search BlogAboutThe Apotek is an Internet consulting firm located in Brooklyn, New York. |
Categories
|
Latest Posts
|
||
