Skip to content

Instantly share code, notes, and snippets.

View rynmrtn's full-sized avatar

Ryan Morton rynmrtn

View GitHub Profile
@rynmrtn
rynmrtn / gist:136642
Created June 26, 2009 18:15
User Modification Commands in *nix
# Add a user
$ sudo adduser ${user}
# Remove a user
$ sudo deluser ${user}
# Modify the users group
# ${group} is a comma separated list of groups without spaces, e.g. 'group1,group2,group3'
$ sudo usermod -G ${group} ${user}
# How to resize a logical volume in linux
$ sudo lvm
lvm> lvresize -L +{size}G /vol/location
lvm> lvdisplay
# How to resize a physical volume in linux
$ sudo lvm
lvm> pvresize --setphysicalvolumesize {size}G /vol/location
lvm> pvdisplay
# Display disk information in linux
df -h
# List the currently running processes
ps -ef
@rynmrtn
rynmrtn / gist:140708
Created July 4, 2009 20:12
Github Terminal Commands
# Upload to GitHub
gist < fileWithClipping.ext
# Download from GitHub
gist ${number} > fileToSaveTo.ext
# calculate the size of a directory in human readable format
du -s -h /directory
# Also
du -h --max-depth=1
/*
* IE Centering Fix: text-align applied to the body of a page in IE6 will
* allow the containing divs to be centered (using `margin: 0px auto`).
* We also change the #container to be `text-align: left` because nobody
* likes their text being centered.
*/
body {
text-align: center;
}
In rails, -%> can remove any newline that follows the output.
@rynmrtn
rynmrtn / rails_cheat.rb
Created August 1, 2009 16:40
Cheat sheet for Rails Development
###
# Migrations
# data_types = {:string, :text, :integer, :float, :decimal, :datetime, :timestamp,
# :time, :date, :binary, :boolean }
# Add a Column
add_column :table_name, :column_name, :data_type, :options
# Remove a Column
remove_column :table_name, :column_name
# Change VBox UUID
$ VBoxManage internalcommands setvdiuuid diskName.vdi