Skip to content

Instantly share code, notes, and snippets.

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
#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
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.
@jeff-r
jeff-r / RestClient.scala
Created November 29, 2015 23:05
Get the content of a web request
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)
@jeff-r
jeff-r / Find bare flags
Created January 21, 2013 22:34
Regex to find bare flags in rspec scenarios
ack "scenario.*:\w+(,| do)"
@jeff-r
jeff-r / gist:1226832
Created September 19, 2011 16:02
Vim bindings to fold Ruby class and spec files.
" 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>