Please note that this is not a complete-step-by-step solution but rather a set of notes that might help to build Gearman 1.1.6 on Centos 5.9.
Some other helpful notes can be found here: http://gearman.info/build/centos5-8.html
| #!/bin/bash | |
| # Disclaimer - make backups, use at your own risk. | |
| # | |
| # Based on this comment: http://stackoverflow.com/a/13944924/843067 | |
| # Views and stored procedures have to be done separately. | |
| OLDDB="old_db_name" | |
| NEWDB="new_db_name" | |
| MYSQL="mysql -u root -pyour_password " |
| #!/usr/bin/sh | |
| project_name="project-name-here" | |
| project_root="${HOME}" | |
| refname=${1} | |
| rev=$(git rev-parse --short ${1}) | |
| this_release="${project_root}/${project_name}-${rev}" | |
| mkdir -p ${this_release} |
| default: &default | |
| adapter: postgresql | |
| encoding: unicode | |
| pool: <%= ENV.fetch("RAILS_MAX_THREADS") { 5 } %> | |
| url: <%= ENV["DATABASE_URL"] %> | |
| development: | |
| <<: *default | |
| test: |
| begin | |
| require 'bundler/inline' | |
| rescue LoadError => e | |
| $stderr.puts 'Bundler version 1.10 or later is required. Please update your Bundler' | |
| raise e | |
| end | |
| gemfile do | |
| source 'https://rubygems.org' | |
| gem 'rspec' |
| # Change this to suit your dotfiles setup and copy to your *HOST* machine: $HOME/.vagrant.d/Vagrantfile | |
| Vagrant.configure(2) do |config| | |
| # Mount your dotfiles to vagrant user's home folder (or wherever you want): | |
| config.vm.synced_folder "#{ENV['HOME']}/dotfiles", '/home/vagrant/dotfiles' | |
| # Install dotfiles on every 'vagrant provision' call. | |
| # For example, let's imagine your your dotfiles have 'install.sh' script: | |
| config.vm.provision 'shell', privileged: false, inline: '/home/vagrant/dotfiles/install.sh' | |
| end |
Please note that this is not a complete-step-by-step solution but rather a set of notes that might help to build Gearman 1.1.6 on Centos 5.9.
Some other helpful notes can be found here: http://gearman.info/build/centos5-8.html
| # Quick debug network traffic between nginx and php-fpm | |
| # Got from: | |
| # http://systembash.com/content/simple-sysadmin-trick-using-tcpdump-to-sniff-web-server-traffic/ | |
| # Just a flow of everything looking like a string | |
| tcpdump -nl -w - -i eth0 -c 500 port 9090 | strings | |
| # Request heads | |
| sudo tcpdump -nl -w - -i eth0 -c 500 port 9090 | strings | grep -E -A5 "^(GET|PUT|POST) " | |
| # strace processes/sub-processes |
| #!/usr/bin/env ruby | |
| # | |
| # Usage: | |
| # irbify.rb script.rb | heroku run rails console --app=my-app | |
| # | |
| # Why eval and not piping directly? Piping directly would run all lines even if previous line was an invalid statement. | |
| # | |
| script_name = ARGV[0] |
| #!/bin/bash | |
| # | |
| # Checks if git repository at $1 does not have modified files | |
| # | |
| function is_dirty { | |
| GIT_DIR="$1/.git" GIT_WORK_TREE="$1" git diff --quiet | |
| if [[ $? == 0 ]]; then | |
| return 1 | |
| else |
| # approx apache process count | |
| ps -eLf | grep httpd | wc -l | |
| # total and average memory stats | |
| ps -ylC httpd --sort:rss | awk '{sum+=$8; ++n} END {print "Tot="sum"("n")";print "Avg="sum"/"n"="sum/n/1024"MB"}' |