Skip to content

Instantly share code, notes, and snippets.

Keybase proof

I hereby claim:

  • I am bvajda on github.
  • I am bvkb (https://keybase.io/bvkb) on keybase.
  • I have a public key ASCt3J9Jf_O5fUZx9lMoCo9I_S0NRcwZhk0N3hSjbPN5HQo

To claim this, I am signing this object:

@bvajda
bvajda / vm_statis_ip.md
Created October 21, 2011 23:18
Static ip on a VMWare Fusion Virtual Machine

Shamelessly copied from: http://www.stereoplex.com/blog/vmware-fusion-guests-with-a-static-ip VMWare Fusion v4

get the MAC address of the vm: Virtual Machine - Settings - Network Adapter - Advanced make a note of it, it will be needed later

open /Library/Preferences/VMWare Fusion/vmnet8/dhcpd.conf: make note of the subnet range -> select a fixed ip outside of this range make note of the "options routers" ip address -> needed later append:

@bvajda
bvajda / server_install.md
Created October 18, 2011 21:37
Postgresql 9.1 server on CentOS 6

install CentOS 6

yum update
yum upgrade

check the server time. sync the time to a time server if needed (service 'ntpd')

download and install Postgresql Server v9.1 rpm package:

rpm -Uvh http://yum.pgrpms.org/9.1/redhat/rhel-6-x86_64/pgdg-centos91-9.1-4.noarch.rpm

This should have installed the necessary server package: postgresql91-server.x86_64.

@bvajda
bvajda / oracle_error.md
Created September 16, 2011 10:59
oracle enhanced error
ruby-1.9.2-p290-i386 :005 > Publication.all
/Users/bence/.rvm/gems/ruby-1.9.2-p290-i386@tools/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_adapters/oracle_enhanced_oci_connection.rb:317: [BUG] Bus Error
ruby 1.9.2p290 (2011-07-09 revision 32553) [x86_64-darwin11.0.0]

-- control frame ----------
c:0062 p:---- s:0240 b:0240 l:000239 d:000239 CFUNC  :initialize
c:0061 p:---- s:0238 b:0238 l:000237 d:000237 CFUNC  :new
c:0060 p:0307 s:0231 b:0231 l:000230 d:000230 METHOD /Users/bence/.rvm/gems/ruby-1.9.2-p290-i386@tools/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_
c:0059 p:0037 s:0215 b:0215 l:000214 d:000214 METHOD /Users/bence/.rvm/gems/ruby-1.9.2-p290-i386@tools/gems/activerecord-oracle_enhanced-adapter-1.4.0/lib/active_record/connection_
@bvajda
bvajda / nginx
Created August 22, 2011 09:24
RoR app server on CentOS 5.6
#/etc/rc.d/init.d/nginx
#!/bin/bash
#
# nginx Startup script for the nginx HTTP Server
#
# chkconfig: 345 85 15
# description: Web server
# processname: nginx: master process /opt/nginx/sbin/nginx
# nginx: worker process
@bvajda
bvajda / java_centos.markdown
Created August 22, 2011 07:33
Java app server on CentOS 5.6

Install JDK 7 on CentOS 5.6

download Linux x64 RPM jdk 7 installer from oracle to /tmp

wget http://download.oracle.com/otn-pub/java/jdk/7/jdk-7-linux-x64.rpm 

list rpm contents

rpm -qpil *file_name*
@bvajda
bvajda / dm_repository_setup.md
Created August 21, 2011 11:28
Switching between ActiveRecord and DataMapper - the gory details (https://github.com/datamapper/datamapper.github.com.git)

DM's Integrity Map causes issues when setting up tables in legacy repositories. The rails console can access the models, but the controller cannot. The (temporary?) solution is to add the following lines to the models. http://groups.google.com/group/datamapper/browse_thread/thread/16dc095f33097050#

def self.default_repository_name
  :your_repository
end
def self.repository(name = nil, &block) 
  super(:your_repository, &block) 
@bvajda
bvajda / rownum_mia
Created August 20, 2011 12:46
#first seems to create incorrect sql (LIMIT instead of ROWNUM) when using oracle_enhanced, rails 3.1.0.rc5
Warning: NLS_LANG is not set. fallback to US-ASCII.
Loading development environment (Rails 3.1.0.rc5)
ruby-1.9.2-p290-i386 :001 > Title.connection.class
=> ActiveRecord::ConnectionAdapters::OracleEnhancedAdapter
ruby-1.9.2-p290-i386 :002 > Title.first
OB Columns (1707.7ms) SELECT column_name AS name, data_type AS sql_type, data_default, nullable, virtual_column, hidden_column, DECODE(data_type, 'NUMBER', data_precision, 'FLOAT', data_precision, 'VARCHAR2', DECODE(char_used, 'C', char_length, data_length), 'RAW', DECODE(char_used, 'C', char_length, data_length), 'CHAR', DECODE(char_used, 'C', char_length, data_length), NULL) AS limit, DECODE(data_type, 'NUMBER', data_scale, NULL) AS scale FROM all_tab_cols WHERE owner = 'CV' AND table_name = 'OB' AND hidden_column = 'NO' ORDER BY column_id
Title Load (76.6ms) SELECT "OB".* FROM "OB" LIMIT 1
OCIError: ORA-00933: SQL command not properly ended: SELECT "OB".* FROM "OB" LIMIT 1
ActiveRecord::StatementInvalid: OCIError: ORA-00933: SQL command not properly
@bvajda
bvajda / postgres_ubuntu.markdown
Created August 19, 2011 10:52
PostgreSQL on Ubuntu 11.04

Installing PostgreSQL on Ubuntu 11.04

1 if add-apt-repository is not installed, install it with:

sudo apt-get install python-software-properties

2 don't forget ssh server:

sudo apt-get install openssh-server

3 install the server

@bvajda
bvajda / solutions.markdown
Created August 13, 2011 12:25
ruby/rails tips, tricks, solutions

Ruby and Rails Tips, Tricks and Solutions

  • 'normalize_yaml_input' error might be caused by wrong locale settings.

    # CLI
    locale
    # => "LC_ALL ="
    export LC_ALL="en_US" # (or your locale of choice)