Select Page

Author: Darren Cato

Error installing nokogori

This has happened more that once so I thought I’d  document the fix. “gem install nokogori” produces the following error ERROR: Error installing nokogiri: ERROR: Failed to build gem native extension. A quick check of the log file ~/.rvm/gems/ruby-1.9.3-p551/extensions/x86_64-darwin-14/1.9.1/nokogiri-1.6.8/mkmf.log shows that the package libiconv was not found. On mac os, installing apple-gcc42 does the trick. Run brew install apple-gcc42 and try bundle install again reference http://stackoverflow.com/questions/19643153/error-to-install-nokogiri-on-osx-10-9-maverick Like this:Like...

Read More

Common things to do after creating a WordPress Digital Ocean droplet

Digital Ocean is a great Cloud hosting provider for getting projects up quickly. Their site contains a wealth of tutorials for just about any situation you may encounter. This post will server as a collection of must do tutorials after setting up any droplet. 1. Add an SSH key to your account Once added, you can select your SSH key and use it when creating future Droplets. This eliminates the need for root passwords altogether, and makes your Droplets much less vulnerable to attack. This is also just really convenient. 2. Create a Sudo user Don’t keep logging in as root. Create your own account with sudo access. Don’t forget to copy authorized_keys over to your new user account so you don’t have to keep using passwords. See best answer on how to do this. 3. Allow SFTP uploading to a folder This is especially important for WordPress type installs. See best answer 4. Increase the Max file upload size The max upload and max post sizes for WordPress are defined in /etc/php5/apache2/php.ini. Change these values be sure to restart apache for your changes to take effect: service apache2 restart 5. add a swap file Its not uncommon for WordPress installs to run out of memory on smaller digital ocean droplets, which can lead to database crashes. Follow this link to learn how to add a swap file and...

Read More

Tmux Cheatsheet

Tmux is a great tool to increase productivity in a unix shell environment. Tmux or Terminal multiplexer allows you to use multiple sessions, windows, panes and more. Unfortunately, remembering all the commands can be a bit difficult for a beginner. Below is a quick reference from the book Tmux: Productive Mouse-Free Development For Future Reference Creating Sessions Command Description tmux new-session Creates a new session without a name. Can be shortened to tmux new or simply tmux. tmux new -s development Creates a new session called “development.” tmux new -s development -n editor Creates a session named “development” and names the first window “editor.” tmux attach -t development Attaches to a session named “development.” Default Commands for Sessions, Windows, and Panes Prefix d Detaches from the session, leaving the session running in the background. Prefix : Enters Command mode. Prefix c Creates a new window from within an existing tmux session. Shortcut for new-window. Prefix 0…9 Selects windows by number. Prefix w Displays a selectable list of windows in the current session. Prefix , Displays a prompt to rename a window. Prefix & Closes the current window after prompting for confirmation. Prefix % Divides the current window in half vertically. Prefix " Divides the current window in half horizontally. Prefix o Cycles through open panes. Prefix q Momentarily displays pane numbers in each pane. Prefix x Closes the current...

Read More

Openshift Cheatsheet

Useful rhc Commands Tailing Logs The command rhc tail -a appname will tail all application log files in the OPENSHIFT_LOG_DIR directory for the primary web gear of the application. $ rhc tail -a myapp [--namespace mynamespace] Errors and Solutions Error You have already activated rack 1.5.2, but your Gemfile requires rack 1.6.0. Using bundle exec may solve this. (Gem::LoadError) Temp Solution ssh into the OpenShift app and in the app-root folder run gem install rack Like this:Like...

Read More

Adding SSL to your Openshift hosted website

In order to use ssl on openshift you must at least be on the free bronze plan. This was one of my primary reasons for choosing openshift over other PAAS out there. When building a self funded mvp, every little bit counts in terms of saving money. There are a few other tutorials out there for adding ssl to openshift, but tended to get stuck on the last step. I’ll run through the process and detail the final step. I’ll also provide some links to other tutorials and stackoverflow answers in case you’re still having trouble and need a different perspective. The first step is to ssh into your openshift account and generate the csr I’m assuming you have already purchased your ssl certificates from a reputable host  and selected your web server. If so they will prompt you to enter your “CSR” as in the diagram. To do this first ssh into you openshift account. Once you’re in go to: cd ~/app-root/data First generate private key: openssl genrsa -des3 -out myapp.key 2048 Now create csr openssl req -new -key myapp.key -out myapp.csr Finally copy the csr encrypted content and paste to provider cat myapp.csr You may also want to scp ‘myapp.key’ to your local machine so it can be used later. The final step is to combine if all your cert files. If it is not already ready...

Read More
%d bloggers like this: