Problem:
Running Ruby on Rails 'bin/rails s' and you get an error
in require: cannot load such file -- json (LoadError)
Solution:
Edit the Gemfile and add
gem 'json'
SyntaxHighlighter JS
2018-10-29
Installing Ruby on Rails on AWS Linux
To install Ruby on Rails on the AWS Linux VM, you need to install some prerequisites first.
sudo su -
yum install -y ruby24
alternatives --set ruby /usr/bin/ruby2.4
yum install -y ruby24-devel rubygems ruby24-devel gcc zlib-devel patch sqlite-devel
curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs
gem install rails
rails --version
sudo su -
yum install -y ruby24
alternatives --set ruby /usr/bin/ruby2.4
yum install -y ruby24-devel rubygems ruby24-devel gcc zlib-devel patch sqlite-devel
curl -sL https://rpm.nodesource.com/setup | bash -
yum install -y nodejs
gem install rails
rails --version
2018-10-26
Add hard disk to VMware CentOS 7 VM
There are two easy steps to add a hard disk for a a VMware CentOS 7 VM
https://dev.to/juttayaya/add-hard-disk-to-vmware-centos-7-vm-22m8
- Assign a new hard disk in VMware vSphere
- Configure the new hard disk in CentOS
https://dev.to/juttayaya/add-hard-disk-to-vmware-centos-7-vm-22m8
2018-10-25
Get the original username of sudo
For auditing and logging purposes, I needed to get the original Unix login username and not the sudo account name.
The Unix command to get the original login username is
logname
With the logname command, the operator can su and sudo to various accounts and it will still display the original login.
To try it on a Unix prompt
sudo su - oracle
echo My sudo id is $(whoami) and my login id is $(logname)
Output:
My sudo id is oracle and my login id is juttayaya
Reference:https://stackoverflow.com/questions/4598001/how-do-you-find-the-original-user-through-multiple-sudo-and-su-commands
The Unix command to get the original login username is
logname
With the logname command, the operator can su and sudo to various accounts and it will still display the original login.
To try it on a Unix prompt
sudo su - oracle
echo My sudo id is $(whoami) and my login id is $(logname)
Output:
My sudo id is oracle and my login id is juttayaya
Reference:https://stackoverflow.com/questions/4598001/how-do-you-find-the-original-user-through-multiple-sudo-and-su-commands
Subscribe to:
Posts (Atom)