ssh [email protected] -p port
vi ~/.ssh/config
Host aliasname
HostName yourdomain.com
Port port
User yourusername
ssh [email protected] -p port
vi ~/.ssh/config
Host aliasname
HostName yourdomain.com
Port port
User yourusername
Format meaning: | |
%a - The abbreviated weekday name (``Sun'') | |
%A - The full weekday name (``Sunday'') | |
%b - The abbreviated month name (``Jan'') | |
%B - The full month name (``January'') | |
%c - The preferred local date and time representation | |
%d - Day of the month (01..31) | |
%H - Hour of the day, 24-hour clock (00..23) | |
%I - Hour of the day, 12-hour clock (01..12) |
import sublime, sublime_plugin | |
import os | |
class DetectFileTypeCommand(sublime_plugin.EventListener): | |
""" Detects current file type if the file's extension isn't conclusive """ | |
""" Modified for Ruby on Rails and Sublime Text 2 """ | |
""" Original pastie here: http://pastie.org/private/kz8gtts0cjcvkec0d4quqa """ | |
def on_load(self, view): | |
filename = view.file_name() |
mkdir -p /Library/Application\ Support/TextMate/Bundles | |
cd !$ | |
git clone git://github.com/timcharper/git-tmbundle.git Git.tmbundle | |
osascript -e 'tell app "TextMate" to reload bundles' | |
Ctr+Shift+G => blame | |
enjoy! |
sudo port install git-core +bash_completion | |
if [ -f /opt/local/etc/bash_completion ]; then | |
. /opt/local/etc/bash_completion | |
fi | |
GIT_PS1_SHOWDIRTYSTATE=true | |
PS1='\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;33m\]\w\[\033[00m\]\[\033[01;31m\]$(__git_ps1 " {%s}")\[\033[00m\]\$ ' |
ctrl+a or Home - Moves the cursor to the start of a line. | |
ctrl+e or End - Moves the cursor to the end of a line. | |
ctrl+b - Moves to the beginning of the previous or current word. | |
ctrl+k - Deletes from the current cursor position to the end of the line. | |
ctrl+u - Deletes the whole of the current line. | |
ctrl+w - Deletes the word before the cursor. |
sudo add-apt-repository ppa:webupd8team/sublime-text-2 | |
sudo apt-get update | |
sudo apt-get install sublime-text-2 |
class Widget < ActiveRecord::Base | |
has_many :widget_groupings | |
has_many :people, :through => :widget_groupings, :source => :grouper, :source_type => 'Person' | |
has_many :aliens, :through => :widget_groupings, :source => :grouper, :source_type => 'Alien' | |
end | |
class Person < ActiveRecord::Base | |
has_many :widget_groupings, :as => grouper | |
has_many :widgets, :through => :widget_groupings |
rvm implode | |
rm ~/.rvmrc | |
curl -s https://rvm.beginrescueend.com/install/rvm -o rvm-installer ; chmod +x rvm-installer ; ./rvm-installer --version 1.8.0 | |
; | |
rvm implode | |
gem uninstall rvm |
SHOW DATABASES; - список баз данных | |
SHOW TABLES [FROM db_name]; - список таблиц в базе | |
SHOW COLUMNS FROM таблица [FROM db_name]; - список столбцов в таблице | |
SHOW CREATE TABLE table_name; - показать структуру таблицы в формате "CREATE TABLE" | |
SHOW INDEX FROM tbl_name; - список индексов | |
SHOW GRANTS FOR user [FROM db_name]; - привилегии для пользователя. | |
SHOW VARIABLES; - значения системных переменных | |
SHOW [FULL] PROCESSLIST; - статистика по mysqld процессам |