# start postgresql
/usr/lib/postgresql-9.0/bin/postgres -D /var/lib/postgresql/9.1/boom/ -c config_file=/etc/postgresql-9.0/postgresql.conf
#
# #psql dump:
pg_dump #host localhost #port 5555 #username "foo" #format tar #blobs #verbose #file "/home/tokhi/Documents/Castaclip/castaclip.master.130612.tmp" "verticals"
# # restore:
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
getallunits=tcp://127.0.0.1:5556 | |
activateunits=tcp://127.0.0.1:5556 | |
getallsites=tcp://127.0.0.1:5556 | |
activatesites=tcp://127.0.0.1:5556 | |
getallverticals=tcp://127.0.0.1:5556 | |
activateverticals=tcp://127.0.0.1:5556 | |
getallarticles=tcp://127.0.0.1:5556 | |
activatearticles=tcp://127.0.0.1:5556 | |
getallpages=tcp://127.0.0.1:5556 | |
activatepages=tcp://127.0.0.1:5556 |
Elasticsearch is a real time search engine where a change to an index will be propegated to the whole cluster within a second.
An elasticsearch cluster indicated as one or more nodes, collection of nodes containing all the data, default cluster name is elasticserach.
A node
is a single server
and part of a cluster, node participate in searching and indexing.
Index
is collection of documents equavalent to a database
within a relational system, index name must be lowercase
Type is represetn a class = table
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
HOST="example.com" | |
USER="user" | |
PASS="password" | |
FTPURL="ftp://$USER:$PASS@$HOST" | |
echo $FTPURL | |
LCD="/home/user/local/directory" | |
RCD="/ftp/remote/directory" | |
# sync remote directory to the local directory (download) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# http://git-scm.com/book/en/v2/Git-Basics-Viewing-the-Commit-History | |
# compare old commits with the new commit file changed | |
$ git log -p -2 | |
# which files changed on a specific commit revision | |
$ git log --stat | |
# print each commit with a signle line and commit revision | |
git log --pretty=oneline |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# adding a column to an existing table | |
rails g migration AddNameToUsers name:string | |
# or | |
rails generate migration add_image_to_pictures image_id:string | |
# to remove | |
rails d migration AddNameToUsers name:string | |
# remove column from model | |
rails g migration RemoveProjectIDFromProjects project_id:string |
#Unix Toolbox
This document is a collection of Unix/Linux/BSD commands and tasks which are useful for IT work or for advanced users. This is a practical guide with concise explanations, however the reader is supposed to know what s/he is doing.
##Unix Toolbox revision 14.4
The latest version of this document can be found at http://cb.vu/unixtoolbox.xhtml. Replace .xhtml on the link with .pdf for the PDF version and with .book.pdf for the booklet version. On a duplex printer the booklet will create a small book ready to bind. This XHTML page can be converted into a nice PDF document with a CSS3 compliant application (see the script example). See also the about page.
Error reports and comments are m
Error reports and comments are m
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# install docker toolbox | |
# create docker machine: | |
#docker-machine create --driver virtualbox default | |
eval "$(docker-machine env default)" | |
# check the version | |
docker version | |
docker-compose build | |
docker-compose up | |
# nginx installation |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
# make sure you the watir gem installed -> gem install watir | |
require 'watir' | |
def log (message) puts " #{message}" end | |
def success (message) puts "+ #{message}" end | |
def fail (message) puts "- #{message}" end | |
def notify (message) | |
success message.upcase | |
system 'osascript -e \'Display notification Burgerbot with title "%s"\'' % message | |
rescue StandardError => e |
OlderNewer