I saw that the Mt. Agung Volcano was active and under an evacuation warning earlier today. Out of curiosity, I googled around to find out more about how I could know up to the minute what was going on with it. To weed out the nonsense from the real information I used the following query: Mount Agung seismic activity -news -guardian -express -cnn and went to page 3 or 4 to find the following:
The following is output after running history command in a C9 Console (c9.io) where I am attempting my first Ruby on Rails application (Tutorial: railstutorial.org) using the Cloud 9 web IDE. Impressive amount of functionality after limited configuration. Going from zero to running application in ~50 commands is a rare feat today with how complicated the web stack world can be. Even have two environments running: prod and dev by using Heroku to deploy prod.
Project Console History Output (console 1)
Get Ruby Version 1 ruby -v
Setup Git/Bitbucket 2 git config --global user.name "your name"
3 git config --global user.email email@gmail.com
Quick aside: Server Daemon Console history output (console 2)
Install rails 1 gem install rails -v 5.1.2
Make rails app on c9 2 rails _5.1.2_ new hello_app
Goto app dir 4 cd hello_app/
Quickly read README 6 cat README.md
Quickly read Rakefile 8 cat Rakefile
9 ls
Troubleshoot bundle (dependency mgmt) 10 bundle install
11 bundle update listen
Update bundle of Gems after modifying Gemfile due to version differences
12 bundle update
13 bundle install
Spin up local rails server without params 14 rails server
Spin up rails server with params 15 rails server -b $IP -p $PORT
Create a new Git repo 7 git init
Add files to Git repo using gitignore 8 git add -A
Check status of working tree in Git 9 git status
Make a commit to repo with added files 10 git commit -m "Init repo"
Take a look at SSH for BitBucket setup 11 cat ~/.ssh/id_rsa.pub
Returning to Project Console (console 1) History Output
Add SSH key for use with BitBucket 16 git remote add origin ssh://git@bitbucket.org/username/project
Push to origin current repo, failed because of bad syntax 17 git push -u origin all
Check status of repo 18 git status
Check log of repo 19 git log
Create a master branch to troubleshoot failed push 20 git checkout -b master
Realized my username was wrong for use with BitBucket 21 git config --global user.name "username"
Pushed again, correct syntax this time 25 git push -u origin --all
Checkout to newly created modify branch for Readme work 26 git checkout -b modify-README
See branches for heck of it 27 git branch
Commit changes to repo 29 git commit -a -m "Update readme"
Go back to Master branch 30 git checkout master
Merge branches 31 git merge modify-README
Remove modify branch 32 git branch -d modify-README
Push changes 33 git push
Check status again 34 git status
Modify Gemfile to include :development and :production 35 bundle install
38 bundle install --without production
39 git commit -a -m "Update Gemfile for Heroku"
Check Heroku version for deployment to production 40 heroku version
Setup Heroku 41 heroku login
42 heroku keys:add
Create Heroku Virtual App Instance 44 heroku create
45 git push heroku master
46 git commit -a -m "Update Gemfile for Heroku"
Check on Heroku Virtual App Instance 49 heroku help
50 heroku status
51 heroku sessions
52 heroku webhooks
See progress of issued commands in the Console Window 53 history
This concludes Chapter 1 output. I will post subsequent chapters as I complete them. My goal is to revisit the process I go through to reinforce learning and identify where I made mistakes for future avoidance and for more understanding.
AspectJ Notes: Aspect Oriented Programming allows you to achieve an extra level of separation of concerns ontop of OOP methodology.
Key terms:
– Pointcut defines wherein the code a joinpoint (injection is what they should’ve called it) will occur.
– Advice defines what happens at the specific joinpoint.
– Weaving is the process of injecting the advice into the joinpoints.
Example code:
public aspect LicenseFee {
// playing with this to see if I can get this to work
// eclipse constantly checks to see if you actually are implementing the method before weaving occurs
// almost like it actively weaves before runtime, no wonder my computer is so slow running this thing
// so that means that when I go to run tests, some errors may occur but it should be okay/runnable despite the fact
ssh root@ip
adduser username
gpasswd -a username sudo
ssh-keygen
cat keyfilename.pub
Copy Public Key to Clipboard
su username
mkdir .ssh
sudo chmod 700 .ssh
nano /.ssh/authorized_keys/
Paste Public Key from Clipboard
chmod 600 /.ssh/authorized_keys/
exit
Return to Root User
nano /etc/ssh/sshd_config/
PermitRootLogin no
service ssh restart
exit
ssh username@ip
Recently I reformatted my computer after being fed up with a “dirty” Windows install. What I found was that because I was trying out so many different development environments, I was having trouble maintaining a clean foundation for future work. It occurred to me that a possible solution for this would be to virtualize operating systems with Ubuntu/Linux, which of course would be license “free”. By using VirtualBox, I could run a couple VM’s with installed IDEs like IntelliJ or NetBeans, WAMP stack, or Visual Studio on a Windows License so that my localhost would be independent and freed up from walking all over each other. I remember last year working on something called Vagrant. Vagrant takes this idea a step much further by creating ready made boxes, hosted here, for use by anybody. So if you want to quickly jump into a development environment, you can!
In preparation for my new job, I’ve started to explore Java and Netbeans. In the process, I figured I would revisit using Git to cross reference some example code on Java.net while trying to learn about CRUD operations. Below is a list of links I found quite helpful.
Not the most elegant thing but functionally it adds a lot to my day to day driving experience.
Over Christmas 2015, I picked up a $45 Android tablet with the intentions of mounting it into my 2010 Honda Accord as a media device. For now, I’ve used some black Velcro to mount it but would eventually like to explore the 3d printer realm and create a custom mount for it. I disabled many of the pre-installed applications, installed Spotify (a music subscription service), and installed a neat application called Tasker.
I used Tasker in conjunction with AutoInput which essentially mirrors any programmed key-presses by searching for the internal UI shell command. All of this can be accomplished without rooting. I purchased a USB charger for the center console power port in addition to a thin USB cable and 1/8″ cable. Luckily, my car turns off the power port automatically when the car is off, unlike some other domestic models. After about an hour of tweaking, I had a working in car entertainment device that would:
On power/charging detection, would turn on the screen, open the Spotify app, wait 6 seconds, and Play music from the last specified playlist.
On power/charging off, would pause Spotify, wait 3 seconds, and dim the screen. By leaving the app open, it syncs with my Wifi network when I pull into the driveway nightly.
From 7am to 5:30pm, would turn the screen brightness to max setting.
From 5:31pm to 6:59am, would turn the screen brightness to min setting.
A helpful guide I followed for programming Tasker is here, with the exception of the input commands, as those were taken care of by the AutoInput application. The most important thing to note is the use of wait times in Tasker, so that the device is provided with enough time to execute each operation and not ignore overlapped operation requests.
The latest development with this project, is that under extreme cold temperatures, the tablet greatly misbehaves. I need to probably program the tablet to turn off based on a weather forecast. We had a 10F low and I found that it had factory reset itself after being left in the car all night, which means that I need to reprogram it entirely. Avoiding that scenario, I will probably look for a custom recovery which would allow me to take a full image backup to keep on the Micro SD card.
The tablet I purchased can be found here. (as of Jan 2016)