Adding .pryrc and aliases for nc w/SSL

This commit is contained in:
2013-01-30 14:56:14 +03:00
parent 2771ac3d9e
commit 1c1abd85d3
3 changed files with 38 additions and 3 deletions

22
.pryrc Normal file
View File

@@ -0,0 +1,22 @@
# Load plugins (only those I whitelist)
Pry.config.should_load_plugins = false
Pry.plugins["doc"].activate!
# Launch Pry with access to the entire Rails stack.
# If you have Pry in your Gemfile, you can pass: ./script/console --irb=pry instead.
# If you don't, you can load it through the lines below :)
rails = File.join Dir.getwd, 'config', 'environment.rb'
if File.exist?(rails) && ENV['SKIP_RAILS'].nil?
require rails
if Rails.version[0..0] == "2"
require 'console_app'
require 'console_with_helpers'
elsif Rails.version[0..0] == "3"
require 'rails/console/app'
require 'rails/console/helpers'
else
warn "[WARN] cannot load Rails console commands (Not on Rails2 or Rails3?)"
end
end

16
.rc
View File

@@ -26,6 +26,8 @@ elif [ "$(uname -s)" = "FreeBSD" ]; then
alias stat="/usr/bin/stat -f \" File: '%N'%SY%n Size: %-15z Blocks: %-10b IO Block: %-6k %HT%nDevice: %7Hr/%-7Lr Inode: %-11i Links: %l%nAccess: (%Mp%Lp/%Sp) Uid: (%5u/%8Su) Gid: (%5g/%8Sg)%nAccess: %Sa%nModify: %Sm%nChange: %Sc%n Birth: %SB\" -t '%F %T %z'"
fi
alias nc='nc -vv'
alias snc='openssl s_client -connect '
alias vsnc='openssl s_client -showcerts -state -msg -debug -connect '
alias killall='killall -v'
alias scrot='scrot -e "mv \$f ~/screenshots/ 2>/dev/null" -cd 5'
alias qiv='qiv -fml -M'
@@ -46,6 +48,14 @@ alias psa='ps axfo pid,euser,bsdstart,vsz,rss,bsdtime,args'
alias parent='ps -p $PPID -o comm='
alias dbgrep='dbgrep.pl -vpuroot'
# mysqldump extraction
function mysql_extract_db() {
sed -n "/^-- Current Database: \`$1\`/,/^-- Current Database: \`/p"
}
function mysql_extract_table() {
sed -n "/^-- Table structure for table \`$1\`/,/^-- Table structure for table \`/p"
}
# LOL protect me
alias mv='mv -i'
alias cp='cp -i'
@@ -101,6 +111,12 @@ function ds() {
print map { $_->[0] } sort { $byte_order{$a->[1]} <=> $byte_order{$b->[1]} || $b->[2] <=> $a->[2] } map { [ $_, /^\s*[\d.]+([MGKk0])/, /^\s*([\d.]+)/ ] } <>'
}
function dl() {
for entry in "$@"; do
printf '%-7d %s\n' $(find $entry | wc -l) "$entry"
done | sort -rn
}
function mkcd() {
mkdir -p $@
cd $@

View File

@@ -1,3 +0,0 @@
let g:netrw_dirhistmax =10
let g:netrw_dirhist_cnt =1
let g:netrw_dirhist_1='/home/artem/downloads/java/test'