Practice of taking any idea, any concept and then stripping it back to basic, fundamental building blocks that are incontestable, free of subjective bias and can be universally accepted as facts.
You do this by questioning every assumption you think you know about a given problem or scenario and challenging current knowledge that is learned, but not essential and doing this over and over until you get to its most basic roots. You will be able to:
- Think inventively.
- Invent new solutions to old problems.
- Change trajectory of creating from iterating on existing thinking to one of genuine innovation.
- Retain and use knowledge effectively because they understand the fundamental building blocks.
Sunday, June 16, 2019
Tuesday, April 23, 2019
Friday, March 15, 2019
Deployment Rails 5.2 App to Linode
Articles arranged by sequence to get a new Rails 5.2 app deployed to Linode.
1. Initial Linode Server Setup
2. Installing Prerequisite Packages and Ruby 2.6.1 on Ubuntu 18.04
3. Install Nginx and Passenger on Ubuntu 18.04
4. Install MySQL 5.7 on Ubuntu 18.04
5. Deploying Rails 5.2 App using Capistrano 3
6. Integrate Twitter Bootstrap 4 with Rails 5.2
7. Mapping Domain Name to IP Address
8. Installing SSL using Letsencrypt on Nginx and Ubuntu 18.04
1. Initial Linode Server Setup
2. Installing Prerequisite Packages and Ruby 2.6.1 on Ubuntu 18.04
3. Install Nginx and Passenger on Ubuntu 18.04
4. Install MySQL 5.7 on Ubuntu 18.04
5. Deploying Rails 5.2 App using Capistrano 3
6. Integrate Twitter Bootstrap 4 with Rails 5.2
7. Mapping Domain Name to IP Address
8. Installing SSL using Letsencrypt on Nginx and Ubuntu 18.04
Sunday, March 10, 2019
git error
error: src refspec master does not match any.
This can happen when the files are not committed.
Upgrading Git to Latest Version on Ubuntu
sudo add-apt-repository ppa:git-core/ppa -y
sudo apt-get update
sudo apt-get install git -y
git --version
Tuesday, February 26, 2019
exec: \"/bin/bash\": stat /bin/bash: no such file or directory
docker: Error response from daemon: OCI runtime create failed: container_linux.go:344: starting container process caused "exec: \"/bin/bash\": stat /bin/bash: no such file or directory": unknown.
ERRO[0000] error waiting for container: context canceled
Resolution:
bash must be installed on the Docker image.
Friday, February 22, 2019
Install Ruby 2.6.1 using RVM
rvm get stable
rvm pkg install openssl
rvm install ruby-2.6.1 --with-openssl-dir=$HOME/.rvm/usr
rvm pkg install openssl
rvm install ruby-2.6.1 --with-openssl-dir=$HOME/.rvm/usr
cannot create directory ‘/var/www’
Resolution: create the directory on the server and provide permission to deploy user:
sudo chown deploy:deploy /var/www/
sudo chown deploy:deploy /var/www/
Don't know how to build task 'deploy:updated'
Resolution
In Capfile the require statement sequence matters:
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails'
In Capfile the require statement sequence matters:
require 'capistrano/setup'
require 'capistrano/deploy'
require 'capistrano/bundler'
require 'capistrano/rails'
Saturday, February 16, 2019
sqlite3 error in rails 5.2
Error loading the 'sqlite3' Active Record adapter. Missing a gem it depends on? can't activate sqlite3 (~> 1.3.6), already activated sqlite3-1.4.0. Make sure all dependencies are added to Gemfile. (LoadError)
uninstall sqlite3 and
Add:
gem 'sqlite3', '~> 1.3.6'
uninstall sqlite3 and
Add:
gem 'sqlite3', '~> 1.3.6'
Monday, January 28, 2019
Forking Example
puts "Parent process id : #{Process.pid}"
TEST = 10
fork do
puts TEST
puts "---- Child process id : #{Process.pid}"
puts "---- Parent process id : #{Process.ppid}"
end
fork do
puts TEST
puts "**** Child process id : #{Process.pid}"
puts "**** Parent process id : #{Process.ppid}"
end
puts TEST
puts "Waiting for child to exit"
Process.wait
puts "Done"
at_exit do
puts "About to exit the program"
end
Sunday, January 27, 2019
Vagrant Basics Presentation Notes
What is Vagrant?
Vagrant is a tool for building complete development environments, sandboxed in a virtual machine. Vagrant lowers development environment setup time, increases de‐ velopment/production parity, and brings the idea of disposable compute resources down to the desktop.
- Create a virtual machine
- Modify RAM, number of cps etc of the virtual machine
- Setup shared folders
- Boot virtual machine
- Provision software on the machine via a shell script, Chef, Puppet etc
Manage Lifecycle of the Machine
- SSH into the machine
- Shut down the machine
- Destroy the machine (delete all virtual hard drive)
- Suspend or resume the machine
- Package the machine state and distribute it to other developers
Why Vagrant?
- Installations can be difficult
- Configuration is even more difficult
- Manual setups result in difference between development and production
- Multiple projects become very difficult (different configurations)
- Difficult to keep development environments in sync for everyone in the team
Vagrant encourages automation to setup the development environment. Vagrant puts your development environment into a virtual machine, working with multiple projects is easy, because each project just get its own virtual machine. Finally, working with a team is easier than ever, since you can share the virtual machine image. And bringing a new team member on board is as simple as telling them to build their Vagrant machine with a single command.
Setting up Vagrant
1. Install VirtualBox
2. Install Vagrant (Installers for various platforms)
First Vagrant Machine
vagrant init precise64 http://files.vagrantup.com/ precise64.box
vagrant up
vagrant ssh
vagrant destroy
The Vagrantfile
mkdir vagrant_ex
cd vagrant_ex
vagrant init precise64 http://files.vagrantup.com/ precise64.box
[Vagrantfile for Vagrant 2 goes here]
Boxes
Vagrant::Config.run do |config|
config.vm.box = "precise64"
config.vm.box_url = "http://files.vagrantup.com/ precise64.box"
end
vagrant up
vagrant status
vagrant ssh
By default, Vagrant shares the project directory (the directory with the Vagrantfile) to /vagrant inside the virtual machine. After SSHing into the virtual machine, this can be verified by listing the files in that directory:
vagrant@precise64:~$ ls /vagrant/
Vagrantfile
You can over-ride the shared folder:
config.vm.share_folder "v-root", "/foo", "."
First, anidentifierforthesharedfolder .Inthiscase,byspecifyingv- root,thedefault shared folder that Vagrant sets up is overridden.
Next,/ fooisthepathwherethefolderwill existintheguestmachine. Thispathwill be created if it doesn’t already exist. If it does already exist, the location will be replaced with the contents of the shared folder.
• Thethirdparameter,"." isthepathofthefoldertobeshared fromthehostmachine. This can be an absolute or relative path. If it is relative, like the example, it is relative to the project root. So in the example, it is sharing the project root.
vagrant reload
Restarts the machine with the new configuration
Basic Networking
config.vm.forward_port 80, 8080
vagrant reload
vagrant ssh
cd /vagrant
sudo python -m SimpleHTTPServer 80
vagrant suspend
vagrant status
vagrant up
vagrant halt
vagrant halt --force
vagrant up
vagrant destroy
vagrant status
vagrant destroy --force
vagrant up
Provisioning Vagrant VM
Create a provision.sh
#!/usr/bin/env bash
echo "Installing Apache and setting it up..."
apt-get update >/dev/null 2>&1
apt-get install -y apache2 >/dev/null 2>&1
rm -rf /var/www
ln -fs /vagrant /var/www
Add this line to Vagrantfile
config.vm.provision "shell", path: "provision.sh"
Vagrant::Config.run do |config|
config.vm.box = "precise64" config.vm.forward_port 80, 8080 config.vm.provision "shell", path: "provision.sh"
end
vagrant up
Boxes
Boxes are the base images upon which Vagrant environments are built.
Boxes are an optimization so that Vagrant doesn’t have to install a complete operating system on every vagrant up. Installing an operating system from scratch generally takes up to 30 minutes on a good computer.
$ vagrant box add precise64 http://files.vagrantup.com/ precise64.box
$ vagrant box list
$ vagrant box remove precise64 virtualbox
Monday, January 21, 2019
Subscribe to:
Posts (Atom)























































