Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # .bashrc / oodle
- export PATH=$PATH:/service/bin:/service/local/bin:/service/local/sbin:/service/local/apache/bin:/service/external/java/bin:/service/external/mysql/bin:/opt/p4v/bin
- export LD_LIBRARY_PATH=/service/local/lib:/oracle/product/10.1.0.3/client/lib
- export ORACLE_HOME=/oracle/product/10.1.0.3/client
- export TNS_ADMIN=/oracle/network/admin
- export JAVA_HOME=/service/external/java
- export JAVAC=$JAVA_HOME/bin/javac
- export BUILD_TYPE=dev
- export P4USER=cte
- export P4CLIENT=cte
- alias prod="ssh -p 21232 popcorn"
- alias tailerrors='tail -F /service/logs/error.php.`/bin/hostname | cut -f1 -d.`.`/bin/date +\%Y\%m\%d` | grep -P " (ERR|CRT|Fatal|Catchable) "'
- alias greptiming='grep -oP "t_[a-z]+=([^ ]+)"'
- alias web="/service/conf/generate_conf_files.pl && /service/scripts/control/httpd-dev"
- alias dbproxy="/service/scripts/control/httpd-db_proxy"
- alias geoindex="/service/scripts/control/geoindex"
- alias bandindex="/service/scripts/control/bandindex"
- alias suggestindex="/service/scripts/control/suggestindex"
- alias memcached="/service/scripts/init.d/memcached"
- alias database="/service/scripts/init.d/mysql"
- alias conf="/service/conf/generate_conf_files.pl"
- alias tunnel="/bin/cp -vf /service/conf.local/local.conf.tunnel /service/conf.local/local.conf && web restart && tunnelfast"
- alias notunnel="/bin/cp -vf /service/conf.local/local.conf.notunnel /service/conf.local/local.conf && web restart"
- # args:
- # $1 branch
- function checkbuild {
- if [ "x$1" = "x" ]; then
- echo "checkbuild: Which branch?"
- return 0
- fi
- ssh oodle@build ls -lrt /build/built/$1 2>/dev/null | tail -2
- }
- function latestfullbuild {
- if [ "x$1" = "x" ]; then
- echo "latestfullbuild: Which branch?"
- return 0
- fi
- checkbuild $1 | grep -oP $1-[0-9]+.tar.bz2
- }
- function latestcodebuild {
- if [ "x$1" = "x" ]; then
- echo "latestcodebuild: Which branch?"
- return 0
- fi
- checkbuild $1 | grep -oP $1-[0-9]+-code.tar.bz2
- }
- # args:
- # $1 tarball
- function isbuild {
- if [ "x$1" = "x" ]; then
- echo "isbuild: Which tarball?"
- return 0
- fi
- branch=`echo $1 | sed 's/-.*//'`
- tarball=`ssh oodle@build ls /build/built/$branch 2>/dev/null`
- if [ "x$tarball" = "x" ]; then
- return 0
- fi
- return 1
- }
- # args:
- # $1 tarball
- function copybuild {
- if [ "x$1" = "x" ]; then
- echo "copybuild: Which tarball?"
- return 0
- fi
- isbuild $1
- exists=$?
- if [ $exists -eq 0 ]; then
- echo "Build $1 does not exist"
- return 0
- fi
- branch=`echo $1 | sed 's/-.*//'`
- echo "Copying $1 to localhost"
- scp -q oodle@build:/build/built/$branch/$1 /tmp/$1
- echo "Copying $1 to bastion"
- scp -P 21234 /tmp/$1 popcorn:~
- rm -vf /tmp/$1
- return 1
- }
- # args:
- # $1 branch
- function copylatestfullbuild {
- if [ "x$1" = "x" ]; then
- echo "copylatestfullbuild: Which branch?"
- return 0
- fi
- latest=`latestfullbuild $1`
- if [ "x$latest" = "x" ]; then
- echo "copylatestfullbuild: $1 is not a branch"
- return 0;
- fi
- echo "The latest $1 branch build is $latest"
- copybuild $latest
- return 1
- }
- # args:
- # $1 branch
- function copylatestcodebuild {
- if [ "x$1" = "x" ]; then
- echo "copylatestcodebuild: Which branch?"
- return 0
- fi
- latest=`latestcodebuild $1`
- if [ "x$latest" = "x" ]; then
- echo "copylatestcodebuild: $1 is not a branch"
- return 0;
- fi
- echo "The latest $1 branch build is $latest"
- copybuild $latest
- return 1
- }
- # args:
- # $1 tarball
- # $2 service
- function pushbuild {
- if [ "x$1" = "x" ]; then
- echo "pushbuild: Which tarball?"
- return 0
- fi
- if [ "x$2" = "x" ]; then
- echo "pushbuild: Which service or machine (e.g. db_proxy, web, eros, etc.)?"
- return 0
- fi
- ssh -p 21232 popcorn ./push.pl $1 $2
- return 1
- }
- # args:
- # $1 branch
- # $2 service
- function pushlatestfullbuild {
- copylatestfullbuild $1
- if [ $? = 0 ]; then
- echo "pushlatestfullbuild: copylatestfullbuild failed"
- return 0
- fi
- latest=`latestfullbuild $1`
- pushbuild $latest $2
- if [ $? = 0 ]; then
- echo "pushlatestfullbuild: pushbuild failed"
- return 0
- fi
- return 1
- }
- # args:
- # $1 branch
- # $2 service
- function pushlatestcodebuild {
- copylatestcodebuild $1
- if [ $? = 0 ]; then
- echo "pushlatestcodebuild: copylatestcodebuild failed"
- return 0
- fi
- latest=`latestcodebuild $1`
- pushbuild $latest $2
- if [ $? = 0 ]; then
- echo "pushlatestcodebuild: pushbuild failed"
- return 0
- fi
- return 1
- }
- function jweb {
- jx bones
- sleep 1
- jx chekov
- sleep 1
- jx kirk
- sleep 1
- jx magneto
- sleep 1
- jx spock
- sleep 1
- jx sulu
- sleep 1
- jx uhura
- }
- function jdbp {
- jx riker
- sleep 1
- jx picard
- sleep 1
- jx worf
- }
- function j {
- ssh -t -p 21232 popcorn "ssh -t oodle@$1"
- }
- function jx {
- xterm -e "ssh -t -p 21232 popcorn \"ssh -t oodle@$1\"; bash" &
- }
Add Comment
Please, Sign In to add comment