Note
Monit has to be configured through theroot
user.
Usesudo su -
to login as root user.
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
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 |
Finding positive numbers in an array:
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
v = Vela::DB.new | |
v.src_connection(user: 'user', password: 'pass', host: '127.0.0.1', database: 'testpdb', adapter: 'postgresql') | |
v.dst_connection(user: 'root', password: 'pass', host: '127.0.0.1', database: 'testdb', adapter: 'mysql') | |
v.dbsync("src_tbl", "dst_tbl") # destination table should already been exist | |
# if your destination tables' columns are different than the source table (e.g; clonse `col1` data to m_col1 column): | |
v.dbsync("your_src_tbl", "your_dst_tbl", {"col1" => "m_col1", "col2" => "m_col2"}) # you can add as much as column as you want |
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
v = Vela::DB.new | |
v.src_connection(user: 'root', password: 'pass', host: '127.0.0.1', database: 'testdb', adapter: 'mysql') | |
v.dst_connection(user: 'user', password: 'pass', host: '127.0.0.1', database: 'testpdb', adapter: 'postgresql') | |
v.dbsync("src_tbl", "dst_tbl") # destination table should already been exist | |
# if your destination tables' columns are different than the source table (e.g; clonse `col1` data to m_col1 column): | |
v.dbsync("your_src_tbl", "your_dst_tbl", {"col1" => "m_col1", "col2" => "m_col2"}) # you can add as much as column as you want |
Add and remove bootstrap custom fields by single clicks
index.html
file:
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/js/bootstrap.min.js"
<link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.6/css/bootstrap.min.css"
<link rel="stylesheet" href="scripts/main.js"
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 |
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
OlderNewer