Skip to content

Instantly share code, notes, and snippets.

@frnz
Created April 3, 2011 23:57
Show Gist options
  • Save frnz/900948 to your computer and use it in GitHub Desktop.
Save frnz/900948 to your computer and use it in GitHub Desktop.
extras.zsh
function cl() {
cd $1;
clear;
ls;
echo ""
}
function hack() {
function ~/1337/$1;
}
function h() {
cd ~/$1;
}
function c() {
clear;
}
function generate_ssh_keys() {
ssh-keygen -t rsa -C "[email protected]"
echo "\n\nPublic Key: \n"
cat ~/.ssh/id_rsa.pub
}
function ssh_keys() {
scp ~/.ssh/id_rsa.pub $1:~
ssh $1 "mkdir -p ~/.ssh && touch ~/.ssh/authorized_keys && chmod 700 ~/.ssh && chmod -R 600 ~/.ssh/* && cat ~/id_rsa.pub >> ~/.ssh/authorized_keys && rm ~/id_rsa.pub"
}
# Configs
function reload() {
source ~/.zshrc;
}
function config() {
cd ~/.oh-my-zsh;
}
# Rails
function logs() {
tail -f log/*.log;
}
function restart() {
touch tmp/restart.txt
}
# NGINX
function nginx() {
_ /opt/nginx/sbin/nginx -s stop
_ /opt/nginx/sbin/nginx
}
# POSTGRE
function postgre() {
echo "pg_ctl -D /Users/franzpereira/Developer/var/postgres stop"
pg_ctl -D /Users/franzpereira/Developer/var/postgres start
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment