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
2018-02-04
MacBook Pro 2012 broken GPU fix
I have a 17" 2011 MacBook Pro that suffers from the notorious GPU video failure (https://www.bit-tech.net/news/tech/laptops/apple-admits-gpu-design-flaw/1/)
Here is the work-around to turn off the GPU. Credit to PeytonPlaysMc
Here is the work-around to turn off the GPU. Credit to PeytonPlaysMc
- Boot into Recovery Mode 
 For High Sierra 10.13.4 or earlier:
 Hold Command+R+S keyboard buttons while pressing the power button
 For High Sierra 10.13.5 or later:
 Command+R+S (Recovery mode Single-user) no longer works.
 https://apple.stackexchange.com/questions/332587/single-user-recovery-mode-on-high-sierra-10-13-6
 To get to Recovery Mode,
 * Hold Command+S and press the power button
 * On prompt, type commandnvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00 reboot
 * Hold Command+R to enter Recovery Mode GUI
 * Click on "Utilities" on the top menu bar and pick "Terminal"
 * Goto Step 2 below
 
-  Disable System Integrity Protection (SIP)
 Type on the command prompt
 csrutil disable
- Reboot MacBook Pro into Single User mode
 Type on the command prompt
 reboot
 Then hold Command+S keyboard buttons
- Hard disk check
 Type on the command prompt
 /sbin/fsck -fy
- Mount root file system in read-write mode
 Type on the command prompt
 /sbin/mount -uw /
- Make a directory to save the AMD drivers
 Type on the command prompt
 mkdir /AMD_save
- Move AMD drivers to the save directory
 Type on the command prompt
 mv /System/Library/Extensions/AMD* /AMD_save
- Delete AMD driver cache
 Type on the command prompt
 rm -rf /System/Library/Caches/com.apple.kext.caches/
- Create AMD drive cache directory
 Type on the command prompt
 mkdir /System/Library/Caches/com.apple.kext.caches/
- Force refresh of drive cache and reboot
 Type on the command prompt
 touch /System/Library/Extensions/nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00 reboot
- Boot into Recovery ModeFor High Sierra 10.13.4 or earlier: 
 Hold Command+R+S keyboard buttons
 For High Sierra 10.13.5 or later:
 See step 1 above
- Enable System Integrity Protection (SIP)Type on the command prompt
 csrutil enable
- Reboot MacBook Pro to normal mode.Type on the command prompt
 reboot
- Launch Terminal in UI and typesudo nvram fa4ce28d-b62f-4c99-9cc3-6815686e30f9:gpu-power-prefs=%01%00%00%00 
- Restart MacBook Pro one final time
Subscribe to:
Comments (Atom)
