Install ikiwiki in an arbitrary directory
perl Makefile.PL DESTDIR=/path/to/install/dir PREFIX="" INSTALL_BASE="/"
Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world (or not, you can keep them private!)
Mark James Adams http://raysend.com/mark/
perl Makefile.PL DESTDIR=/path/to/install/dir PREFIX="" INSTALL_BASE="/"
history | awk '{print $2}' | sort | uniq -c | sort -rn | head
history -1000 | awk '{print $2}' | sort | uniq -c | sort -rn | head
=========== WARNING =========== You are building this extension on OS X without setting the ARCHFLAGS environment variable, and PostgreSQL does not appear to have been built as a universal binary. If you are seeing this message, that means that the build will probably fail. Try setting the environment variable ARCHFLAGS to '-arch i386' before building. For example: (in bash) $ export ARCHFLAGS='-arch i386' (in tcsh) $ setenv ARCHFLAGS '-arch i386' Then try building again. ===================================
sudo env ARCHFLAGS="-arch i386" gem install postgres
./configure --prefix=/opt/local/nginx --with-http_ssl_module --with-openssl=../openssl-0.9.8e --with-cc-opt="-m64 -I/usr/local/include -I/usr/local/ssl/include" --with-ld-opt="-L/lib/64 -L/usr/sfw/lib/64 -R/usr/sfw/lib/64 -R/lib/64 -L/usr/local/ssl/lib -m64 -L/usr/local/lib -R/usr/local/lib" --with-http_flv_module
#!/usr/bin/bash FILENAME=b_list-`/usr/xpg4/bin/date +%Y%m%d`.sql.bz2 cd /home/myuser/dumps /opt/local/bin/pg_dump -U db_username db_name | /usr/bin/bzip2 > $FILENAME /usr/bin/scp $FILENAME me@strongspace:/my/backup/dir/
export PG_LIB_DIR=/opt/local/lib/postgresql82 export PG_INCLUDE_DIR=/opt/local/include/postgresql82
$ sudo ln -s /opt/ /Developer/SDKs/MacOSX10.4u.sdk/opt
The downloaded packages are in /tmp/RtmpTakYpZ/downloaded_packages
$ cd /tmp/RtmpTakYpZ/downloaded_packages $ sudo R CMD INSTALL RdbiPgSQL_1.10.0.tar.gz
$ defaults write com.macromates.textmate AppleFontSmoothing -int 1
$ ruby upload.rb cert.yml source destination
username: USERNAME password: PASSWORD
# upload.rb # Command line webdav upload script. Based off of # http://theexciter.com/articles/bingo require 'net_digest_auth' require 'yaml' require 'uri' abort("Usage: #{$0} <credentials.yml> <src> <dst> ") unless ARGV.size==3 auth = YAML.load_file(ARGV[0]) username = auth['username'] password = auth['password'] src = ARGV[1] dst = ARGV[2] if File.exists?(src) url = URI.parse(dst) Net::HTTP.start(url.host) do |http| res = http.put(url.request_uri, 'hello') # try putting something so # the server will return a # www-authenticate header req = Net::HTTP::Put.new("#{url.path}#{File.basename(src)}") req.digest_auth(username, password, res) response = http.request(req, File.open(src).read) puts response.code + " " + response.message end else puts "No such file #{src.inspect}" end
req.digest_auth(username, password, res)
# net_digest_auth.rb require 'digest/md5' require 'net/http' module Net module HTTPHeader @@nonce_count = -1 CNONCE = Digest::MD5.new.update("%x" % (Time.now.to_i + rand(65535))).hexdigest def digest_auth(user, password, response) # based on http://segment7.net/projects/ruby/snippets/digest_auth.rb @@nonce_count += 1 response['www-authenticate'] =~ /^(\w+) (.*)/ params = {} $2.gsub(/(\w+)="(.*?)"/) { params[$1] = $2 } a_1 = "#{user}:#{params['realm']}:#{password}" a_2 = "#{@method}:#{@path}" request_digest = '' request_digest << Digest::MD5.new.update(a_1).hexdigest request_digest << ':' << params['nonce'] request_digest << ':' << ('%08x' % @@nonce_count) request_digest << ':' << CNONCE request_digest << ':' << params['qop'] request_digest << ':' << Digest::MD5.new.update(a_2).hexdigest header = [] header << "Digest username=\"#{user}\"" header << "realm=\"#{params['realm']}\"" header << "qop=#{params['qop']}" header << "algorithm=MD5" header << "uri=\"#{@path}\"" header << "nonce=\"#{params['nonce']}\"" header << "nc=#{'%08x' % @@nonce_count}" header << "cnonce=\"#{CNONCE}\"" header << "response=\"#{Digest::MD5.new.update(request_digest).hexdigest}\"" @header['Authorization'] = header end end end