Category: Rabbit Holes

  • Linux Shell history Output, Ch. 01 of Ruby on Rails Tutorial


    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.

  • Java AOP

    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

    pointcut test(): target(Main) &&
    (call(void testSaveAccount()));

    after(): test(){
    System.out.println("TestSaveAccount called");
    }

    pointcut test2(): target(Main) &&
    (call(void testOpenAccount()));

    before(): test2(){
    System.out.println("Derp");
    }

    }

    Eclipse Semantics for Advice

  • Git, Java, and Netbeans Useful Links

    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.

    platform.netbeans.org/tutorials/nbm-crud.html

    java.net/projects/nb-api-samples/sources/api-samples/show/versions/8.0/tutorials/DBManager

    youtube.com/watch?v=Kp5BSBoOw8k

    java.net/projects/help/pages/SourceControl

  • MEAN.js Stack

    https://hackhands.com/how-to-get-started-on-the-mean-stack/
    http://en.wikipedia.org/wiki/MEAN
    https://github.com/alexramsey92/mean/blob/master/README.md
    http://bower.io/#install-bower
    http://gruntjs.com/getting-started
    http://docs.mongodb.org/manual/tutorial/install-mongodb-on-windows/
    http://stackoverflow.com/questions/24599119/mongodb-not-working-error-dbpath-data-db-does-not-exist

  • Rabbit Hole of Research #1

    Rabbit Hole of Research #1

    https://www.benburwell.com/posts/your-website-is-not-special-dont-make-visitors-make-accounts/

    http://codahale.com/how-to-safely-store-a-password

    http://www.win.tue.nl/cccc/sha-1-challenge.html

    http://en.wikipedia.org/wiki/Secure_Hash_Algorithm#SHA-0_and_SHA-1

    http://en.wikipedia.org/wiki/Cryptographic_hash_function

    http://en.wikipedia.org/wiki/Birthday_attack

    jQuery Crash Course