I hereby claim:
- I am rockhowse on github.
- I am rockhowse (https://keybase.io/rockhowse) on keybase.
- I have a public key ASBHXbtloxkk6Zi7nKOaVlPpHR-vkhrWzDsA1S7knEtzDwo
To claim this, I am signing this object:
| # Ways to execute a shell script in Ruby | |
| # Example Script - Joseph Pecoraro | |
| cmd = "echo 'hi'" # Sample string that can be used | |
| # 1. Kernel#` - commonly called backticks - `cmd` | |
| # This is like many other languages, including bash, PHP, and Perl | |
| # Returns the result of the shell command | |
| # Docs: http://ruby-doc.org/core/classes/Kernel.html#M001111 | 
| require 'csv' | |
| file = "#{Rails.root}/public/data.csv" | |
| table = User.all;0 # ";0" stops output. Change "User" to any model. | |
| CSV.open( file, 'w' ) do |writer| | |
| writer << table.first.attributes.map { |a,v| a } | |
| table.each do |s| | |
| writer << s.attributes.map { |a,v| v } | 
| #!/bin/bash | |
| # Log in into the box | |
| vagrant ssh | |
| # VirtualBox syncs host time with guest, so we need to shut off VBox Guest Additions first | |
| sudo service vboxadd-service stop | |
| # Now you can set any date and time | |
| sudo date -s "2020-10-01 10:25:00" | 
| # Install Ruby | |
| wget http://ftp.ruby-lang.org/pub/ruby/2.1/ruby-2.1.1.tar.gz | |
| tar xvzf ruby-2.1.1.tar.gz | |
| cd ruby-2.1.1 | |
| ./configure --prefix=/usr | |
| make | |
| make install | |
| # remove "ruby-2.1.1" folder in /root | 
I hereby claim:
To claim this, I am signing this object:
MCCI needs OpenSSL for a Windows project (that will be cross-platform). A casual search didn't turn up either a good source for cross-platform libraries, which meant we have to build them ourselves. A deeper search found a detailed guide here, and yet the details don't match what I found when I checked out the code; and the post doesn't talk about doing it directly from GitHub (which I wanted to do).
Here's the procedure for building OpenSSL on 64-bit Windows 10, with Visual Studio 2015.
In the following, I'll use lines beginning with
{dir} $to designate input to a bash Window. We'll also have to use acmd.exeWindow for much of the build, and those lines will be marked{dir}>, just as on Windows..
| from django.db import models | |
| class Address(models.Model): | |
| ADDRESS_UNIT_CHOICES = ( | |
| ('STE', 'Suite'), | |
| ('FLR', 'Floor'), | |
| ('NUM', 'Number'), | |
| ('RM', 'Room'), | |
| ('UNIT', 'Unit'), | |
| ('PO', 'PO Box'), | |
| ) | 
| import os | |
| import zipfile | |
| # project folder, where the files and zip resides | |
| root_dir = "C:\\User\\MyProject\\" | |
| # list files in root_dir | |
| file_name_list = os.listdir(root_dir) | |
| # name new zipfile |