Skip to content

Instantly share code, notes, and snippets.

View Voronenko's full-sized avatar
turning coffee into code since late 90s

Vyacheslav Voronenko

turning coffee into code since late 90s
View GitHub Profile
@Voronenko
Voronenko / kitchenci
Created May 31, 2014 20:08
Kitchen CI setup for W7'64 with ruby 2.0,0 installed with RubyInstaller
gem install test-kitchen
gem install win32-process windows-pr
gem install kitchen-vagrant
SELECT
a.tablespace_name,
a.file_name,
a.bytes allocated_bytes,
b.free_bytes
FROM
dba_data_files a,
(SELECT file_id, SUM(bytes) free_bytes
FROM dba_free_space b GROUP BY file_id) b
WHERE
#!/bin/sh
# script to automate the load and export to CSV of an oracle dump
# This script assumes:
# * you have the vagrant published key available locally in your .ssh directory
# * You have the Oracle VirtualBox image running locally
# ** ssh port-forwarding is configured for host port 2022 -> guess port 22.
set -e
@Voronenko
Voronenko / gist:a5936e23399b8485225b
Created September 2, 2014 07:55
array of objects => array (object_key,object)
var some_map = _.object(_.map(some_object_array, function(item) {
return [item.id, item]
}));
@Voronenko
Voronenko / gist:bd63dd7964c3171f69a7
Created September 3, 2014 13:26
Unique Javascript ID
'_' + Math.random().toString(36).substr(2, 9);
@Voronenko
Voronenko / sub-directories-git-pull
Created September 3, 2014 14:41
Useful for vagrant development: iterative scan through directories and pulling git in each
for dir in ~/projects/git/*; do (cd "$dir" && git pull); done
@Voronenko
Voronenko / ubuntu service stub
Created September 4, 2014 14:38
Custom service stub for ubuntu
#!/bin/sh -e
### BEGIN INIT INFO
# Provides: servicename
# Required-Start: servicename1 servicename2
# Required-Stop:
# Default-Start: 1 2 3 4 5
# Default-Stop:
# Short-Description: What your service does?
### END INIT INFO
@Voronenko
Voronenko / port-tonnelling-example
Created September 17, 2014 06:10
Handy reminder on port forwarding syntax over SSH
#ssh -fNg -L LOCALPORT:127.0.0.1:REMOTEPORT [email protected]
ssh -fNg -L 3307:127.0.0.1:3306 [email protected]
ssh -fNg -L 11000:127.0.0.1:10000 [email protected]
@Voronenko
Voronenko / drop-collections-in-mongo
Created September 22, 2014 16:11
Removes all collections inside mongo DB except the system one
db.getCollectionNames().forEach(function(c) { if (c.indexOf("system.") == -1) db[c].drop(); })
@Voronenko
Voronenko / commitformat
Created November 18, 2014 19:55
Compact format for commit messages
feat: add hat wobble
^--^ ^------------^
| |
| +-> Summary in present tense.
|
+-------> Type: chore, docs, feat, fix, refactor, style, or test.