# change mirror to ubuntu.osuosl.org first
sudo apt-get update
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
>> require 'yaml' | |
>> YAML.load("%YAML 1.1\n---\n'test'") # %YAML directive not supported | |
=> "%YAML 1.1 --- 'test'" | |
>> require 'psych' | |
>> Psych.load("%YAML 1.1\n---\n'test'") # all good | |
=> "test" |
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
server { | |
sendfile off; | |
listen 80 default; | |
server_name localhost; | |
client_max_body_size 10m; | |
access_log /var/log/nginx/localhost.access.log; | |
location / { | |
root /vagrant; |
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
# this migration allows to have polymorphic models | |
class CreateAssets < ActiveRecord::Migration | |
def self.up | |
create_table :assets, :force => true do |t| | |
t.string :type | |
t.integer :assetable_id | |
t.string :assetable_type | |
t.string :attachment_file_name | |
t.string :attachment_content_type |
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 install members | |
members some_group_name |
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
nohup rake RAILS_ENV=production rake some_task & |
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
#!/bin/sh | |
# | |
# check who can login to a user's account | |
# | |
check_user() | |
{ | |
local IFS=: | |
while read user home; do | |
test -e $home/.ssh/authorized_keys || continue | |
cut -d' ' -f3 $home/.ssh/authorized_keys | sed -e "s/^/user $user: /" |
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
#!/bin/bash | |
# | |
# trash - Move files to the appropriate .Trash file on Mac OS X. (Intended | |
# as an alternative to 'rm' which immediately deletes the file.) | |
# | |
# v0.1 2007-05-21 - Morgan Aldridge <morgant@makkintosshu.com> | |
# Initial version. | |
# v0.2 2010-10-26 - Morgan Aldridge | |
# Use appropriate .Trashes folder when trashing files |
OlderNewer