In this screencast, I demonstrate how to work with the latest Rails as well as navigate through the source.
Category Archives: screencast
Enabling Public Access To Development Machine
Show Note
open ssh tunnel from your local machine
For running Rails app in development, you can do this since rails s runs on port 3000.
localhost$ ssh -R 8088:localhost:3000 remote_server -N &
This creates a tunnel that binds remote TCP port 8088 to local TCP port 3000.
-R flag is for remote binding which tell the remote server to send TCP traffic on port 8088 to my machine. This is basically reverse of -L which binds the local machine’s port to remote.
8088: specifies the port on remote server. Therefore, following command on remote server will give a result assuming that I’m running a Rails app on port 3000.
remote_server$ curl localhost:8088
localhost is the host, obviously my local machine where the traffic will bind to.
:3000 is the local port you want to bind the traffic to.
-N tells ssh to not execute a remote command. Should always use this if we’re just tunneling.
& makes it run in background.
install socat if not installed on remote server
This is the definition from socat.
Socat is a command line based utility that establishes two bidirectional byte streams and transfers data
between them
For Ubuntu, remote_server$ sudo apt-get install socat
will do.
run socat to relay public traffic
On remote server, expose a public port and then route the traffic to local port that’s bound to my local machine.
remote_server$ socat TCP-LISTEN:8090,fork,reuseaddr TCP-CONNECT:127.0.0.1:8088 &
TCP-LISTEN:8090,fork,reuseaddr tells socat to listen TCP on port 8090, creating a server at that port. The options are self-explanatory.
TCP-CONNECT:127.0.0.1:8088 tells socat to connect TCP to localhost at port 8088 which is bound to my machine.
Ruby 2.0 – Getting Started & Named Parameters
Start of me playing with Ruby 2.0. Covers my installation and named parameter to start.
$: Fun
Back to basics screencast on $LOAD_PATH.
My Own Personal Pastie
In this video, I create a Sinatra app that creates syntax highlight using Ultraviolet gem. It uses MongoDB to store the code pasted. You can actually use the code to create your own Pastie clone.
Show Notes:
Link to the code: https://github.com/joonyou/screencasts/tree/master/my_pastie
Sinatra: http://www.sinatrarb.com
Ultraviolet: https://github.com/grosser/ultraviolet
Video Conversion with Ruby
I’m not big on rehashing old stuff, but I didn’t realize at the time I created this screencast that I was actually doing video conversion. My original intention was to show forking in Ruby. Well, here’s the same video with different title this time. It’s an oldie but goodie and it goes to show you how bad my screencasting skills were.
Outsourcing + Fork from Joon You on Vimeo.
Ruby Initializer
Warning: This is obviously a rant and a joke. However, it does contain some valuable tutorial.
Ruby Initializer from Joon You on Vimeo.
Faster Testing with Parallel Tests
Rails 3 Documentation: Generate Your Own
In this screencast, I show you how to generate the api and guides for offline viewing.
Rails 3 Documentation: Generate Your Own from Joon You on Vimeo.
Screencast: Add & Remove Methods in Ruby
Here’s my first installment of Stupid Rubyist Tricks Series.
Ruby provides metaprogramming feature that’s really powerful when used properly. Here, I show you the technique, but do something stupid so you don’t do it. Enjoy!