This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
sudo apt-get update | |
sudo apt-get install -y ruby | |
git clone https://github.com/jeff-r/ez-dotfiles.git | |
cd ez-dotfiles | |
git checkout jeff | |
cd bash | |
ruby activate.rb | |
cd ../git | |
ruby activate.rb |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#cloud-config | |
users: | |
- name: jeff | |
ssh-authorized-keys: | |
- ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABAQDm3WW3XM9TIdhUFwqXHrN9oEMjBLJTa48RUICUDLW6OyG4Mzhu3baKegFqbTIM0WF8pUGqQz0aSTdvtceqxKYqm/6q/pv/z1kGo6aUUACvTh6E3bpjp4jzO5gOlImhTGvxnkpJA9tBvQU1rICOnMhZuDytv6flMtd5KY+boGIQ89ONO2CuvZ5svXZfok0hABRoTrw8e92mOhHIN5CmtpNlyfuOu+m4DB59TCHK+SaEkbxYkuXH9YrkWdDXGyNeEKiMKTpfYBTBnz1PC2zSDus6CyGkoky6tLJPisxUfJWbCStS96k50ywm2uvGqhIwWz2EYvV4hyy0u25MCx6/paSZ [email protected] | |
sudo: ['ALL=(ALL) NOPASSWD:ALL'] | |
groups: sudo | |
shell: /bin/bash | |
write_files: | |
- path: /etc/ssh/sshd_config |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
I'm on my laptop. git.curlydogsystems.com is an ubuntu box with lxd containers running. | |
In one of the containers, currently at 10.59.108.168, I'm running a Rails app. | |
10.59.108.168 is only visible from git.curlydogsystems.com; I can't see it from my laptop. | |
The Rails app runs on the default port 3000 in the container. I want it at 3030 on my laptop. | |
ssh -L 3030:10.59.108.168:3000 -N git.curlydogsystems.com | |
The other way to do this is to have nginx on git.curlydogsystes.com proxy the http requests to | |
the container. This works. But I'm getting odd errors. When I go to Ohana's /admin/whatever routes, | |
the Rails app can't recognize the request routes. Something about the proxying is confusing it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.apache.http.client.methods.{CloseableHttpResponse, HttpGet} | |
import org.apache.http.impl.client.HttpClientBuilder | |
import scala.util.Try | |
class RestClient { | |
def getRestContent(url:String): Try[String] = { | |
val client = HttpClientBuilder.create.build | |
val result = Try( { | |
val request = new HttpGet(url) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ack "scenario.*:\w+(,| do)" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
" Folding for Ruby | |
" | |
" ,z -- Show only last search | |
" ,zz -- Show only "describe ..." and "it ..." lines in specs | |
" ,zd -- Show only "class ..." and "def ..." lines in Ruby files | |
" zR -- Remove all folds | |
" | |
" From http://vim.wikia.com/wiki/Folding_with_Regular_Expression | |
nnoremap ,z :setlocal foldexpr=(getline(v:lnum)=~@/)?0:(getline(v:lnum-1)=~@/)\\|\\|(getline(v:lnum+1)=~@/)?1:2 foldmethod=expr foldlevel=0 foldcolumn=2<CR> |