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
db.createCollection("jobs", { | |
capped: 1, | |
size: 100000, | |
max: 10 | |
}) |
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
SELECT | |
ID, | |
post_title, | |
post_status, | |
CONCAT('http://www.yourwebsite.com/wp-content/uploads/', | |
thumbnail.meta_value) AS picture, | |
MATCH (post_title) AGAINST ('term') AS title_score, | |
MATCH (post_excerpt) AGAINST ('term') AS excerpt_score, | |
MATCH (post_content) AGAINST ('term') AS content_score | |
FROM wp_posts |
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
-- | |
-- Replace 1 with the post id | |
-- | |
WITH | |
posts_query AS ( | |
SELECT | |
to_tsvector(posts.title) AS posts_title, | |
to_tsvector(posts.tags) AS posts_tags | |
FROM posts | |
), |
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/sh | |
# | |
# On your local machine | |
# | |
# local$ npm install --production | |
# local$ meteor build .build --architecture os.linux.x86_64 | |
# | |
# On your server |
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
# workers | |
# grep processor /proc/cpuinfo | wc -l | |
# | |
# workers connections | |
# ulimit -n | |
# Check the architecture | |
grep --color=always -iw lm /proc/cpuinfo | |
# Buid go workers |
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/sh | |
APP_PATH=$APP_ROOT | |
exit_with_error(){ | |
echo "---> An Error Has Occurred!" | |
} | |
echo "---> Receiving push as $USER" | |
git --work-tree=$APP_PATH --git-dir=$GIT_DIR checkout -f |
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
# | |
# Import videos from CSV | |
# | |
# CSV row: | |
# 0 - embedded_video | |
# 1 - link | |
# 2 - categories (Funny;Euro;Cam) | |
# 3 - rating | |
# 4 - author username |
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
start on runlevel [2345] | |
stop on runlevel [!2345] | |
respawn | |
env PORT=<APP-PORT> | |
setuid <APP-NAME> | |
chdir /<APP-PATH> |
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/sh | |
# /<REPOS-PATH>/<REPO-NAME>.git/hooks/post-receive | |
APP_PATH=/<APP-PATH> | |
exit_with_error(){ | |
echo "---> An Error Has Occurred!" | |
} | |
echo "---> Receiving push as $USER" | |
git --work-tree=/<APP-PATH> --git-dir=/<REPOS-PATH>/<REPO-NAME>.git checkout -f |
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
./configure \ | |
--user=nginx \ | |
--group=nginx \ | |
--prefix=/usr/share/nginx/nginx-1.7.12 \ | |
--add-module=../nginx-rtmp-module-master \ | |
--sbin-path=/usr/local/sbin/nginx \ | |
--conf-path=/usr/share/nginx/nginx-1.7.12/conf/nginx.conf \ | |
--pid-path=/var/run/nginx.pid \ | |
--error-log-path=/var/log/nginx/error.log \ | |
--http-log-path=/varlog/nginx/access.log |