Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
# config/initializers/carrierwave.rb | |
CarrierWave.configure do |config| | |
config.grid_fs_database = "database_name" | |
config.grid_fs_host = 'localhost' | |
config.grid_fs_access_url = "/uploads" | |
config.storage = :grid_fs | |
end |
#!/bin/sh | |
# | |
# Update Textmate bundles | |
# Standard OS X Textmate bundle Verzeichnis | |
TEXTMATE_BUNDLES="$HOME/Library/Application Support/Textmate/Bundles" | |
# … ins Verzeichnis wechseln | |
echo "\n*** Wechsle ins Textmate bundle Verzeichnis..." |
# Code example for http://wojt.eu/post/13496746332/retrieving-gmail-thread-ids-with-ruby | |
def patch_net_imap_response_parser(klass = Net::IMAP::ResponseParser) | |
klass.class_eval do | |
def msg_att | |
match(T_LPAR) | |
attr = {} | |
while true | |
token = lookahead | |
case token.symbol |
rails_env = ENV['RAILS_ENV'] | |
raise "Please specify RAILS_ENV." unless rails_env | |
rails_root = ENV['RAILS_ROOT'] || File.expand_path(File.join(File.dirname(__FILE__), '..', '..')) | |
God.watch do |w| | |
w.dir = "#{rails_root}" | |
w.name = "resque-scheduler" | |
w.group = 'resque' | |
w.interval = 30.seconds | |
w.env = {"RAILS_ENV"=>rails_env, "BUNDLE_GEMFILE"=>"#{rails_root}/Gemfile"} |
# code inspired from http://jainmarket.blogspot.com/2009/05/creating-custom-table-view-cell.html | |
class CustomCell < UITableViewCell | |
attr_accessor :primaryLabel | |
attr_accessor :secondaryLabel | |
def createLabels | |
@primaryLabel = UILabel.alloc.init |
using System; | |
using System.Drawing; | |
using System.IO; | |
using System.Net; | |
using MonoTouch.Foundation; | |
using MonoTouch.UIKit; | |
// A MonoTouch iOS Mail like example with a custom view and a UIWebView : | |
// | |
// http://stackoverflow.com/questions/10434444/zoom-a-uiwebview-like-ios-mail-app/10463431 |
Open the postgresql.conf config file:
$> mate /usr/local/var/postgres/postgresql.conf
Uncomment the line with 'log_destination' and set it to 'syslog'
log_destination = 'syslog'
Open the syslog config:
firewall { | |
all-ping enable | |
broadcast-ping disable | |
ipv6-receive-redirects disable | |
ipv6-src-route disable | |
ip-src-route disable | |
log-martians enable | |
name WAN_IN { | |
default-action drop | |
description "Packets from Internet to LAN" |
// example: go run ssh.go core myhost:22 "ps aux | head -n 5" | |
package main | |
import ( | |
"log" | |
"net" | |
"os" | |
"code.google.com/p/go.crypto/ssh" | |
) |
// A small SSH daemon providing bash sessions | |
// | |
// Server: | |
// cd my/new/dir/ | |
// #generate server keypair | |
// ssh-keygen -t rsa | |
// go get -v . | |
// go run sshd.go | |
// | |
// Client: |