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
# 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} |
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
# 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 |
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
# Display disk information in linux | |
df -h |
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
# List the currently running processes | |
ps -ef |
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
# Upload to GitHub | |
gist < fileWithClipping.ext | |
# Download from GitHub | |
gist ${number} > fileToSaveTo.ext |
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
# calculate the size of a directory in human readable format | |
du -s -h /directory | |
# Also | |
du -h --max-depth=1 |
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
/* | |
* 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; | |
} |
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
In rails, -%> can remove any newline that follows the output. |
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
### | |
# 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 |
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
# Change VBox UUID | |
$ VBoxManage internalcommands setvdiuuid diskName.vdi |
OlderNewer