Ruby Reload! Method in Non Rails IRB Sessions
I love the Rails reload! function when in the console. I need it in Irb. To get it back this is what I did. If you don't already have an .irbrc file in your home directory, just create it.
vim ~/.irbrc
or textmate if you prefer
mate ~/.irbrc
Add this...
Written by Sean Behan on 06/17/2012
Extract Domain Names From Links in Text with Postgres and a Single SQL Query
This query and pattern will return urls in text all within a single SQL query.
select substring(column_name from '.*://([^/]*)') as domain_name from table_name;
And here it is in a larger query, say for retrieving page view counts for referrers.
...
Written by Sean Behan on 11/23/2013
hessian
Written by Sean Behan on 06/17/2012
How to Get Your User's SHELL and PATH Information
How to find your user SHELL and PATH on Linux
echo $PATH
echo $SHELL
Which will print the paths to the screen
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games
/bin/bash
Written by Sean Behan on 06/17/2012
Fun with Apache2 - httpd not running, trying to start (98)Address already in use: make_sock: could not bind to address 0.0.0.0:80 no listening sockets available, shutting down
Have you ever gotten this error message when trying to (re)start Apache
httpd not running, trying to start
(98)Address already in use: make_sock: could not bind to address 0.0.0.0:80
no listening sockets available, shutting down
If you are running with ...
Written by Sean Behan on 06/17/2012