Skip to content

Instantly share code, notes, and snippets.

View metaskills's full-sized avatar
🧠
Adding Digital Intelligence

Ken Collins metaskills

🧠
Adding Digital Intelligence
View GitHub Profile
# Always make it easy to edit all the script.
$ which profile
profile: aliased to subl ~/.zshkit ~/.zshkit/01_path
# Always make it easy to version control my ZSH kit.
# Ex: `profile-save "New Docker Functions"`
$ which profile-save
profile-save () {
pushd ~/.zshkit/
git add .
>> RbConfig::CONFIG.each { |k,v| puts "#{k} => #{v}\n" } ; true
DESTDIR =>
MAJOR => 2
MINOR => 4
TEENY => 0
PATCHLEVEL => 0
INSTALL => /opt/local/bin/ginstall -c
EXEEXT =>
prefix => /Users/kencollins/.rbenv/versions/2.4.0
ruby_install_name => ruby
find_header: checking for sybfront.h... -------------------- no
"clang -o conftest -I/Users/kencollins/.rbenv/versions/2.3.1/include/ruby-2.3.0/x86_64-darwin15 -I/Users/kencollins/.rbenv/versions/2.3.1/include/ruby-2.3.0/ruby/backward -I/Users/kencollins/.rbenv/versions/2.3.1/include/ruby-2.3.0 -I../../../../ext/tiny_tds -I/Users/kencollins/.rbenv/versions/2.3.1/include -D_XOPEN_SOURCE -D_DARWIN_C_SOURCE -D_DARWIN_UNLIMITED_SELECT -D_REENTRANT -O3 -Wno-error=shorten-64-to-32 -pipe conftest.c -L. -L/Users/kencollins/.rbenv/versions/2.3.1/lib -L. -L/Users/kencollins/.rbenv/versions/2.3.1/lib -fstack-protector -lruby-static -framework CoreFoundation -lpthread -ldl -lobjc "
checked program was:
/* begin */
1: #include "ruby.h"
2:
3: int main(int argc, char **argv)
4: {
5: return 0;
@metaskills
metaskills / rails502.md
Created March 2, 2017 00:26
Step ?) Create Rails Application
$ gem install rails
$ rails new my_application --database=sqlserver
$ cd my_application

Now setup your development and test databases.

$ export SA_PASSWORD=...
@metaskills
metaskills / rails.md
Last active February 23, 2017 00:56
Step ?) Create Rails Application
$ gem install rails
$ rails new my_application --database=sqlserver
$ cd my_application

<TEMPORARY-HACKS>

This section is obsolete when Rails v5.0.2 comes out. Open the config/database.yml and change the contents to look like this.

require 'tiny_tds'
puts 'Connecting to SQL Server'
@client = TinyTds::Client.new(
host: 'localhost', port: 1433,
username: 'sa', password: ENV['SA_PASSWORD'],
database: 'SampleDB'
)
def execute(sql)
@client.execute(sql).do
require 'tiny_tds'
puts 'Connecting to SQL Server'
@client = TinyTds::Client.new(
host: 'localhost', port: 1433,
username: 'sa', password: ENV['SA_PASSWORD'],
)
def execute(sql)
@client.execute(sql).do
true
end
@metaskills
metaskills / output.txt
Created February 22, 2017 03:03
Test FreeTDS Connection
$ tsql -S localhost -U sa -P $SA_PASSWORD
locale is "en_US.UTF-8"
locale charset is "UTF-8"
using default charset "UTF-8"
1> SELECT @@VERSION
2> GO
Microsoft SQL Server vNext (CTP1.3) - 14.0.304.138 (X64)
Feb 13 2017 16:49:12
Copyright (C) 2016 Microsoft Corporation. All rights reserved.
@metaskills
metaskills / command.sh
Last active November 4, 2022 09:44
Ubuntu 16.04 Install Latest FreeTDS
$ sudo apt-get install wget
$ sudo apt-get install build-essential
$ sudo apt-get install libc6-dev
$ wget ftp://ftp.freetds.org/pub/freetds/stable/freetds-1.00.27.tar.gz
$ tar -xzf freetds-1.00.27.tar.gz
$ cd freetds-1.00.27
$ ./configure --prefix=/usr/local --with-tdsver=7.3
$ make
$ make install
@metaskills
metaskills / log.txt
Created February 22, 2017 01:20
Ubuntu 16.04 FreeTDS Install Log
Setting up freetds-common (0.91-6.1build1) ...
Setting up libsybdb5:amd64 (0.91-6.1build1) ...
Setting up freetds-bin (0.91-6.1build1) ...
Setting up libct4:amd64 (0.91-6.1build1) ...
Setting up freetds-dev (0.91-6.1build1) ...
Processing triggers for libc-bin (2.23-0ubuntu5) ...
root@9ecf83463240:/# tsql -C
Compile-time settings (established with the "configure" script)
Version: freetds v0.91
freetds.conf directory: /etc/freetds