sudo su
mkdir /usr/share/adminer
cd /usr/share/adminer
wget "https://www.adminer.org/latest.php"
ln -s latest.php adminer.php
echo "Alias /random_string_here_for_ex_vsj935j43s /usr/share/adminer/adminer.php" > /etc/apache2/conf-available/adminer.conf
a2enconf adminer
service apache2 restart
exit
This file contains hidden or 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
cat <<EOF >> /etc/apt/sources.list | |
deb http://archive.ubuntu.com/ubuntu precise main restricted universe | |
deb http://archive.ubuntu.com/ubuntu precise-updates main restricted universe | |
deb http://security.ubuntu.com/ubuntu precise-security main restricted universe multiverse | |
EOF | |
apt-get update | |
apt-get remove \ | |
apache2 \ |
This file contains hidden or 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
require 'resque/tasks' | |
require 'resque/scheduler/tasks' | |
def get_pgid(file) | |
pgid = true | |
if File.file?(file) | |
fpid = File.read(file).to_i | |
pgid = `ps -o pgid --no-headers --pid #{fpid}`.strip! | |
if pgid | |
puts "Process group ID found: #{pgid}" |
- Install Redis:
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
make install
- Add conf file:
redis.conf
- Run server:
@oauth = Koala::Facebook::OAuth.new(<app_id>, <app_secret>, 'https://site.com/')
code = @oauth.url_for_oauth_code(:permissions => "publish_actions,manage_pages,publish_pages")
=> "https://www.facebook.com/dialog/oauth?client_id=<app_id>&redirect_uri=https%3A%2F%2Fsite.com%2F&scope=publish_actions%2Cmanage_pages%2Cpublish_pages"
Open that url in browser and grant access to app. At the end you will be redirected to your website https://site.com/?code=<access_token>
. Paste access token here:
@oauth.get_access_token_info(<access_token>)
Paste that access token here:
Edit file /etc/aliases
add:
root: [email protected]
Run:
newaliases
Check your MTA:
DEB from elastic.co:
add-apt-repository -y ppa:webupd8team/java && apt-get update && apt-get -y install oracle-java8-installer && wget https://artifacts.elastic.co/downloads/elasticsearch/elasticsearch-5.1.2.deb && dpkg -i elasticsearch-5.1.2.deb && update-rc.d elasticsearch defaults && /etc/init.d/elasticsearch start && rm elasticsearch-5.1.2.deb
Add to Gemfile:
gem 'sunspot_rails'
gem 'sunspot_solr' # optional pre-packaged Solr distribution for use in development
Bundle it!
bundle update
Generate a default configuration file:
This file contains hidden or 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
resize_images = (resize = false) -> | |
resize_single = (that) -> | |
if that.height() <= 200 | |
that.css({'width': 'auto', 'height': '100%'}) | |
else | |
that.css({'width': '100%', 'height': 'auto'}) | |
resize_process = (that) -> | |
# change dimensions to original | |
that.css({'width': 'auto', 'height': 'auto'}) | |
# fit parent box |
This file contains hidden or 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
# Redis configuration file example. | |
# | |
# Note that in order to read the configuration file, Redis must be | |
# started with the file path as first argument: | |
# | |
# ./redis-server /path/to/redis.conf | |
# Note on units: when memory size is needed, it is possible to specify | |
# it in the usual form of 1k 5GB 4M and so forth: | |
# |