Git Simplified

One of most common technology that new professional developers struggle with is git.

Many junior developers are eager to start using all of the powerful commands of git and usually end up getting more confused.

Here are a few commands that I recommend to anyone learning git for the first time:

clone

This downloads entire git repo from a remote server, usually. You will get all revision history and branches.

init

This initialize new empty git repo in current directory. As a junior developer you are unlikely to do this. Most likely you will be cloning an existing project.

Another caveat here is that when you initialize a git repo, you will need to set remote destination to push your code changes. But let’s not worry about it yet.

checkout

Once you have cloned a repo on your machine, you can checkout a specific branch. By default when you clone, master branch is checked out. Most likely you will be working in some other branch. So you will check it out by typing git checkout branch-name

pull

This command pulls changes from remote server into your local copy of repo. If you are working a branch that another developer created then that developer needs to push that branch to remote server, then you can pull it. And finally you can check it out. I see many junior developers not pulling before checking out a new branch.

commit

This is simple make your changes and commit your code to repo. When you issue this command, your changes are stored in your local copy of repo. You will need to issue push command before your changes are pushed to remote server and only then other developers can pull your changes.

push

This pushes your local repo with all local to changes to remote server.

Many times you will need to merge changes from remote in your local repo before you can push.

merge

This is where things get a bit confusing new developers. There are likely 3 different cases when you merging:

2 or more developers are working on same branch

This is simplest case. You can simply issue git pull command and it will fetch and merge remote changes. Now this can result in conflicts, which will need to be resolved manually. I will talk about conflicts later.

New release went out

It is recommend to merge master (or default) branch into your branch often especially right after any major release. This avoids any conflicts later during Continuous Integration pipeline.

You need a feature from another branch

This is probably the worst scenario to deal with because now your branch is dependent on another branch. I prefer to avoid this scenario unless the feature is in master. The reason for avoiding this scenario are two folds, first code reviews get hard as it is hard to tell what was changed in your branch and what was pulled in from the other branch. And then many times my code got delayed because I was waiting on other branch.

You may have to issue pull command before merging

git pull
git merge other-branch my-branch

Tools of Trade

I use 13-inch MacBookPro for personal projects and 15-inch for work. My personal MBP would be last traditional laptop, hopefully. Since most of my work can easily be done on Linux VPS. I have been using 10.5-inch iPad Pro with Blink shell for most my side projects. I like the form factor of iPad Pro and I am getting better at Linux administration. Now I am also setting up Docker images so I can bring up new images as needed.

Though I might still need personal computer mostly for photos and videos but I might as well buy a desktop next time. I can build a powerful video editing station for fraction half or less than what a decent MacBookPro would cost.

MacOS Tools

Brew.sh

This makes installing various software dev tools super easy.

VS Code

I was a big fan of Sublime Text and PHPstorm but VS Code finally won me over. PHPStorm is still better for PHP work but VS Code lighter and faster to open, so I end up opening it more often than PHPStorm.

Docker

I am getting into DevOps and spinning up new VPSs as needed, Docker is pretty much default choice for this.

iaWriter

This is my favorite writing software. I am using this for writing and pretty much all my blog posts.

iOS Tools

This is the best terminal software I have used. It is free and Open Source too. This is all you need to use iPad for development of most web apps and machine learning.

iaWriter

iOS version on iPad Pro is perfect. A lot of my blog posts are written in Starbuck on iPad.

WorkingCopy

It is a git client. In theory, I didn’t need it when you got shell access to a Linux machine. But vim is great for writing code but not so much when writing blogs.

So I use WorkingCopy to clone my blog on iPad, add new posts with iaWriter, and then again use WorkingCopy to commit and push my posts. I use Netlify for hosting this blog, so as soon as I push new posts, Netlify will publish it here.

Linux Tools

I have been using Ubuntu as my main flavor of Linux. The list of tools that I use on Linux is long but here are some:

  • Nginx
  • PHP
  • Python
  • Conda
  • Nodejs
  • npm
  • git
  • composer
  • MariaDB
  • vim

You don’t need a web developer

Occasionally, when people find out I am a programmer, they ask me if I will build  them a website or an app on the side. As I spend all day programming at my work, I rarely have motivation to continue programming after work.

However, talking to most people, I realize they don’t need a programmer; most of their needs can be met by a simple SaaS solution. Recently, I directed a few friends to WordPress.com, SmugMug, Shopify, etc. They all were happy with the results and ease of use. Also I am glad they talked to me because one guy was ready to spend a few thousands on a developer for a WordPress-based site.

Here is my recommendation for various SaaS solutions for various business needs:

A website to show business information

WordPress.com

This is my number one recommendation when the goal is simply to show simple business information. Sites hosted on WordPress.com as opposed to self-hosted version cannot install custom themes or plugins. But in exchange you get one of most stress-free website for as low as $36 per year.

Squarespace

This is my second recommendation especially if you want visually modern looking website. Its visual editor let anyone customize beautiful themes. Highly recommended if you have large beautiful pictures of your place of business.

A website for photographers

SmugMug

For a photographer, I recommend SmugMug. Though you can also use SquareSpace or even WordPress.com if your goal is to only show off your portfolio.

But SmugMug provide additional photographer centric features such as private galleries, ability to order prints, and even sell digital prints.

A website to sell

Shopify

It seems that Shopify is gold standard when it comes to ecommerce SaaS solutions. Also it provides beautiful templates and a lot of customization options. And when your business grows bigger, there is a huge community of Shopify developers who can help you integrate your online store with your back-office systems such as ERP, CRM, etc.

BigCartel

Personally, if I was selling something online, I would start off with BigCartel, mostly because it is cheaper and seems to provide as many options as Shopify for new online businesses.

Email Collection for Marketing

Mailchimp

Email is still one of most effective marketing medium. You should be collecting email addresses of visitors to your website. Mailchimp provides very clean and easy to use interface for collecting emails and sending out newsletters.

Good news is that Mailchimp has integration for all of above SaaS website solutions except SmugMug.

When You Really Do Need a Developer

Ok sometimes you really need a software developer or developers. Here are some reasons when you should look to contracting or even hiring developers:

  1. Your product is a software, a website, or an app. If you are selling such a product you probably already know that you need programmer or multiple programmers.
  2. You want to build iOS or Android app. A lot of people in service industry have asked me for a simple apps for their businesses, such as appointment schedulers for a hair salon, or a simple app to show special menu for little mom n pop restaurants. Personally, I haven’t found any easy way for business owners to create their own.
    1. NOTE: Most businesses don’t need a simple app to show just information about their business. Instead focus on a good website that is equally useful on cellphones as on desktop.
  3. You want to integrate your website with ERP, CRM, accounting software, etc. I have worked on Magento integration with various systems. Let me tell you, it is not easy or simple. Even as a developer, I was pulling my hair out.

Wordpress vs Hugo

Managing WordPress can get time consuming. I have tried to move to static website several times but kept going back to WordPress. But there are several advantages of static sites generators that I finally moved for good. I am also advising a lot of my clients to use Hugo especially when they know that they will rarely ever update their sites.

Here are some of main advantages of Hugo (or other static site generators) vs WordPress and other CMS.

No System Administration

In order to run WordPress, you need a web server. You will need to configure it, install database and PHP. A server hosting a website is always connected to Internet. So it is always available target for hackers. This means you need to secure the server properly and keep it up to date.

When using Hugo, you don’t need PHP and database. All you need is a web server, this reduces attack surface area significantly. As long as you don’t have any extra software running on the server, all you need to worry web server being properly secured.

Of course, you can use shared hosting for WordPress and avoid all headaches of System Administration.

No WordPress or plug-ins to update

The one huge advantage of Hugo is that there is no code to execute. Well no code on server to execute. You may still have some Javascript. But this Javascript code executes in a user’s browser and unlikely to be easily exploitable.

WordPress & plugins executes code on a server. This mean bugs in WordPress can be exploited to access your server or even install malicious code. That code can further infect your users’ machines. I have spend hours and hours restoring websites for clients when their websites got hacked. Of course, you can avoid this by keeping your WordPress installation up to date and carefully choosing plugins & themes. But this means regularly logging in the WordPress admin interface and applying any new updates.

On other hand, you will never have to update Hugo generated site once generated. Only time you will update is to change some content on it.

Simpler Backups

Normally, I don’t give admin login for WordPress & server because of risk involved with client installing bad plugin or messing up something else. I used to manage backups myself.

But I have tried to restore WordPress sites that were developed by someone else. Backup were too old, theme didn’t work with current version of WordPress. Some plugins were not in backup file and are no longer available. And the worst backup file contained viruses & malware.

With Hugo, client gets zip file but it includes full functioning website. While it is still technical, but it should be a lot simpler to restore a static website. It can be as simple as uploading a folder to web server.

No Updates that Break your Site

Since static sites don’t need to be updated to secure against hacks, there is very little worry about any update that will break theme. If you don’t update your Hugo version, you should get same results if you run it against same source files.

In WordPress land, I have seen some people not updating their website for months or years and then when they do, it breaks their theme or plugins.

Where WordPress Wins

There is one area where Hugo cannot touch WordPress. When client is actually using their WordPress site as blog or if they regularly post new content. With static sites, client will need to be technical enough to use markdown and git. Or they will email posts to you.

In my experience though most people rarely update their websites regularly enough to warrant all the extra headache involved with hosting WordPress.

My Hugo Workflow

Personally, I moved my blogs to Hugo because of above reasons and I like the new workflow. My workflow consist of

  1. Email myself a blog idea as I get it.
  2. Write a rough draft either in iA Writer on iPad or skip this step and
  3. Write final version in Sublime Text on my laptop
  4. Commit and push

I love iA Writer for its typewriter mode where the line that you are writing stays in the middle of screen rather than at the bottom.


iPad Pro for Programming & Fun

I finally bought 10.5” iPad Pro (Affiliate Link). It was mostly an impulse purchase. When first I started to use iPad, it felt blah. It is hard to find good apps or what apps you might want to try out.

My main goals with iPad was to have a really small laptop replacement. So I was hoping for a decent code editor. There are some code editing apps but there is no way to try them out before purchasing. So I am spending a lot of time reading reviews before I purchase any app.

Before purchasing iPad, I read a few blog posts by some programmers using their iPad as their main computing device. They all said they had some issues but it was doable. Unfortunately, sample size is a bit small right now and it seems it is doable only if you ssh into a server. There is no easy solution for local dev.

Then my other goal was to use iPad as entertainment and artistic device. For these functions, I didn’t need to buy Pro version but because I wanted smallest and lightest possible profile with a keyboard; my only choice was Smart Keyboard. And Smart Keyboard only works with Pro version.

So here are my current apps.

Apps for Programming

I am still looking for a code editor app. Most programmers’ workflow was to login on server and edit code there. Here are my current apps:

I started off with Termius shell client but quickly got tired of tapping screen to hit escape. I could not find anyway to remap keys in it. After some search, came across this post about using iPad Pro as main computer for programming. Based on his recommendation, I bought Blink shell for $20. This app let’s you map CAPS Lock key to escape and that was all I needed this for. However, its UI feels cleaner and more polished than Termius too.

I would recommend Blink over Termius unless you are unlikely to spend a lot of time in shell. And initially I was hoping I would not have to login to a server to code, but increasingly it looks like I will have to, that’s the other reason why I gave up and bought this.

Working Copy

This great free app. It works great with BitBucket. You can clone your repos, use built-in editor to edit files, commit & push. Perfect for local code editing. If you have CI/CD, you don’t have to do much more than push your code.

Termius

This is a great ssh client. Another free app. It has onscreen keyboard for sending keys that are missing on Smart Keyboard such as escape. However, I don’t want to use persistent connection. I want to be able to code on a plane or by pool. So local editor like Working Copy is the best option for me. This will come in handy though for when you need to debug or fix issues on the server.

Swift Playground

This is just a tutorial for learning swift but it is really really well made. I am really enjoying use it. I might end up learning Swift because I just like using this app. Highly recommended for kids and those who are new to programming.

Drawing Apps

Procreate

I didn’t need to buy this as there are tons of free sketching apps. But this app kept coming up whenever I was searching for tutorials on drawing on iPad. It was also recommended by some of my friends. So I bought it.

It definitely a few level above free apps. One of the best feature I like about this app is that you can export images of any size. Most free apps limit the max resolution of images. For printing especially on t-shirts, this is perfect.

Sketchbook

This free app and it is close competitor to Procreate. Only thing is that I could not figure out how to export high resolution images from it. So I gave up and bought Procreate.

Photography Apps

  • Instagram
  • Polarr
  • VSCO
  • Adobe Comp
  • PS Express
  • Snapseed
  • Photoshop Mix
  • Photoshop Fix

I think all of these apps are available for Android cellphone. The real advantage of using these apps on iPad is big beautiful screen.

More Creative Apps

GarageBand

This is fun. Just messing with it, I was able to make pretty decent sounding music. Need to play with this more.

I have GarageBand on my MacBook too but never played with it. Touch interface seems a lot more natural for making music.

iMovie

Another app that is already available on MacBook. I have used it on my Macbook but touch interface makes it a bit easier use. However, iMovie on iPad lacks stabilization feature.


Working Remotely

As a developer, I am lucky that I get to work from home as needed. But I have never been 100% remote; Lately, I have been reading a lot about working remotely, remote first companies, Digital Nomad lifestyle etc. This is compilation of various resources that I have found useful so far:

The Ultimate Guide to Working Remotely - I haven’t gone through whole guide yet but so far it has been very informative.

Remote Job Search Boards

The Remote Freelancer - A massive list of remote jobs search boards. Hosted on GitHub.

Some of more popular remote job boards are:

And then a list of Remote Friendly Companies and another massive list of Resources for Remote Jobs and Digital Nomads on GitHub.

Freelancing Rates - These are based on locations in the US, Canada, England, and Australia. Though these probably don’t reflect remote only rates.


Upgrading to PHP 7.0 on Ubuntu 14

I upgraded PHP to version 7.0 on Ubuntu box. Running php -v on shell would show it as version 7.0. But Apache was still using PHP 5.6. I tried various methods to update settings for Apache but nothing worked until I issued following commands:

sudo a2dismod php5.6
sudo a2enmod php7.0
sudo service apache2 restart

Source: PHP 7.0 (and 5.6) on Ubuntu | LornaJane


Setting Up Laravel on MacOS

After 3 years, I am using Laravel again at work. Laravel has extensive documentation but sometimes it can be a bit verbose. Here are command to get you started as soon as possible. This assumes pretty much fresh install of MacOS.

Install Homebrew

Check the official site for latest command

/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"

Install PHP 7.1

brew install homebrew/php/php7

Install MariaDB

brew install mariadb

Set MariaDB to start as service at the end of installation.

Install Composer

Get Composer from https://getcomposer.org/download/ and make sure to install it globally for easier use.

Install Laravel

composer global require "laravel/installer"

Add following line to .bash_profile in home directory

export PATH="$HOME/.composer/vendor/bin:$PATH"

And restart terminal or issue this command:

source ~/.bash_profile

Install Valet

Valet is very useful for setting up dev environment.

composer global require laravel/valet

valet install

Create Projects Directory

Now create a projects directory and let Valet know it should server from that directory.

mkdir ~/sites

cd ~/sites

valet park

Test your setup

Now in sites directory, create a new laravel project:

laravel new blog

and load http://blog.dev

If everything went smoothly, you should see a fresh Laravel project.


The E-Myth Revisited by Michael E. Gerber

My biggest takeaway from this book was that most people start business to create a job for themselves. For example, a person who enjoys baking may start a cake shop. The problem with this approach is that one is working in the business, not on it. The right way to start a business is with a goal of eliminating one’s job. For example, the person above should figure out a way to hire someone else to do baking.

This was a slightly hard lesson to digest because as programmer, I have often dreamed about starting consulting business. Mostly, so that I get to work with more interesting technologies.

The other lessons were:

Establish Processes & Document Everything

Create a business that can be easily franchised. In order for a business to be franchisable, it needs processes and systems. So document and create repeatable processes. You may never want to franchise, but well-established processes will help a business run smoother.

How to choose business

This was another interesting way to figure out what sort of business one should pursue.

  1. Start with your life’s goal. Of course, life’s goals change but choose something for now. It could be something like spend more time with family and volunteer at homeless shelter. It could be to own a biggest house in the town.
  2. Now choose your business strategy that will help you achieve your life’s goals. It could be a business that you can sell in a few years for $10 Million. Or it could be a business that can run on its own with minimal involvement from you and generate $100K yearly income.
  3. Finally, look at business opportunities. The first requirement for any business is revenues. Then see if it aligns with your business strategy. If your strategy is to generate semi-passive income while traveling the world, then pursuing a Silicon Valley style startup is probably not a good idea.

Write Job Descriptions

Another interesting idea presented was to write down all positions you see your business will need eventually. Draw organization chart. Then start hiring for each position. Initially, you will be filling all these positions, from CEO to lowest ranking worker. Your goal should be to work in each position, systemize it, and hire someone else. You should start filling positions at the bottom of chart first, slowly moving up as you systemize each position.

Manage by Delegation

One last point, many first time business owners manage by absenteeism once they hire someone. This usually doesn’t end well as employees then have no idea if they are doing good or not. Before you hire someone, their position should have well defined criterias to measure against. And you should actively review work done by your direct reports.


If you like to read this book, you can purchase it here using my Affiliate Link:


The Subtle Art of Not Giving a F*ck

I learned of Mark Manson through his blog, especially this post, 7 Strange Questions That Help You Find Your Purpose. Since then I have been on and off following his blog. He usually has a lot of good advice, so finally I decided to get his book. Makes it easier to have all information in one place.

I had no idea what Subtle Art of Not Giving a F*ck was about. It was an impulse purchase, perhaps to support his blog. It turns out to be a really good book. As a semi-regular reader of his blog, I sort of knew what his philosophies were. Still it was good to read everything in one place.

He is not encouraging to not care about anything but to care about things that matter. It is human nature to care. But a lot of us start to worry about things that don’t matter. Sometimes, it is because we have nothing to care about. For example, elderly lady in retirement home who has all her needs met, would get really pissed if her coupon is not accepted at supermarket because that is all she got.

Sometimes, we care about useless issues because real issues are too hard to deal with. For example, unemployed person may go back to school for their 3rd degree just because they are unable to get a job.

The basic idea is everyone cares about something but is it the right thing. His philosophy is very similar to Stoicism or even Buddhism philosophy.

The book is written well and easy to read. If anything negative, I would say that he is a bit verbose. Some of stories in it dragged on a bit too long. For example, when he was in his principal’s office, it was clear about what was going to happen but he dragged on that scene a bit too much.


Ftp from Lightroom

I signed up on a few microstock sites hoping recoup some of cost of my camera. These sites provide FTP access for easy uploading photos. Lightroom doesn’t come with an easy way to publish or export photos to FTP site.

But Lightroom SDK comes with a free sample plugin that can export photos to a FTP site. It works really well and very easy to install. I learned this at LightroomSolutions.com.


The War of Art

I wasn’t sure what to expect when I picked up “The War of Art” by Steven Pressfield. It shows up on Hacker’s News and other entrepreneurs’ forums regularly as a recommended reading. Steven Pressfield is a novelist but this book is popular reading for anyone who is pursuing a goal.

The author’s main point is that the most important and the hardest thing is doing. Weather that be sitting down at desk to write a novel or software. Once you are at your desk, or at your office, the hard part is done. This can apply to anything; fitness, painting, photography, etc.

Things that make you the most nervous about doing; are probably the most important things. If these were not important to you, then you would not feel resistance when attempting these things.

One last piece of advice that I really liked was from Bhagwagita. It says that one has no right to their fruit of labor, only their labor. Basically, one should work hard without any expectations of reward. If they are lucky, their work will bring them all kind of rewards such money, fame, respect. But if they don’t get anything in return for their work, then so be it. They should do work for work’s sake and nothing else.


Lightroom & Smugmug Workflow

Now that I have a new fancy camera, I have tried to organize my photos better. Over years I have collected about 70GB of photos. It seems a lot to me but apparently there are many people with well over 1000 GB of photos. The biggest challenge with so many photos is that it is hard to organize them. Upon several recommendations and some searches on the web, it seems Lightroom is the best software for organizing and managing photos.

Then I want to share my photos in a slightly professional manner. I am still trying to decide between Smugmug, Zenfolio, or just sticking with free social media sites like Facebook or Flickr. But so far I am leaning towards Smugmug because I can customize it a bit and for occasional client work, I have a decent looking website.

I am still refining my workflow to organize my old photos but I wanted to share it, just so it can give someone else some ideas too.

Move Old Photos in One Folder

I bought Scott Kelby’s The Adobe Photoshop Lightroom CC Book for Digital Photographers (Affiliate link). So following his advice, I am keeping all my photos in one folder. Under that folder I created several folders like Events, Friends, Family, Travel, Personal, Clients, and Old Photos.

Delete Photos

The next steps is to go through 1000s of photos and reject any photo that should have been deleted long time ago. Some bad photos have nostalgic value; I keep those. But anything that is not a decent photo, I delete it.

Lightroom makes this process easy. Under Folders module, I browse to Old Photos, then a sub-folder under it. Then I press e & shift+tab for large view of photos. Then I simply use arrow keys to browse photos. Pressing x on a photo would mark it as rejected. I spent about 15-30 minutes a day on this process. Finally, I press control+backspace to permanently delete rejected photos.

Move Photos to Permanent Spot

After I have cleaned up a folder under Old Photos, I move it under proper top-level folder such as Events. Then I rename folder to something more informative such as 2012 Hina Birthday. I also rename photos with this format:YYYYMMDD-Custom-Text-Sequence. This should aid in searching for photos if using Windows Explorer or if browsing outside of Lightroom.

Edit Photos

Next step is to edit photos like crop, straighten, sharpen, adjust exposure etc.

Select Photos for Smugmug

I know a lot of people upload all their photos to Smugmug for backup. But I am using Backblaze for backup. So I don’t worry about backing up my photos on Smugmug. But now I have to decide which photos are good enough for public sharing and which should be shared privately.

To be honest, I am still refining this process. I have installed SmugMug plugin in Lightroom, which is actually very helpful.

Folder Structure on Smugmug

Using Lightroom, I created several galleries & folders on Smugmug including:

  • Portfolio – Gallery of my favorite photos.
  • Landscapes – Gallery of my favorite landscape photos.
  • Portraits – Gallery of my favorite portraits photos.
  • Travel – Folder with many galleries (hopefully).
  • Events – Folder with many galleries (hopefully).
  • Private – Unlisted and password protected folder with several subfolders.
  • Friends
  • Family
  • Events
  • Travels
  • Personal
  • Fun
  • etc

Select Photos to Share Privately

Now if subfolder has any photos that should be shared privately such as Birthday photos, I will upload almost all of photos in it to a new gallery under correct private sub-folder. I haven’t be able to decide if gallery should be password protected too or not. I hate to create bunch of unlisted or password protected galleries. But I know many of my friends or family members would not want their photos on the open web. Though I have password on top-level folder but some photos should not be shared with every member of family or every friend. Perhaps I should create multiple top-level private folders. Or maybe I should just stick with email/Dropbox method of sharing private photos. The problem with this method is that sometimes people lose their photos and then ask for them again and again. Also I want to make it easy for my family & friends to order prints online.

Pick the Best Photos for Public Sharing

Now I pick the best photos and upload to a public gallery. In case of Travel or Events, I create a new gallery per vacation or event.

Once again this part is not well-defined. Since I share only the best photos publicly, Travel or Event galleries tend to be sparse. Also I hate duplicating effort to upload photos multiple times.

Not using Collections

So far I haven’t figure out how to efficiently use collections. They seems to duplicate efforts. I am essentially maintaining my collections under Smugmug plugin.

The only problem with this approach is that if I switch to another platform for online photos sharing, then I will have to start over selection process.


This is it for now. As I learn more, I will update this post.


Lightroom & Smugmug Workflow

Now that I have a new fancy camera, I have tried to organize my photos better. Over years I have collected about 70GB of photos. It seems a lot to me but apparently there are many people with well over 1000 GB of photos. The biggest challenge with so many photos is that it is hard to organize them. Upon several recommendations and some searches on the web, it seems Lightroom is the best software for organizing and managing photos.

Then I want to share my photos in a slightly professional manner. I am still trying to decide between Smugmug, Zenfolio, or just sticking with free social media sites like Facebook or Flickr. But so far I am leaning towards Smugmug because I can customize it a bit and for occasional client work, I have a decent looking website.

I am still refining my workflow to organize my old photos but I wanted to share it, just so it can give someone else some ideas too.

Move Old Photos in One Folder

I bought Scott Kelby’s The Adobe Photoshop Lightroom CC Book for Digital Photographers (Affiliate link). So following his advice, I am keeping all my photos in one folder. Under that folder I created several folders like Events, Friends, Family, Travel, Personal, Clients, and Old Photos.

Delete Photos

The next steps is to go through 1000s of photos and reject any photo that should have been deleted long time ago. Some bad photos have nostalgic value; I keep those. But anything that is not a decent photo, I delete it.

Lightroom makes this process easy. Under Folders module, I browse to Old Photos, then a sub-folder under it. Then I press e & shift+tab for large view of photos. Then I simply use arrow keys to browse photos. Pressing x on a photo would mark it as rejected. I spent about 15-30 minutes a day on this process. Finally, I press control+backspace to permanently delete rejected photos.

Move Photos to Permanent Spot

After I have cleaned up a folder under Old Photos, I move it under proper top-level folder such as Events. Then I rename folder to something more informative such as 2012 Hina Birthday. I also rename photos with this format:YYYYMMDD-Custom-Text-Sequence. This should aid in searching for photos if using Windows Explorer or if browsing outside of Lightroom.

Edit Photos

Next step is to edit photos like crop, straighten, sharpen, adjust exposure etc.

Select Photos for Smugmug

I know a lot of people upload all their photos to Smugmug for backup. But I am using Backblaze for backup. So I don’t worry about backing up my photos on Smugmug. But now I have to decide which photos are good enough for public sharing and which should be shared privately.

To be honest, I am still refining this process. I have installed SmugMug plugin in Lightroom, which is actually very helpful.

Folder Structure on Smugmug

Using Lightroom, I created several galleries & folders on Smugmug including:

  • Portfolio – Gallery of my favorite photos.
  • Landscapes – Gallery of my favorite landscape photos.
  • Portraits – Gallery of my favorite portraits photos.
  • Travel – Folder with many galleries (hopefully).
  • Events – Folder with many galleries (hopefully).
  • Private – Unlisted and password protected folder with several subfolders.
  • Friends
  • Family
  • Events
  • Travels
  • Personal
  • Fun
  • etc

Select Photos to Share Privately

Now if subfolder has any photos that should be shared privately such as Birthday photos, I will upload almost all of photos in it to a new gallery under correct private sub-folder. I haven’t be able to decide if gallery should be password protected too or not. I hate to create bunch of unlisted or password protected galleries. But I know many of my friends or family members would not want their photos on the open web. Though I have password on top-level folder but some photos should not be shared with every member of family or every friend. Perhaps I should create multiple top-level private folders. Or maybe I should just stick with email/Dropbox method of sharing private photos. The problem with this method is that sometimes people lose their photos and then ask for them again and again. Also I want to make it easy for my family & friends to order prints online.

Pick the Best Photos for Public Sharing

Now I pick the best photos and upload to a public gallery. In case of Travel or Events, I create a new gallery per vacation or event.

Once again this part is not well-defined. Since I share only the best photos publicly, Travel or Event galleries tend to be sparse. Also I hate duplicating effort to upload photos multiple times.

Not using Collections

So far I haven’t figure out how to efficiently use collections. They seems to duplicate efforts. I am essentially maintaining my collections under Smugmug plugin.

The only problem with this approach is that if I switch to another platform for online photos sharing, then I will have to start over selection process.


How to Fail at almost Everything & Still Win Big

How to Fail at almost Everything but still Win Big by Scott Adams (affiliate link) comes up on Hackers’ News a lot. Finally, I had a chance to read it.

This is a little different kind of book compared to my regular reads about ultra-successful business titans. I had no idea who Scott Adams was until I heard about this book. He created Dilbert comic. He gave very down to earth perspective on how he achieved success in this book.

Basically, he started various ventures throughout his life including restaurants, websites, etc. Eventually, he started getting traction on his Dilbert comics, so that became his number one focus which led to even more success. He developed passion for comics & art as his comic got more popular and earned him financial success.

The main takeaways for me are try try again, you will fail at most things, passion grows as project grows.


Magento – Get All Products with Categories in a Flat View

    SELECT
        w1.website_id,
        w1.name as website_name,
        s1.store_id,
        s1.name as store_name,
        p1.entity_id as product_id,
        p1.sku,
        pname.value as product_name,
        url.value as url_path,
        small_image.value as small_image,
        msrp.value as msrp_price,
        price.value as price,
        p1.created_at as product_created_at,
        p1.updated_at as product_updated_at,
        visibility.value as visibility,
        pstatus.value as status,
        case
            when
                (pstatus.value = 1
                    and visibility.value > 1)
            then
                1
            else 0
        end as enable_flag,
        c1.entity_id as category_id,
        cname.value as category_name,
        c1.parent_id,
        c1.created_at as category_created_at,
        c1.updated_at as category_updated_at
    FROM
        catalog_product_entity p1
            inner join
        eav_attribute p_attr ON p1.entity_type_id = p_attr.entity_type_id
            and p_attr.attribute_code = 'name'
            inner join
        catalog_product_entity_varchar pname ON pname.entity_id = p1.entity_id
            and pname.attribute_id = p_attr.attribute_id
            inner join
        eav_attribute p_attr2 ON p1.entity_type_id = p_attr2.entity_type_id
            and p_attr2.attribute_code = 'url_path'
            inner join
        catalog_product_entity_varchar url ON url.entity_id = p1.entity_id
            and url.attribute_id = p_attr2.attribute_id
            and pname.store_id = url.store_id
            inner join
        eav_attribute p_attr3 ON p1.entity_type_id = p_attr3.entity_type_id
            and p_attr3.attribute_code = 'small_image'
            inner join
        catalog_product_entity_varchar small_image ON small_image.entity_id = p1.entity_id
            and small_image.attribute_id = p_attr3.attribute_id
            and pname.store_id = small_image.store_id
            inner join
        eav_attribute p_attr4 ON p1.entity_type_id = p_attr4.entity_type_id
            and p_attr4.attribute_code = 'msrp'
            inner join
        catalog_product_entity_decimal msrp ON msrp.entity_id = p1.entity_id
            and msrp.attribute_id = p_attr4.attribute_id
            and pname.store_id = msrp.store_id
            inner join
        eav_attribute p_attr5 ON p1.entity_type_id = p_attr5.entity_type_id
            and p_attr5.attribute_code = 'price'
            inner join
        catalog_product_entity_decimal price ON price.entity_id = p1.entity_id
            and price.attribute_id = p_attr5.attribute_id
            and pname.store_id = price.store_id
            inner join
        eav_attribute p_attr6 ON p1.entity_type_id = p_attr6.entity_type_id
            and p_attr6.attribute_code = 'visibility'
            inner join
        catalog_product_entity_int visibility ON visibility.entity_id = p1.entity_id
            and visibility.attribute_id = p_attr6.attribute_id
            and pname.store_id = visibility.store_id
            inner join
        eav_attribute p_attr7 ON p1.entity_type_id = p_attr7.entity_type_id
            and p_attr7.attribute_code = 'status'
            inner join
        catalog_product_entity_int pstatus ON pstatus.entity_id = p1.entity_id
            and pstatus.attribute_id = p_attr7.attribute_id
            and pname.store_id = pstatus.store_id
            inner join
        catalog_category_product ccp ON ccp.product_id = p1.entity_id
            inner join
        catalog_category_entity c1 ON c1.entity_id = ccp.category_id
            inner join
        eav_attribute c_attr ON c1.entity_type_id = c_attr.entity_type_id
            and c_attr.attribute_code = 'name'
            inner join
        catalog_category_entity_varchar cname ON cname.entity_id = c1.entity_id
            and cname.attribute_id = c_attr.attribute_id
            and pname.store_id = cname.store_id
            inner join
        catalog_category_product_index store1 ON store1.product_id = p1.entity_id
            and store1.category_id = c1.entity_id
            inner join
        core_store s1 ON store1.store_id = s1.store_id
            inner join
        core_website w1 ON s1.website_id = w1.website_id

OpenShift Error: Layer 7 Wrong Status, Invalid Response

I have been playing with OpenShift for past several hours. It looks great. But a while back I started to get 503 Internal Server error.

When I checked logs using rhc tail , I saw this error: Layer 7 Wrong Status, Invalid Response 404.

I spent an hour or so troubleshooting. Turns out the issue was Netbeans had added src/main/web/app/WEB-INF/jboss-web.xml when I ran the application locally on my machine. I committed this file, thinking I might need it. Deleting it from repo fixed the issue.