Coder Social home page Coder Social logo

sylhare / type-on-strap Goto Github PK

View Code? Open in Web Editor NEW
790.0 10.0 880.0 105.84 MB

🎨 Simplistic, responsive jekyll based open source theme

Home Page: https://sylhare.github.io/Type-on-Strap/

License: MIT License

HTML 3.30% JavaScript 10.53% Ruby 1.65% Dockerfile 0.44% SCSS 39.16% Liquid 44.92%
jekyll jekyll-theme jekyll-site jekyll-blog jekyll-search portfolio-page github-page seo-tags jekyll-website portfolio-websites

type-on-strap's Introduction

Type on Strap 🎨

Build Gem Version Docker Pulls

Default Type on Strap blog

A free and open-source Jekyll theme. Based on Rohan Chandra type-theme packed with extra features and easily customizable:

Demo Site

Usage

As a ruby gem 💎

Check out this tutorial: Use as Ruby Gem

Open in Gitpod

As a github page 📋

  1. Fork and clone the Type on Strap repo: git clone https://github.com/Sylhare/Type-on-Strap.git
  2. Install Jekyll: gem install jekyll, check #1 if you have a problem.
  3. Install the theme's dependencies: bundle install
  4. Customize the theme
  5. Run the Jekyll server: bundle exec jekyll serve

Structure

Here are the main files of the template

./Type-on-Strap
├── _includes	               # Theme includes
├── _layouts                   # Theme layouts (see below for details)
├── _portfolio	               # Collection of articles for the portfolio page
├── _posts                     # Blog posts
├── _sass                      # Sass partials (compiled into css at runtime)
├── assets
|  ├── js	               # JS compiled for distribution + raw sources
|  ├── css                     # CSS compiled for distribution
|  ├── fonts		       # Font-Awesome, and other fonts
|  └── img		       # Images used for the template
├── pages
|   ├── 404.md		       # To be displayed when url is wrong
|   ├── about.md               # About example page
|   ├── gallery.md             # Gallery page for your photos
|   ├── portfolio.md	       # Portfolio page for your projects
|   ├── search.md	       # Search page
|   └── tags.md                # The tag page
├── _config.yml                # sample configuration
├── _data.yml
|  ├── authors.yml             # Update the post authors configurations 
|  ├── language.yml            # Localization configuration
|  ├── biblio.yml              # To create a reference bibliography
|  ├── social.yml              # Social configurations to share posts (RSS, shares, ...)
|  └── icons.yml               # Footer icons (Twitter, Github, Stackoverflow, ...)
└── index.html                 # sample home page (blog page paginated)

Configure Type on Strap 🛠

Open _config.yml in a text editor to change most of the blog's settings.

If a variable in this document is marked as "optional", disable the feature by removing all text from the variable.

Site configuration

Base url

Configure Jekyll as your own blog or with a "baseurl" in _config.yml:

Jekyll website without a "baseurl" (such as a GitHub Pages website with your username as the repository name):

baseurl: ""
url: "https://username.github.io"

Jekyll website with "baseurl" (like the Type on Strap demo page):

baseurl: "/sub-directory"
url: "https://username.github.io"

Jekyll blog configuration

And here is the basic information you will need in your _config.yml for it to work properly:

# BLOG CONFIGURATION
post_navigation: true
paginate: 10
paginate_path: "blog/page:num"
plugins: [jekyll-paginate, jekyll-seo-tag, jekyll-feed]

To configure the blog part and default plugins. Those plugins are validated by GitHub page.

Meta and Branding

Meta variables hold basic information about your Jekyll site, which will be used throughout the site and as meta properties that are used for search engines, browsers, and the site's RSS feed.

Change these variables in _config.yml:

title: My Jekyll Blog                 # Name of website
avatar: assets/img/avatar.png         # Path of avatar image, to be displayed in the theme's header
description: My blog posts            # Short description, primarily used by search engines
favicon: assets/favicon.ico           # Icon displayed in the tab
color_theme: auto                     # color theme auto, dark or light

You can also customize the seo tags default option following the jekyll-seo-tag plugin documentation. The color theme can be set to dark or light (customize it in variables.scss). Using auto you'll have a tiny icon in the navbar allowing the use to manually switch from dark to light theme.

Theme customization 🎨

Footer and Header text

Customize your site header/footer with these variables in _config.yml:

header_text: Welcome to my Jekyll blog
footer_text: Copyright 2017

If you don't want anything, replace the value by " ".

Header's image

The header's image (tested with 2480x1280) can be set as one image with header_feature_image but can also be responsive:

header_feature_image: assets/img/header/my-header-image.png
header_feature_image_responsive: true

By setting header_feature_image_responsive to true, it will look for images with suffix -small (620x320) and -medium (1240x640) to display on smaller screen.

Localisation string

Localization string is a way to quickly change the template language for text like Next Post or Follow on, ... You can find all the properties in _data/language.yml.

By default, it is in English, but you can easily add your own language.

Here you also can set the date format, e.g., set str_date_format: '%B %-d, %Y' for "January, 13, 2024", str_date_format: '%Y-%m-%d' for 2024-01-13, or str_date_format: '%d.%m.%Y' for 13.01.2024.

Google Analytics

To enable Google Analytics (GA4), add your Measurement ID to _config.yml like so:

google_analytics: G-XXXXXXXXXX

It will use the Google Tag Manager

Comments 💬

Disqus

If you have a Disqus account, you can show a comments section below each post.

To enable Disqus comments, add your Disqus shortname to your project's _config.yml file:

comments:
  disqus_shortname: my_disqus_shortname

Cusdis

Cusdis is an open-source alternative to Disqus. You can read more about it in the documentation

To enable it, set your Cusdis name in _config.yml:

comments:
  cusdis_app_id: my_data-app-id                                     

Utterances

Utterances is another open source alternative linked to one's GitHub account. It stores the comments as GitHub issues on a repository for each page.

Install the utterance app to your repo. After installing, add your info in the _config.yml:

comments:
  utterances:              # Enable by filling below information. For more info, go to https://utteranc.es
    repo:                  # your public comments repository (e.g. owner/repo)
    issue-term:            # Issue term (e.g. "comment" consider issues with this word in the title as comments)
    theme:                 # OPTIONAL: Take the `color_theme` by default, or set a custom one like github-dark-orange
    label:                 # OPTIONAL: Adds an issue label in the issue

Math typesetting with KateX

When KateX is set in _config.yml:

katex: true # to enable it

You can then wrap math expressions with $$ signs in your posts and make sure you have set the katex variable in _config.yml to true for math typesetting.

For inline math typesetting, type your math expression on the same line as your content. For example:

Type math within a sentence $$2x^2 + x + c$$ to display inline

For display math typesetting, type your math expression on a new line. For example:

$$
  \bar{y} = {1 \over n} \sum_{i = 1}^{n}y_i
$$

You can find a cheat sheet of the compatible LaTex symbols online.

Diagrams with Mermaid

Enable the mermaid-js diagram rendering by setting mermaid to true in the _config.yml. This will load and init the mermaid.min.js.

mermaid: default # Enable mermaid-js for diagrams, use theme: base, forest, dark, default, neutral

Find all the help you need on the official mermaid documentation. Use mermaid as color highlighter language to render the diagram or with the class="mermaid" inside the <div>:

```mermaid
sequenceDiagram
    Alice->>John: Hello John, how are you?
    John-->>Alice: Great!

Social icons

In _data/social.yml you can customize the social icons that will be displayed in the post to share your post. You can also enable RSS. The site icons come from Font Awesome.

In _data/icons.yml you can set the footer icon that will appear at the bottom of the page. They will redirect the user on your profile on to other platforms like Twitter, GitHub and so many more!

Cookie consent

You can add a cookie consent with a disclaimer if you use Google Analytics while respecting the GDPR. Set to true, there will be a banner at the bottom of the page with the disclaimer, and an approve button. Once the user clicks on "Approve" the cookies will be created for Google Analytics.

Share in article

The share icons are the one at the bottom of the blog page if enabled. They will on click redirect you to the logo's platform to share the article.

Footer

Display icons in the footer. All icon variables should be your username enclosed in quotes (e.g. "username") in _data/icons.yml.

You can update the RSS settings in _data/social to change the default feed path (generated by jekyll-feel). To enable the share icons at the bottom of each article set to true the one you'd like under share in the _data/social.yml file.

Personalize your Blog Posts 📝

When writing a post, be sure in jekyll to:

  • Put it in the _posts folder
  • Name it with the date first like 2019-08-21-This-is-my-blog-post.md

Please refer to the Jekyll docs for writing posts.

Layout: Post

These are the basic features you can use with the post layout, in the comment the Opt means that it is optional.

---
layout: post
title: Hello World                                # Title of the page
hide_title: true                                  # [Opt] Hide the title when displaying the post, but shown in lists of posts
feature-img: "assets/img/sample.png"              # [Opt] Add a feature-image to the post
thumbnail: "assets/img/thumbnails/sample-th.png"  # [Opt] Add a thumbnail image on blog view
color: rgb(80,140,22)                             # [Opt] Add the specified colour as feature image, and change link colors in post
position: 1                                       # [Opt] Set position on the menu navigation bar
tags: [sample, markdown, html]                    # [Opt] Add tags to the page
---

With thumbnail, you can add a smaller image than the feature-img. If you don't have a thumbnail, you can still use the same image as the feature one. Or use the gulp task to create it.

If you don't use a feature image, but color, the transparent background is set comes from lineart.png. You can edit it in the config file (_config.yml > color_image). If you want another one, put it in /assets/img as well.

For position, if not set on all pages, it will be by alphabetical order without position then by position order. If two pages have the same position number, the order is decided by alphabetical order on the page title.

There's also bootstrap: true which is not mandatory and only useful if you want to add HTML content in your page that requires bootstrap. It will respect the page and theme layout, mind the padding on the sides.

Post excerpt

The excerpt are the first lines of an article that is displayed on the blog page. The length of the excerpt has a default of around 250 characters or can be manually set in the post using:

in conflig.yml:

excerpt: true

Then in your post, add the excerpt separator:

---
layout: post
title: Sample Page
excerpt_separator: <!--more-->
---

some text in the excerpt
<!--more-->
... rest of the text not shown in the excerpt ...

The html is stripped out of the excerpt, so it only displays text.

Image aligner

To easily add align images side by side in your article using the aligner.html include:

{% include aligner.html images="path/to/img1.png,path/to/img2.png,path/to/img3.png" column=3 %}

Use it in any markdown file. There are two fields in the include you need to look into:

  • images: Takes a string separated with , of all the images' path.
    • It by default look into assets/img/ so give the path from there.
  • column: (OPTIONAL) Set the number of column you want your imaged displayed in.
    • default is 2 columns
    • column=3 set 3 columns
    • column="auto" makes as many columns as images

Code highlight

Like all CSS variables in the theme, you can edit the color of the code highlight in _sass > base > _variables.scss. The code highlighting works with base16 you can find existing example of your favourite highlight color scheme on this format.

Feature pages and layouts

All feature pages besides the "home" one are stored in the page folder, they will appear in the navigation bar unless you set Hide: true in the front matter.

Here are the documentation for the other feature pages that can be added through _config.yml.

Non-standard features are documented below.

Layout: Default

This layout includes the head, navigation bar and footer around your content. Unless you are making a custom layout you won't need it.

Layout: Home 🏡

This page is used as the home page of the template (in the index.html). It displays the list of articles in _posts. You can use this layout in another page (adding a title to it will make it appear in the navigation bar).

The recommended width and height for the home picture is width:2484px; and height:1280px which are the dimensions of the actual picture for it to be rolling down as you scroll the page.

If your posts are not displaying ensure that you have added the line paginate: 5 to _config.yml.

Layout: Page 📄

The page layout has a bit more features explained here.

---
layout: page
title: "About" 
subtitle: "This is a subtitle"   
feature-img: "assets/img/sample.png" 
permalink: /about/                   # Set a permalink your your page
hide: true                           # Prevent the page title to appear in the navbar
icon: "fa-search"                    # Will Display only the fontawesome icon (here: fa-search) and not the title
tags: [sample, markdown, html]
---

The hide only hides your page from the navigation bar, it is, however, still generated and can be accessed through its link.

Feature: Portfolio 🗂

Portfolio is a feature page that will take all the markdown/html files in the _portfolio folder to create a 3-columns image portfolio matrix.

To use the portfolio, simply create a portfolio.md with this information inside:

--- 
layout: page
title : Portfolio 
---

{% include default/portfolio.html %}

Portfolio posts

You can format the portfolio posts in the _portfolio folder using the post layout. Here is a little explanation on some of the possible features you can use.

If you decide to use a date, please be sure to use one that can be parsed such as yyyy-mm-dd. You can see more format examples in the demo posts that are available for the theme:

---
layout: post
title: Circus				       # Title of the portfolio post
feature-img: "assets/img/portfolio/cake.png"   # Will display the image in the post
img: "assets/img/portfolio/cake.png"           # Will display the image in the portfolio page
date: 2019-07-25		 	       # Not mandatory, however needs to be in date format to display the date
---

Portfolio in gem

Make sure your _config.yml contains the following if you are using the theme as a gem:

# PORTFOLIO
collections:
  portfolio:
    output: true
    permalink: /:collection/:name

This creates the collection for Jekyll, so it can find and display your portfolio posts.

Feature: Gallery 🖼

You can create a gallery using Masonry JS which will placing the pictures at the optimal position based on available vertical space. You need to specify the gallery_path which will be used to find the pictures to render. It will take all the pictures under that directory. Then use the include to add it in your page.

---
layout: page
title: Gallery
gallery: "assets/img/pexels"
---

{% include default/gallery.html gallery_path=page.gallery %}

Feature: Search 🔍

The search feature is based on Simple-Jekyll-search there is a search.liquid file that will create a list of all the site posts, pages and portfolios. Then there's a script displaying the formatted results in the search page.

To exclude contents from the search add the exclude: true option in the markdown header. By default, all posts, pages, and collections are available in the search. Hide the search page from the navigation bar with the hide: true option. You can remove the icon by removing icon:

---
layout: search
title: Search
icon: "search"
---

Feature: Tags 🏷

Tags should be placed between [] in your post metadata. Separate each tag with a comma. Tags are recommended for posts and portfolio items.

For example:

---
layout: post
title: Markdown and HTML
tags: [sample, markdown, html]
---

Tags are case-sensitive Tag_nAmetag_name

All the tags will be listed on the "tags" page with a link toward the pages or posts. The Tag page can be hidden with the hide option. You can remove the icon by removing icon (like for the search page).

Advanced

Liquid tags

Jekyll works with liquid tags usually represented by:

{{ liquid.tag | filter }}

These are useful to render your jekyll files. You can learn more about them on shopify's doc

Gulp toolbox

Requirements

Before you need to have node and npm installed:

  • Windows: https://nodejs.org/
  • Ubuntu/Debian: apt-get install nodejs npm libgl1 libxi6
  • Fedora (dnf) / RHEL/CentOS (yum): dnf install node npm libglvnd-glx libXi

Then you need to install gulp-cli and its dependencies:

cd assets/
sudo npm install gulp-cli -g
npm install

Minimizing and optimizing: css, js and images

You can run the default task that will compress the js, css and images and create the thumbnails for the supported image formats:

cd assets/
gulp default
gulp thumbnails-all # to create all of the images thumbnails
gulp thumbnails     # to create thumbnails for the feature-img/ only
# tip: run a git status to see the changes
git status

You can find more about the gulp tasks in the gulpfile.js.

Create a post

To create a .md file in the _posts/ section with the jekyll format of today's date. Use this command with the title you'd like to create the very basic post.

gulp post -n 'title of the post'

A file will be created following the format yyyy-mm-dd-title-of-the-post.md with default post attributes inside. Nothing will happen if the file exists already.

Use as Ruby Gem 💎

You can use Type-on-strap as a gem.

Using the Ruby Gem Method. Add this line to your Jekyll site's Gemfile (or create one):

gem "type-on-strap"

Add this line to your Jekyll site's _config.yml file:

theme: type-on-strap

Then run Bundler to install the theme gem and dependencies:

bundle install

Then you can start adding content like:

  • Add a index.html file
  • Add the feature page you want. (ex: as it is already in pages)
  • Add posts in _posts and _portfolio to be displayed

Remote Theme

Now you can use any theme gem with GitHub pages with 29/11/2017 GitHub Pages Broadcast. For that remove all theme: attributes from _config.yml and add instead:

remote_theme: sylhare/Type-on-Strap 

License

This theme is licensed under the MIT License (MIT)

type-on-strap's People

Contributors

24367dfa avatar arthurlacoste avatar asvrada avatar ayltai avatar bahnfrei avatar bernasv avatar cookieplmonster avatar dependabot[bot] avatar ekremkaraca avatar im-coder-lg avatar imgbotapp avatar jss367 avatar jtc avatar mathieubrun avatar mg-5 avatar mhagnumdw avatar nickchen120235 avatar noisywool avatar peavers avatar remibou avatar ryanking13 avatar siewlinyap avatar soroosh avatar soullivaneuh avatar stasinos avatar sylhare avatar yshrsmz avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

type-on-strap's Issues

Receiving warning for the 'master' branch by e-mail

Hi, I finished buiilding my blog easily.
Thanks for such a nice theme!

btw, after setting up my blog like README, I receive warning mail from Github
Like

The page build completed successfully, but returned the following warning for the `master` branch:

You are attempting to use a Jekyll theme, "type-on-strap", which is not supported by GitHub Pages.
Please visit https://pages.github.com/themes/ for a list of supported themes. 
If you are using the "theme" configuration variable for something other than a Jekyll theme, 
we recommend you rename this variable throughout your site. For more information, see 
https://help.github.com/articles/adding-a-jekyll-theme-to-your-github-pages-site/.

For information on troubleshooting Jekyll see:

 https://help.github.com/articles/troubleshooting-jekyll-builds

If you have any questions you can contact us by replying to this email.

Blog works totally fine! Not sure why the warning message appears :(

Images get squashed if specifying width and height HTML tags

If one specifies both a width and a height tag when inserting an image through HTML, the image gets squished in width. This seems to be due to the padding of images.

I've put up a demo of this issue at the links below, using a square image so it is clear to see when it gets squished.

Published site: https://jtc.github.io/Type-on-Strap-width-demo/2017/12/12/image-width-issue.html
Repository: https://github.com/jtc/Type-on-Strap-width-demo/blob/master/_posts/2017-12-12-image-width-issue.md

If you specify height only it is fine. If you specify width only, the image doesn't get squished, but it does get resized quite smaller than was specified.

RSS feed is not generated

The feed.xml file referenced by the theme is not being generated. I tried adding jekyll-feed under plugins in the _config.yml file. This resulted in this error message when starting jekyll serve.

Dependency Error: Yikes! It looks like you don't have jekyll-feed or one of its dependencies installed. In order to use Jekyll as currently configured, you'll need to install this gem. The full error message from Ruby is: 'cannot load such file -- jekyll-feed' If you run into trouble, you can find helpful resources at https://jekyllrb.com/help/!

Even after running sudo gem install jekyll-feed successfully the startup error persists. What do I need to install to get the RSS feed working?

Increase the Performance rate of the template on GTMetrix

Edit April 2019:

better

Original issue:
So there is GTMetrix which is a website that rates the rapidity of your website online. The template is actually quoted at B(82%)

gtmetrix

It seems there are a couple of things that can be done to increase the performance, so we should address it here:

  • Optimize images (rated F) #10 #12
  • Leverage browser caching (rated F) #8
  • Serve scaled images (rated C) #13
  • Defer parsing of JavaScript (rated C)
  • Add Expires headers (rated F) #8

Inline code blocks

There doesn't seems to be any configuration done for inline code blocks either on highlighting or fonts.

Header image "over scrolls" on page

The image overscroll on the page, so instead of the image being blocked at its end, it continues going down as I scroll. It should stop scrolling at the bottom of the image.

Plus the background: no-repeat; was not set on the page layout.

Duplication of Home page when enabled

When I added title to the index.html, the Home tab is shown twice.

screen shot 2018-05-03 at 15 29 40

The first Home redirects to the first page of blog posts and the second Home redirects to the second page of blog posts.

I'd like to just show one Home tab which will re-direct to all the blog posts.

Limit excerpt

Is there any way to control what goes out as the excerpt to the home page. If not, would it be possible to add a way to limit the length of the excerpt from the post?

For example I have a short post followed by a code block and it looks very strange on the homepage, it would look much better if I could limit the length of the excerpt so it would not include the beginning of the code block.

Thanks for the theme!

search not working

search Indexes error


                        {
                          "title"    : "Open-Falcon 监控",
                          "category" : "",
                          "tags"     : " ",
                          "url"      : "/linux/2017/08/18/Open-Falcon.html",
                          "date"     : "August 18, 2017",
                          "excerpt"  : "环境准备  官方文档 https://book.open-falcon.org/zh_0_2安装 golangwget https://storage.googleapis.com/golang/go1.6.4.linux-amd64.tar.gztar zxvf go1.6.4.linux-amd64.tar.gzmv go /opt/local/# 增加环境变量vi /etc/profile# Golang ENVexport GOROOT=/opt/local/goexport PA...",
                          "content"  : "环境准备  官方文档 https://book.open-falcon.org/zh_0_2安装 golangwget https://storage.googleapis.com/golang/go1.6.4.linux-amd64.tar.gztar zxvf go1.6.4.linux-amd64.tar.gzmv go /opt/local/# 增加环境变量vi /etc/profile# Golang ENVexport GOROOT=/opt/local/goexport PATH=$PATH:$GOROOT/binexport GOPATH=/opt/local/golanggo versiongo version go1.6.4 linux/amd64安装 Mysql 5.7# 初始化依赖yum -y install cmake ncurses ncurses-devel bison bison-devel boost boost-devel# 创建 mysql 用户以及相关目录/usr/sbin/groupadd mysql/usr/sbin/useradd -g mysql mysqlmkdir -p /opt/local/mysql/datamkdir -p /opt/local/mysql/binlogmkdir -p  /opt/local/mysql/logsmkdir -p /opt/local/mysql/relaylogmkdir -p /var/lib/mysqlmkdir -p /opt/local/mysql/etc# 下载 源码包wget ftp://ftp.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.7/mysql-5.7.19.tar.gztar zxvf mysql-5.7.19.tar.gzcd mysql-5.7.19cmake -DCMAKE_INSTALL_PREFIX=\"/opt/local/mysql\" -DDEFAULT_CHARSET=utf8 \-DMYSQL_DATADIR=\"/opt/local/mysql/data/\" -DCMAKE_INSTALL_PREFIX=\"/opt/local/mysql\" \-DINSTALL_PLUGINDIR=plugin -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_COLLATION=utf8_general_ci \-DENABLED_LOCAL_INFILE=1 -DENABLED_PROFILING=1 -DWITH_ZLIB=system \-DWITH_EXTRA_CHARSETS=none -DMYSQL_MAINTAINER_MODE=OFF -DEXTRA_CHARSETS=all \-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 \-DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boostmake -j `cat /proc/cpuinfo | grep processor| wc -l`make install# 创建相关目录,授权chmod +w /opt/local/mysqlchown -R mysql:mysql /opt/local/mysqlchmod +w /var/lib/mysqlchown -R mysql:mysql /var/lib/mysqlcp /opt/local/mysql/support-files/mysql.server  /etc/init.d/mysqldchmod 755 /etc/init.d/mysqldecho 'basedir=/opt/local/mysql/' &gt;&gt; /etc/init.d/mysqldecho 'datadir=/opt/local/mysql/data' &gt;&gt;/etc/init.d/mysqld# 创建关联ln -s /opt/local/mysql/lib/mysql /usr/lib/mysqlln -s /opt/local/mysql/include/mysql /usr/include/mysqlln -s /opt/local/mysql/bin/mysql /usr/bin/mysqlln -s /opt/local/mysql/bin/mysqldump /usr/bin/mysqldumpln -s /opt/local/mysql/bin/myisamchk /usr/bin/myisamchkln -s /opt/local/mysql/bin/mysqld_safe /usr/bin/mysqld_safeln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock# 初始化数据库vi /opt/local/mysql/etc/my.cnf[client]default-character-set=utf8mb4[mysqld]########basic settings########server-id = 1port = 3306user = mysqlbind_address = 127.0.0.1autocommit = 1character_set_server=utf8mb4collation-server=utf8mb4_unicode_ciskip-character-set-client-handshakeinit_connect='SET collation_connection = utf8mb4_unicode_ci'init_connect='SET NAMES utf8mb4'skip_name_resolve = 1max_connections = 800max_connect_errors = 1000datadir = /opt/local/mysql/datapid-file = /opt/local/mysql/mysql.pidtransaction_isolation = READ-COMMITTEDexplicit_defaults_for_timestamp = 1join_buffer_size = 134217728tmp_table_size = 67108864tmpdir = /tmpmax_allowed_packet = 16777216sql_mode = \"STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER\"interactive_timeout = 1800wait_timeout = 1800read_buffer_size = 16777216read_rnd_buffer_size = 33554432sort_buffer_size = 33554432########log settings########log_error = /opt/local/mysql/logs/mysqld.logslow_query_log = 1slow_query_log_file = /opt/local/mysql/logs/slow.loglog_queries_not_using_indexes = 1log_slow_admin_statements = 1log_slow_slave_statements = 1log_throttle_queries_not_using_indexes = 10expire_logs_days = 90long_query_time = 2min_examined_row_limit = 100########replication settings########master_info_repository = TABLErelay_log_info_repository = TABLElog_bin = /opt/local/mysql/binlog/mysql-binsync_binlog = 1gtid_mode = onenforce_gtid_consistency = 1log_slave_updatesbinlog_format = rowrelay_log = /opt/local/mysql/relaylog/relay-binrelay_log_recovery = 1binlog_gtid_simple_recovery = 1slave_skip_errors = ddl_exist_errors########innodb settings########innodb_page_size = 16384innodb_buffer_pool_size = 8Ginnodb_buffer_pool_instances = 8innodb_buffer_pool_load_at_startup = 1innodb_buffer_pool_dump_at_shutdown = 1innodb_lru_scan_depth = 2000innodb_lock_wait_timeout = 5innodb_io_capacity = 4000innodb_io_capacity_max = 8000innodb_flush_method = O_DIRECTinnodb_file_format = Barracudainnodb_file_format_max = Barracudainnodb_log_group_home_dir = /opt/local/mysql/relayloginnodb_undo_directory = /opt/local/mysql/binloginnodb_undo_logs = 128innodb_undo_tablespaces = 3innodb_flush_neighbors = 1innodb_log_file_size = 4Ginnodb_log_buffer_size = 16777216innodb_purge_threads = 4innodb_large_prefix = 1innodb_thread_concurrency = 64innodb_print_all_deadlocks = 1innodb_strict_mode = 1innodb_sort_buffer_size = 67108864############mysql 5.7 ##################innodb_buffer_pool_dump_pct = 40innodb_page_cleaners = 4innodb_undo_log_truncate = 1innodb_max_undo_log_size = 2Ginnodb_purge_rseg_truncate_frequency = 128binlog_gtid_simple_recovery=1log_timestamps=systemtransaction_write_set_extraction=MURMUR32show_compatibility_56=on########semi sync replication settings#########plugin_dir=/opt/local/mysql/lib/plugin#plugin_load = \"rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so\"#loose_rpl_semi_sync_master_enabled = 1#loose_rpl_semi_sync_slave_enabled = 1#loose_rpl_semi_sync_master_timeout = 5000rm -rf /etc/my.cnfcd /opt/local/mysql/bin//opt/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/opt/local/mysql --datadir=/opt/local/mysql/data# 查看 mysql 密码cat /opt/local/mysql/logs/mysqld.log |grep password# 启动 mysqlservice mysqld startchkconfig mysqld on# 设置安全配置/opt/local/mysql/bin/mysql_secure_installation -uroot -p# 登陆 mysqlmysql -uroot -p安装 redis# 下载 rediswget http://download.redis.io/releases/redis-3.2.10.tar.gztar zxvf redis-3.2.10.tar.gz cd redis-3.2.10makemake installcd  utils./install_server.sh...... 输入相关信息 ......cd /etc/init.d/mv redis_6379  redis# 创建 目录mkdir -p /opt/local/redis/{data,logs,conf}cd /opt/local/redis/confvi redis.confbind 127.0.0.1protected-mode yesport 6379tcp-backlog 2048timeout 0tcp-keepalive 300daemonize yessupervised nopidfile /var/run/redis.pidloglevel noticelogfile \"/opt/local/redis/logs/redis.log\"maxmemory 10gbdatabases 16save 900 1save 300 10save 60 10000stop-writes-on-bgsave-error yesrdbcompression yesrdbchecksum yesdbfilename redis_dump.rdbdir /opt/local/redis/dataslave-serve-stale-data yesslave-read-only yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noslave-priority 100appendonly noappendfilename \"appendonly.aof\"appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated yeslua-time-limit 5000slowlog-log-slower-than 10000slowlog-max-len 128latency-monitor-threshold 0notify-keyspace-events \"\"hash-max-ziplist-entries 512hash-max-ziplist-value 64list-max-ziplist-size -2list-compress-depth 0set-max-intset-entries 512zset-max-ziplist-entries 128zset-max-ziplist-value 64hll-sparse-max-bytes 3000activerehashing yesclient-output-buffer-limit normal 0 0 0client-output-buffer-limit slave 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8mb 60hz 10aof-rewrite-incremental-fsync yes# 启动 redischkconfig redis onservice redis start配置 Open-Falcon初始化环境mkdir -p $GOPATH/src/github.com/open-falconcd $GOPATH/src/github.com/open-falcongit clone https://github.com/open-falcon/falcon-plus.git导入数据库cd $GOPATH/src/github.com/open-falcon/falcon-plus/scripts/mysql/db_schema/mysql -u root -p &lt; 1_uic-db-schema.sqlmysql -u root -p &lt; 2_portal-db-schema.sqlmysql -u root -p &lt; 3_dashboard-db-schema.sqlmysql -u root -p &lt; 4_graph-db-schema.sqlmysql -u root -p &lt; 5_alarms-db-schema.sql编译 程序cd $GOPATH/src/github.com/open-falcon/falcon-plus/# 编译所有的模块make all# 编译指定模块make agent# 打包make pack# 创建目录mkdir /opt/local/open-falconmv open-falcon-v0.2.1.tar.gz /opt/local/open-falconcd /opt/local/open-falcontar zxvf open-falcon-v0.2.1.tar.gz [root@localhost open-falcon]# lsagent  aggregator  alarm  api  gateway  graph  hbs  judge  nodata  open-falcon  plugins  public  transfer配置 Transfer  transfer是数据转发服务。它接收agent上报的数据,然后按照哈希规则进行数据分片、并将分片后的数据分别push给graph&amp;judge等组件。cd /opt/local/open-falcon/transfer/configvi cfg.json{    \"debug\": true,    \"minStep\": 30,    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6060\"    },    \"rpc\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:8433\"    },    \"socket\": {        \"enabled\": false,        \"listen\": \"0.0.0.0:4444\",        \"timeout\": 3600    },    \"judge\": {        \"enabled\": true,        \"batch\": 200,        \"connTimeout\": 1000,        \"callTimeout\": 5000,        \"maxConns\": 32,        \"maxIdle\": 32,        \"replicas\": 500,        \"cluster\": {            \"judge-00\" : \"127.0.0.1:6080\"        }    },    \"graph\": {        \"enabled\": true,        \"batch\": 200,        \"connTimeout\": 1000,        \"callTimeout\": 5000,        \"maxConns\": 32,        \"maxIdle\": 32,        \"replicas\": 500,        \"cluster\": {            \"graph-00\" : \"127.0.0.1:6070\"        }    },    \"tsdb\": {        \"enabled\": false,        \"batch\": 200,        \"connTimeout\": 1000,        \"callTimeout\": 5000,        \"maxConns\": 32,        \"maxIdle\": 32,        \"retry\": 3,        \"address\": \"127.0.0.1:8088\"    }}配置 Graph  graph是存储绘图数据的组件。graph组件 接收transfer组件推送上来的监控数据,同时处理api组件的查询请求、返回绘图数据。# 创建数据 目录mkdir -p /opt/data/6070cd /opt/local/open-falcon/graph/configvi cfg.json{    \"debug\": false,    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6071\"    },    \"rpc\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6070\"    },    \"rrd\": {        \"storage\": \"/opt/data/6070\"    },    \"db\": {        \"dsn\": \"root:123456@tcp(127.0.0.1:3306)/graph?loc=Local&amp;parseTime=true\",        \"maxIdle\": 4    },    \"callTimeout\": 5000,    \"migrate\": {            \"enabled\": false,            \"concurrency\": 2,            \"replicas\": 500,            \"cluster\": {                    \"graph-00\" : \"127.0.0.1:6070\"            }    }}配置 Api 组件  api组件,提供统一的restAPI操作接口。比如:api组件接收查询请求,根据一致性哈希算法去相应的graph实例查询不同metric的数据,然后汇总拿到的数据,最后统一返回给用户。cd /opt/local/open-falcon/api/configvi cfg.json # 主要修改 \"salt\": \"\" 为加密字串{        \"log_level\": \"debug\",        \"db\": {                \"falcon_portal\": \"root:123456@tcp(127.0.0.1:3306)/falcon_portal?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"graph\": \"root:123456@tcp(127.0.0.1:3306)/graph?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"uic\": \"root:123456@tcp(127.0.0.1:3306)/uic?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"dashboard\": \"root:123456@tcp(127.0.0.1:3306)/dashboard?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"alarms\": \"root:123456@tcp(127.0.0.1:3306)/alarms?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"db_bug\": true        },        \"graphs\": {                \"cluster\": {                        \"graph-00\": \"127.0.0.1:6070\"                },                \"max_conns\": 100,                \"max_idle\": 100,                \"conn_timeout\": 1000,                \"call_timeout\": 5000,                \"numberOfReplicas\": 500        },        \"metric_list_file\": \"./api/data/metric\",        \"web_port\": \"0.0.0.0:8080\",        \"access_control\": true,        \"signup_disable\": false,        \"salt\": \"pleaseinputwhichyouareusingnow\",        \"skip_auth\": false,        \"default_token\": \"default-token-used-in-server-side\",        \"gen_doc\": false,        \"gen_doc_path\": \"doc/module.html\"}部署 Heartbeat 服务  心跳服务器,所有agent都会连到HBS,每分钟发一次心跳请求。cd /opt/local/open-falcon/hbs/configvi cfg.json{    \"debug\": true,    \"database\": \"root:123456@tcp(127.0.0.1:3306)/falcon_portal?loc=Local&amp;parseTime=true\",    \"hosts\": \"\",    \"maxConns\": 20,    \"maxIdle\": 15,    \"listen\": \":6030\",    \"trustable\": [\"\"],    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6031\"    }}部署 Judge 服务  Judge用于告警判断,agent将数据push给Transfer,Transfer不但会转发给Graph组件来绘图,还会转发给Judge用于判断是否触发告警。cd /opt/local/open-falcon/judge/configvi cfg.json{    \"debug\": true,    \"debugHost\": \"nil\",    \"remain\": 11,    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6081\"    },    \"rpc\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6080\"    },    \"hbs\": {        \"servers\": [\"127.0.0.1:6030\"],        \"timeout\": 300,        \"interval\": 60    },    \"alarm\": {        \"enabled\": true,        \"minInterval\": 300,        \"queuePattern\": \"event:p%v\",        \"redis\": {            \"dsn\": \"127.0.0.1:6379\",            \"maxIdle\": 5,            \"connTimeout\": 5000,            \"readTimeout\": 5000,            \"writeTimeout\": 5000        }    }}部署一个 mail 服务  发送警告邮件需要部署一个 mail 服务  用于发送邮件, 这里边部署一个简单的 mail-provider 地址 https://github.com/zzlyzq/mail-provider# 下载 依赖模块cd /opt/local/golang/src/github.com/open-falcongit clone https://github.com/zzlyzq/mail-providercd /opt/local/golang/src/github.com/open-falcon/mail-provider# 下载依赖go get ./control build (编译)./control pack (打包)mkdir /opt/local/open-falcon/mail-providermv falcon-mail-provider-0.0.1.tar.gz /opt/local/open-falcon/mail-providercd /opt/local/open-falcon/mail-providertar zxvf falcon-mail-provider-0.0.1.tar.gz# 修改配置文件 里的 smtp 为自己的地址# QQ邮箱,请开启 smtp 的功能,在QQ邮箱后台开启vi cfg.json{    \"debug\": true,    \"http\": {        \"listen\": \"0.0.0.0:4000\",        \"token\": \"\"    },    \"smtp\": {        \"addr\": \"smtp.qq.com:587\",        \"username\": \"[email protected]\",        \"password\": \"123456\",        \"from\": \"[email protected]\"    }}# 运行程序./control start# 查看日志./control tail# 测试, 在测试时 token 暂时设置为空curl http://127.0.0.1:4000/sender/mail -d \"[email protected]&amp;subject=xx&amp;content=yy\"部署一个 微信网关  微信网关 git  https://github.com/Yanjunhui/chatcd /opt/local/open-falcongit clone https://github.com/Yanjunhui/chatcd chat/chmod +x control.sh# 需要修改 配置文件cat config.conf#http 服务端口[http]port = 4567#微信接口信息[weixin]CorpID = ww6424d33203e90e20AgentId = 1000002Secret = FoST_8RQSTjZwH_CN3aQW6UKksjCSI9mizFqD7HKhrwEncodingAESKey = K2M3WMhRHIOH4I1Ww5jxpllGrgY01nvBjUgTvcJEEHX# 启动./control.sh start./control.sh status## 注意: 要收到 im 报警信息,必须要在 个人用户里面 填写 微信相关资料微信相关帐号是  登陆微信公众号 --&gt; 通讯里, 里面用户的 帐号不是个人微信帐号,填写个人帐号,是收不到报警的。部署 Alarm 服务  alarm模块是处理报警event的,judge产生的报警event写入redis,alarm从redis读取处理,并进行不同渠道的发送。cd /opt/local/open-falcon/alarm/configvi cfg.json{    \"log_level\": \"debug\",    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:9912\"    },    \"redis\": {        \"addr\": \"127.0.0.1:6379\",        \"maxIdle\": 5,        \"highQueues\": [            \"event:p0\",            \"event:p1\",            \"event:p2\"        ],        \"lowQueues\": [            \"event:p3\",            \"event:p4\",            \"event:p5\",            \"event:p6\"        ],        \"userIMQueue\": \"/queue/user/im\",        \"userSmsQueue\": \"/queue/user/sms\",        \"userMailQueue\": \"/queue/user/mail\"    },    \"api\": {        \"im\": \"http://127.0.0.1:4567/send\",        \"sms\": \"http://127.0.0.1:10086/sms\",        \"mail\": \"http://127.0.0.1:4000/sender/mail\",        \"dashboard\": \"http://127.0.0.1:8081\",        \"plus_api\":\"http://127.0.0.1:8080\",        \"plus_api_token\": \"default-token-used-in-server-side\"    },    \"falcon_portal\": {        \"addr\": \"root:123456@tcp(127.0.0.1:3306)/alarms?charset=utf8&amp;loc=Asia%2FChongqing\",        \"idle\": 10,        \"max\": 100    },    \"worker\": {        \"im\": 10,        \"sms\": 10,        \"mail\": 50    },    \"housekeeper\": {        \"event_retention_days\": 7,        \"event_delete_batch\": 100    }}配置 Nodata 服务  nodata用于检测监控数据的上报异常。nodata和实时报警judge模块协同工作,过程为: 配置了nodata的采集项超时未上报数据,nodata生成一条默认的模拟数据;用户配置相应的报警策略,收到mock数据就产生报警。采集项上报异常检测,作为judge模块的一个必要补充,能够使judge的实时报警功能更加可靠、完善。cd /opt/local/open-falcon/nodata/configvi cfg.json {    \"debug\": true,    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6090\"    },    \"plus_api\":{        \"connectTimeout\": 500,        \"requestTimeout\": 2000,        \"addr\": \"http://127.0.0.1:8080\",        \"token\": \"default-token-used-in-server-side\"    },    \"config\": {        \"enabled\": true,        \"dsn\": \"root:123456@tcp(127.0.0.1:3306)/falcon_portal?loc=Local&amp;parseTime=true&amp;wait_timeout=604800\",        \"maxIdle\": 4    },    \"collector\":{        \"enabled\": true,        \"batch\": 200,        \"concurrent\": 10    },    \"sender\":{        \"enabled\": true,        \"connectTimeout\": 500,        \"requestTimeout\": 2000,        \"transferAddr\": \"127.0.0.1:6060\",        \"batch\": 500    }}配置 Aggregator 服务  集群聚合模块。聚合某集群下的所有机器的某个指标的值,提供一种集群视角的监控体验。cd /opt/local/open-falcon/aggregator/configvi cfg.json{    \"debug\": true,    \"http\": {        \"enabled\": false,        \"listen\": \"0.0.0.0:6055\"    },    \"database\": {        \"addr\": \"root:123456@tcp(127.0.0.1:3306)/falcon_portal?loc=Local&amp;parseTime=true\",        \"idle\": 10,        \"ids\": [1, -1],        \"interval\": 55    },    \"api\": {        \"connect_timeout\": 500,        \"request_timeout\": 2000,        \"plus_api\": \"http://127.0.0.1:8080\",        \"plus_api_token\": \"default-token-used-in-server-side\",        \"push_api\": \"http://127.0.0.1:1988/v1/push\"    }}启动所有服务cd /opt/local/open-falcon./open-falcon start./open-falcon check        falcon-graph         UP           71646           falcon-hbs         UP           71658         falcon-judge         UP           71670      falcon-transfer         UP           71678        falcon-nodata         UP           71686    falcon-aggregator         UP           71695         falcon-agent         UP           71706       falcon-gateway         UP           71715           falcon-api         UP           71724         falcon-alarm         UP           71738 配置 Agent  agent用于采集机器负载监控指标,比如cpu.idle、load.1min、disk.io.util等等,每隔60秒push给Transfer。agent与Transfer建立了长连接,数据发送速度比较快,agent提供了一个http接口/v1/push用于接收用户手工push的一些数据,然后通过长连接迅速转发给Transfer。cd /opt/local/open-falcon/agent/config# Agent 配置文件{    \"debug\": true,    \"hostname\": \"\",    \"ip\": \"\",    \"plugin\": {        \"enabled\": false,        \"dir\": \"./plugin\",        \"git\": \"https://github.com/open-falcon/plugin.git\",        \"logs\": \"./logs\"    },    \"heartbeat\": {        \"enabled\": true,        \"addr\": \"127.0.0.1:6030\",        \"interval\": 60,        \"timeout\": 1000    },    \"transfer\": {        \"enabled\": true,        \"addrs\": [            \"127.0.0.1:8433\"        ],        \"interval\": 60,        \"timeout\": 1000    },    \"http\": {        \"enabled\": false,        \"listen\": \":1988\",        \"backdoor\": false    },    \"collector\": {        \"ifacePrefix\": [\"eth\", \"em\"],        \"mountPoint\": []    },    \"default_tags\": {    },    \"ignore\": {        \"cpu.busy\": true,        \"df.bytes.free\": true,        \"df.bytes.total\": true,        \"df.bytes.used\": true,        \"df.bytes.used.percent\": true,        \"df.inodes.total\": true,        \"df.inodes.free\": true,        \"df.inodes.used\": true,        \"df.inodes.used.percent\": true,        \"mem.memtotal\": true,        \"mem.memused\": true,        \"mem.memused.percent\": true,        \"mem.memfree\": true,        \"mem.swaptotal\": true,        \"mem.swapused\": true,        \"mem.swapfree\": true    }}# agent 脚本  添加 hostname = IP#!/bin/bashmkdir /opt/localcd /opt/localwget http://172.16.1.100/agent.tar.gztar zxvf agent.tar.gzrm -rf agent.tar.gzIPADDR=`ifconfig em1|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d \"addr:\"`sed -i 's/\\"hostname\\"\:.*$/\\"hostname\\"\: \\"'$IPADDR'\\"\,/g' open-falcon/agent/config/cfg.jsoncat open-falcon/agent/config/cfg.jsoncd open-falcon./open-falcon start agent./open-falcon check agent配置前端 dashboard初始化依赖yum install -y python-virtualenvyum install -y python-develyum install -y openldap-develyum install -y mysql-develyum groupinstall \"Development tools\"安装配置 dashboardcd /opt/local/open-falcongit clone https://github.com/open-falcon/dashboard.gitcd dashboard# 创建 python 独立运行环境virtualenv ./env# 安装 python 依赖模块# 执行安装./env/bin/pip install -r pip_requirements.txt -i http://mirrors.aliyun.com/pypi/simple/# 修改配置# 修改里面的 mysql 配置rrd/config.pyALARM_DB_PASS启动 dashboard# debug 模式./env/bin/python wsgi.py# 正常模式bash control start# 查看日志bash control tail 登陆 WEB UIhttp://172.16.1.100:8081/注册  root 帐号  为 admin 帐号监控报警配置 报警名单# 首先配置 用户组dashboard --&gt; Welcome root --&gt;  Teams Add+  -- &gt; Create Team# 创建一个 ICT 组名称: ICT简介: 运维组成员: root配置 nodata 监控 agent# 创建 HostGropdashboard --&gt; HostGroups添加一个名称 dev-server 的 HostGroups点击 hosts -- &gt; Add Host  添加  dev 相关服务器 # 创建 nodata# 监控 client 的 agent ,如果 agent 掉了, 那么无法上传数据,所以直接配置模板是不行的, 必须配置 nodata 在 agent 抓不到数据的时候 值为 -1 . dashboard --&gt; nodataAdd nodataname: nodata.agentendpoint选择:   机器分组  ---  dev-servermetric: agent.alivetype: GAUGE周期: 60数据上报中断时,补发如下值: -1# 创建 策略配置dashboard --&gt; Templates创建一个 名称为 agent-alive 的模板# 模板基础信息:name: agent-alive模板策略列表:metric: agent.alive   note: 无法连接agentif [all(#3)] &lt; 0 : alarm(); callback();save 保存# 模板报警配置:之前设置的 ICT# Save# 绑定 模板dashboard --&gt; HostGroups查找  dev-server   点击  templates查找  agent-alive   选择 + Bind# 测试关闭一个 agent 的进程等待60秒 查看 Alarm-Dashboard等待收取邮件~配置 系统监控指标dashboard --&gt; TemplatesAdd 添加一个 系统指标模块监控指标如下:FAQ修改 报警模板cd open-falcon/falcon-plus/modules/alarm/cron# 报警内容:cat builder.gopackage cronimport (        \"fmt\"        \"github.com/open-falcon/falcon-plus/common/model\"        \"github.com/open-falcon/falcon-plus/common/utils\"        \"github.com/open-falcon/falcon-plus/modules/alarm/g\")func BuildCommonSMSContent(event *model.Event) string {        return fmt.Sprintf(                \"[P%d][%s][%s][][%s %s %s %s %s%s%s][O%d %s]\",                event.Priority(),                event.Status,                event.Endpoint,                event.Note(),                event.Func(),                event.Metric(),                utils.SortedTags(event.PushedTags),                utils.ReadableFloat(event.LeftValue),                event.Operator(),                utils.ReadableFloat(event.RightValue()),                event.CurrentStep,                event.FormattedTime(),        )}func BuildCommonIMContent(event *model.Event) string {        return fmt.Sprintf(                \"[报警级别: %d][报警状态: %s][报警Host: %s][报警内容: %s][报警时间: %s]\",                event.Priority(),                event.Status,                event.Endpoint,                event.Note(),                //event.Func(),                //event.Metric(),                //utils.SortedTags(event.PushedTags),                //utils.ReadableFloat(event.LeftValue),                //event.Operator(),                //utils.ReadableFloat(event.RightValue()),                //event.CurrentStep,                event.FormattedTime(),        )}func BuildCommonMailContent(event *model.Event) string {        link := g.Link(event)        return fmt.Sprintf(                \"报警状态: %s\r\n报警级别: %d\r\n报警Host: %s\r\n报警事件: %s\r\n事件标签: %s\r\n报警表达式: %s: %s%s%s\r\n报警内容: %s\r\n最大报警次数: %d   当前报警次数: %d\r\n报警时间: %s\r\n报警模板: %s\r\n\",                event.Status,                event.Priority(),                event.Endpoint,                event.Metric(),                utils.SortedTags(event.PushedTags),                event.Func(),                utils.ReadableFloat(event.LeftValue),                event.Operator(),                utils.ReadableFloat(event.RightValue()),                event.Note(),                event.MaxStep(),                event.CurrentStep,                event.FormattedTime(),                link,        )}func GenerateSmsContent(event *model.Event) string {        return BuildCommonSMSContent(event)}func GenerateMailContent(event *model.Event) string {        return BuildCommonMailContent(event)}func GenerateIMContent(event *model.Event) string {        return BuildCommonIMContent(event)}"
                        } ,

Error on gem build type-on-strap.gemspec

When updating the files to build the gem for #9 I encountered some issue:

WARNING:  See http://guides.rubygems.org/specification-reference/ for help
ERROR:  While executing gem ... (Gem::InvalidSpecificationException)
    ["_sass/type-theme.scss"] are not files

However I had replaced type-theme.scss by type-on-strap.scss on all necessary files. In my gemspec, I put as the files specification:

  spec.files         = `git ls-files -z`.split("\x0").select { |f| 
f.match(%r{^(assets|_layouts|_includes|_sass|LICENSE|README)}i) }

Update Documentation

The actual documentation is from the type-theme template, that type on strap is based on. It is quite good, but I would like to start from fresh:

  • keeping the basic necessary adding a link toward type-theme's documentation
  • Adding documentation of the new features
  • Change the presentation pictures

Then I'll be able to expand to a more complete modification like jekyll basic

Disqus can not be enable ?

Thanks for this template very much.
I have build my Github Pages blog by using this template, but even I fill in the "disqus_shotname" Disqus can not load.

Search does not work correctly

If I try the search, it totally does not behave as expected. For instance, I can type in words that do not exist, but it shows me a lot of posts, anyway. It looks like the search goes character by character.

If I type in aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa i can narrow down the result to one post, If I type in xxxxxxxxxxxxxxxxxxx I get now result, since there a no posts with that many x.

Optimizing images

This issue raised by the GTMetrics #6 is to mainly reduce the size of the jpeg images for it to be more web oriented.
There a couple of ways to improve the size of the images depending on the usage. In my case I can't just transform the "decorative" pictures into .gif or .svg because I would lose too much quality

If portfolio is disabled, it disables search and tags too

Hello,
First of all, congratulations for the theme, in my opinion, one of the bests for Jekyll.
In _includes -> navbar.html there is the same if condition
{% if site.theme_settings.portfolio %}
for portfolio, search and tags so disabling portfolio the others don't appear either

Rewrite portfolio to use flexbox

Remove the bootstrap part from portfolio and use flexbox to do the 3x3 layout. As mentioned in #74 in order to remove the vendor dependencies that are not absolutely needed in the theme.

KateX not loading math

The KateX package is not working properly at the moment. I have looked through your blog post on markdown and html which has some math to be displayed but it is just being ignored when the site is produced. This same issue is happening to me on my blog. I am not sure what is being done in the KateX java script files but the issue is probably there.

Build error on github pages: Liquid Exception: no implicit conversion of nil into String

So I have a rather generic build fail error on my gh-pages. However everything is working fine on the local host. So it means github fails to build the site, a bummer for a template ...

Here is the error message I got from github:

Liquid Exception: no implicit conversion of nil into String in /_layouts/page.html
           Fatal: TypeError
                    no implicit conversion of nil into String

It seems something is wrong either in my page.html or my _layout folder.

search not working

Sources - Snippets - index to error

                        {
                          "title"    : "Open-Falcon 监控",
                          "category" : "",
                          "tags"     : " ",
                          "url"      : "/linux/2017/08/18/Open-Falcon.html",
                          "date"     : "August 18, 2017",
                          "excerpt"  : "环境准备  官方文档 https://book.open-falcon.org/zh_0_2安装 golangwget https://storage.googleapis.com/golang/go1.6.4.linux-amd64.tar.gztar zxvf go1.6.4.linux-amd64.tar.gzmv go /opt/local/# 增加环境变量vi /etc/profile# Golang ENVexport GOROOT=/opt/local/goexport PA...",
                          "content"  : "环境准备  官方文档 https://book.open-falcon.org/zh_0_2安装 golangwget https://storage.googleapis.com/golang/go1.6.4.linux-amd64.tar.gztar zxvf go1.6.4.linux-amd64.tar.gzmv go /opt/local/# 增加环境变量vi /etc/profile# Golang ENVexport GOROOT=/opt/local/goexport PATH=$PATH:$GOROOT/binexport GOPATH=/opt/local/golanggo versiongo version go1.6.4 linux/amd64安装 Mysql 5.7# 初始化依赖yum -y install cmake ncurses ncurses-devel bison bison-devel boost boost-devel# 创建 mysql 用户以及相关目录/usr/sbin/groupadd mysql/usr/sbin/useradd -g mysql mysqlmkdir -p /opt/local/mysql/datamkdir -p /opt/local/mysql/binlogmkdir -p  /opt/local/mysql/logsmkdir -p /opt/local/mysql/relaylogmkdir -p /var/lib/mysqlmkdir -p /opt/local/mysql/etc# 下载 源码包wget ftp://ftp.mirrorservice.org/sites/ftp.mysql.com/Downloads/MySQL-5.7/mysql-5.7.19.tar.gztar zxvf mysql-5.7.19.tar.gzcd mysql-5.7.19cmake -DCMAKE_INSTALL_PREFIX=\"/opt/local/mysql\" -DDEFAULT_CHARSET=utf8 \-DMYSQL_DATADIR=\"/opt/local/mysql/data/\" -DCMAKE_INSTALL_PREFIX=\"/opt/local/mysql\" \-DINSTALL_PLUGINDIR=plugin -DWITH_INNOBASE_STORAGE_ENGINE=1 -DDEFAULT_COLLATION=utf8_general_ci \-DENABLED_LOCAL_INFILE=1 -DENABLED_PROFILING=1 -DWITH_ZLIB=system \-DWITH_EXTRA_CHARSETS=none -DMYSQL_MAINTAINER_MODE=OFF -DEXTRA_CHARSETS=all \-DWITH_PERFSCHEMA_STORAGE_ENGINE=1 -DWITH_MYISAM_STORAGE_ENGINE=1 \-DDOWNLOAD_BOOST=1 -DWITH_BOOST=/usr/local/boostmake -j `cat /proc/cpuinfo | grep processor| wc -l`make install# 创建相关目录,授权chmod +w /opt/local/mysqlchown -R mysql:mysql /opt/local/mysqlchmod +w /var/lib/mysqlchown -R mysql:mysql /var/lib/mysqlcp /opt/local/mysql/support-files/mysql.server  /etc/init.d/mysqldchmod 755 /etc/init.d/mysqldecho 'basedir=/opt/local/mysql/' &gt;&gt; /etc/init.d/mysqldecho 'datadir=/opt/local/mysql/data' &gt;&gt;/etc/init.d/mysqld# 创建关联ln -s /opt/local/mysql/lib/mysql /usr/lib/mysqlln -s /opt/local/mysql/include/mysql /usr/include/mysqlln -s /opt/local/mysql/bin/mysql /usr/bin/mysqlln -s /opt/local/mysql/bin/mysqldump /usr/bin/mysqldumpln -s /opt/local/mysql/bin/myisamchk /usr/bin/myisamchkln -s /opt/local/mysql/bin/mysqld_safe /usr/bin/mysqld_safeln -s /tmp/mysql.sock /var/lib/mysql/mysql.sock# 初始化数据库vi /opt/local/mysql/etc/my.cnf[client]default-character-set=utf8mb4[mysqld]########basic settings########server-id = 1port = 3306user = mysqlbind_address = 127.0.0.1autocommit = 1character_set_server=utf8mb4collation-server=utf8mb4_unicode_ciskip-character-set-client-handshakeinit_connect='SET collation_connection = utf8mb4_unicode_ci'init_connect='SET NAMES utf8mb4'skip_name_resolve = 1max_connections = 800max_connect_errors = 1000datadir = /opt/local/mysql/datapid-file = /opt/local/mysql/mysql.pidtransaction_isolation = READ-COMMITTEDexplicit_defaults_for_timestamp = 1join_buffer_size = 134217728tmp_table_size = 67108864tmpdir = /tmpmax_allowed_packet = 16777216sql_mode = \"STRICT_TRANS_TABLES,NO_ENGINE_SUBSTITUTION,NO_ZERO_DATE,NO_ZERO_IN_DATE,ERROR_FOR_DIVISION_BY_ZERO,NO_AUTO_CREATE_USER\"interactive_timeout = 1800wait_timeout = 1800read_buffer_size = 16777216read_rnd_buffer_size = 33554432sort_buffer_size = 33554432########log settings########log_error = /opt/local/mysql/logs/mysqld.logslow_query_log = 1slow_query_log_file = /opt/local/mysql/logs/slow.loglog_queries_not_using_indexes = 1log_slow_admin_statements = 1log_slow_slave_statements = 1log_throttle_queries_not_using_indexes = 10expire_logs_days = 90long_query_time = 2min_examined_row_limit = 100########replication settings########master_info_repository = TABLErelay_log_info_repository = TABLElog_bin = /opt/local/mysql/binlog/mysql-binsync_binlog = 1gtid_mode = onenforce_gtid_consistency = 1log_slave_updatesbinlog_format = rowrelay_log = /opt/local/mysql/relaylog/relay-binrelay_log_recovery = 1binlog_gtid_simple_recovery = 1slave_skip_errors = ddl_exist_errors########innodb settings########innodb_page_size = 16384innodb_buffer_pool_size = 8Ginnodb_buffer_pool_instances = 8innodb_buffer_pool_load_at_startup = 1innodb_buffer_pool_dump_at_shutdown = 1innodb_lru_scan_depth = 2000innodb_lock_wait_timeout = 5innodb_io_capacity = 4000innodb_io_capacity_max = 8000innodb_flush_method = O_DIRECTinnodb_file_format = Barracudainnodb_file_format_max = Barracudainnodb_log_group_home_dir = /opt/local/mysql/relayloginnodb_undo_directory = /opt/local/mysql/binloginnodb_undo_logs = 128innodb_undo_tablespaces = 3innodb_flush_neighbors = 1innodb_log_file_size = 4Ginnodb_log_buffer_size = 16777216innodb_purge_threads = 4innodb_large_prefix = 1innodb_thread_concurrency = 64innodb_print_all_deadlocks = 1innodb_strict_mode = 1innodb_sort_buffer_size = 67108864############mysql 5.7 ##################innodb_buffer_pool_dump_pct = 40innodb_page_cleaners = 4innodb_undo_log_truncate = 1innodb_max_undo_log_size = 2Ginnodb_purge_rseg_truncate_frequency = 128binlog_gtid_simple_recovery=1log_timestamps=systemtransaction_write_set_extraction=MURMUR32show_compatibility_56=on########semi sync replication settings#########plugin_dir=/opt/local/mysql/lib/plugin#plugin_load = \"rpl_semi_sync_master=semisync_master.so;rpl_semi_sync_slave=semisync_slave.so\"#loose_rpl_semi_sync_master_enabled = 1#loose_rpl_semi_sync_slave_enabled = 1#loose_rpl_semi_sync_master_timeout = 5000rm -rf /etc/my.cnfcd /opt/local/mysql/bin//opt/local/mysql/bin/mysqld --initialize --user=mysql --basedir=/opt/local/mysql --datadir=/opt/local/mysql/data# 查看 mysql 密码cat /opt/local/mysql/logs/mysqld.log |grep password# 启动 mysqlservice mysqld startchkconfig mysqld on# 设置安全配置/opt/local/mysql/bin/mysql_secure_installation -uroot -p# 登陆 mysqlmysql -uroot -p安装 redis# 下载 rediswget http://download.redis.io/releases/redis-3.2.10.tar.gztar zxvf redis-3.2.10.tar.gz cd redis-3.2.10makemake installcd  utils./install_server.sh...... 输入相关信息 ......cd /etc/init.d/mv redis_6379  redis# 创建 目录mkdir -p /opt/local/redis/{data,logs,conf}cd /opt/local/redis/confvi redis.confbind 127.0.0.1protected-mode yesport 6379tcp-backlog 2048timeout 0tcp-keepalive 300daemonize yessupervised nopidfile /var/run/redis.pidloglevel noticelogfile \"/opt/local/redis/logs/redis.log\"maxmemory 10gbdatabases 16save 900 1save 300 10save 60 10000stop-writes-on-bgsave-error yesrdbcompression yesrdbchecksum yesdbfilename redis_dump.rdbdir /opt/local/redis/dataslave-serve-stale-data yesslave-read-only yesrepl-diskless-sync norepl-diskless-sync-delay 5repl-disable-tcp-nodelay noslave-priority 100appendonly noappendfilename \"appendonly.aof\"appendfsync everysecno-appendfsync-on-rewrite noauto-aof-rewrite-percentage 100auto-aof-rewrite-min-size 64mbaof-load-truncated yeslua-time-limit 5000slowlog-log-slower-than 10000slowlog-max-len 128latency-monitor-threshold 0notify-keyspace-events \"\"hash-max-ziplist-entries 512hash-max-ziplist-value 64list-max-ziplist-size -2list-compress-depth 0set-max-intset-entries 512zset-max-ziplist-entries 128zset-max-ziplist-value 64hll-sparse-max-bytes 3000activerehashing yesclient-output-buffer-limit normal 0 0 0client-output-buffer-limit slave 256mb 64mb 60client-output-buffer-limit pubsub 32mb 8mb 60hz 10aof-rewrite-incremental-fsync yes# 启动 redischkconfig redis onservice redis start配置 Open-Falcon初始化环境mkdir -p $GOPATH/src/github.com/open-falconcd $GOPATH/src/github.com/open-falcongit clone https://github.com/open-falcon/falcon-plus.git导入数据库cd $GOPATH/src/github.com/open-falcon/falcon-plus/scripts/mysql/db_schema/mysql -u root -p &lt; 1_uic-db-schema.sqlmysql -u root -p &lt; 2_portal-db-schema.sqlmysql -u root -p &lt; 3_dashboard-db-schema.sqlmysql -u root -p &lt; 4_graph-db-schema.sqlmysql -u root -p &lt; 5_alarms-db-schema.sql编译 程序cd $GOPATH/src/github.com/open-falcon/falcon-plus/# 编译所有的模块make all# 编译指定模块make agent# 打包make pack# 创建目录mkdir /opt/local/open-falconmv open-falcon-v0.2.1.tar.gz /opt/local/open-falconcd /opt/local/open-falcontar zxvf open-falcon-v0.2.1.tar.gz [root@localhost open-falcon]# lsagent  aggregator  alarm  api  gateway  graph  hbs  judge  nodata  open-falcon  plugins  public  transfer配置 Transfer  transfer是数据转发服务。它接收agent上报的数据,然后按照哈希规则进行数据分片、并将分片后的数据分别push给graph&amp;judge等组件。cd /opt/local/open-falcon/transfer/configvi cfg.json{    \"debug\": true,    \"minStep\": 30,    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6060\"    },    \"rpc\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:8433\"    },    \"socket\": {        \"enabled\": false,        \"listen\": \"0.0.0.0:4444\",        \"timeout\": 3600    },    \"judge\": {        \"enabled\": true,        \"batch\": 200,        \"connTimeout\": 1000,        \"callTimeout\": 5000,        \"maxConns\": 32,        \"maxIdle\": 32,        \"replicas\": 500,        \"cluster\": {            \"judge-00\" : \"127.0.0.1:6080\"        }    },    \"graph\": {        \"enabled\": true,        \"batch\": 200,        \"connTimeout\": 1000,        \"callTimeout\": 5000,        \"maxConns\": 32,        \"maxIdle\": 32,        \"replicas\": 500,        \"cluster\": {            \"graph-00\" : \"127.0.0.1:6070\"        }    },    \"tsdb\": {        \"enabled\": false,        \"batch\": 200,        \"connTimeout\": 1000,        \"callTimeout\": 5000,        \"maxConns\": 32,        \"maxIdle\": 32,        \"retry\": 3,        \"address\": \"127.0.0.1:8088\"    }}配置 Graph  graph是存储绘图数据的组件。graph组件 接收transfer组件推送上来的监控数据,同时处理api组件的查询请求、返回绘图数据。# 创建数据 目录mkdir -p /opt/data/6070cd /opt/local/open-falcon/graph/configvi cfg.json{    \"debug\": false,    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6071\"    },    \"rpc\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6070\"    },    \"rrd\": {        \"storage\": \"/opt/data/6070\"    },    \"db\": {        \"dsn\": \"root:123456@tcp(127.0.0.1:3306)/graph?loc=Local&amp;parseTime=true\",        \"maxIdle\": 4    },    \"callTimeout\": 5000,    \"migrate\": {            \"enabled\": false,            \"concurrency\": 2,            \"replicas\": 500,            \"cluster\": {                    \"graph-00\" : \"127.0.0.1:6070\"            }    }}配置 Api 组件  api组件,提供统一的restAPI操作接口。比如:api组件接收查询请求,根据一致性哈希算法去相应的graph实例查询不同metric的数据,然后汇总拿到的数据,最后统一返回给用户。cd /opt/local/open-falcon/api/configvi cfg.json # 主要修改 \"salt\": \"\" 为加密字串{        \"log_level\": \"debug\",        \"db\": {                \"falcon_portal\": \"root:123456@tcp(127.0.0.1:3306)/falcon_portal?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"graph\": \"root:123456@tcp(127.0.0.1:3306)/graph?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"uic\": \"root:123456@tcp(127.0.0.1:3306)/uic?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"dashboard\": \"root:123456@tcp(127.0.0.1:3306)/dashboard?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"alarms\": \"root:123456@tcp(127.0.0.1:3306)/alarms?charset=utf8&amp;parseTime=True&amp;loc=Local\",                \"db_bug\": true        },        \"graphs\": {                \"cluster\": {                        \"graph-00\": \"127.0.0.1:6070\"                },                \"max_conns\": 100,                \"max_idle\": 100,                \"conn_timeout\": 1000,                \"call_timeout\": 5000,                \"numberOfReplicas\": 500        },        \"metric_list_file\": \"./api/data/metric\",        \"web_port\": \"0.0.0.0:8080\",        \"access_control\": true,        \"signup_disable\": false,        \"salt\": \"pleaseinputwhichyouareusingnow\",        \"skip_auth\": false,        \"default_token\": \"default-token-used-in-server-side\",        \"gen_doc\": false,        \"gen_doc_path\": \"doc/module.html\"}部署 Heartbeat 服务  心跳服务器,所有agent都会连到HBS,每分钟发一次心跳请求。cd /opt/local/open-falcon/hbs/configvi cfg.json{    \"debug\": true,    \"database\": \"root:123456@tcp(127.0.0.1:3306)/falcon_portal?loc=Local&amp;parseTime=true\",    \"hosts\": \"\",    \"maxConns\": 20,    \"maxIdle\": 15,    \"listen\": \":6030\",    \"trustable\": [\"\"],    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6031\"    }}部署 Judge 服务  Judge用于告警判断,agent将数据push给Transfer,Transfer不但会转发给Graph组件来绘图,还会转发给Judge用于判断是否触发告警。cd /opt/local/open-falcon/judge/configvi cfg.json{    \"debug\": true,    \"debugHost\": \"nil\",    \"remain\": 11,    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6081\"    },    \"rpc\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6080\"    },    \"hbs\": {        \"servers\": [\"127.0.0.1:6030\"],        \"timeout\": 300,        \"interval\": 60    },    \"alarm\": {        \"enabled\": true,        \"minInterval\": 300,        \"queuePattern\": \"event:p%v\",        \"redis\": {            \"dsn\": \"127.0.0.1:6379\",            \"maxIdle\": 5,            \"connTimeout\": 5000,            \"readTimeout\": 5000,            \"writeTimeout\": 5000        }    }}部署一个 mail 服务  发送警告邮件需要部署一个 mail 服务  用于发送邮件, 这里边部署一个简单的 mail-provider 地址 https://github.com/zzlyzq/mail-provider# 下载 依赖模块cd /opt/local/golang/src/github.com/open-falcongit clone https://github.com/zzlyzq/mail-providercd /opt/local/golang/src/github.com/open-falcon/mail-provider# 下载依赖go get ./control build (编译)./control pack (打包)mkdir /opt/local/open-falcon/mail-providermv falcon-mail-provider-0.0.1.tar.gz /opt/local/open-falcon/mail-providercd /opt/local/open-falcon/mail-providertar zxvf falcon-mail-provider-0.0.1.tar.gz# 修改配置文件 里的 smtp 为自己的地址# QQ邮箱,请开启 smtp 的功能,在QQ邮箱后台开启vi cfg.json{    \"debug\": true,    \"http\": {        \"listen\": \"0.0.0.0:4000\",        \"token\": \"\"    },    \"smtp\": {        \"addr\": \"smtp.qq.com:587\",        \"username\": \"[email protected]\",        \"password\": \"123456\",        \"from\": \"[email protected]\"    }}# 运行程序./control start# 查看日志./control tail# 测试, 在测试时 token 暂时设置为空curl http://127.0.0.1:4000/sender/mail -d \"[email protected]&amp;subject=xx&amp;content=yy\"部署一个 微信网关  微信网关 git  https://github.com/Yanjunhui/chatcd /opt/local/open-falcongit clone https://github.com/Yanjunhui/chatcd chat/chmod +x control.sh# 需要修改 配置文件cat config.conf#http 服务端口[http]port = 4567#微信接口信息[weixin]CorpID = ww6424d33203e90e20AgentId = 1000002Secret = FoST_8RQSTjZwH_CN3aQW6UKksjCSI9mizFqD7HKhrwEncodingAESKey = K2M3WMhRHIOH4I1Ww5jxpllGrgY01nvBjUgTvcJEEHX# 启动./control.sh start./control.sh status## 注意: 要收到 im 报警信息,必须要在 个人用户里面 填写 微信相关资料微信相关帐号是  登陆微信公众号 --&gt; 通讯里, 里面用户的 帐号不是个人微信帐号,填写个人帐号,是收不到报警的。部署 Alarm 服务  alarm模块是处理报警event的,judge产生的报警event写入redis,alarm从redis读取处理,并进行不同渠道的发送。cd /opt/local/open-falcon/alarm/configvi cfg.json{    \"log_level\": \"debug\",    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:9912\"    },    \"redis\": {        \"addr\": \"127.0.0.1:6379\",        \"maxIdle\": 5,        \"highQueues\": [            \"event:p0\",            \"event:p1\",            \"event:p2\"        ],        \"lowQueues\": [            \"event:p3\",            \"event:p4\",            \"event:p5\",            \"event:p6\"        ],        \"userIMQueue\": \"/queue/user/im\",        \"userSmsQueue\": \"/queue/user/sms\",        \"userMailQueue\": \"/queue/user/mail\"    },    \"api\": {        \"im\": \"http://127.0.0.1:4567/send\",        \"sms\": \"http://127.0.0.1:10086/sms\",        \"mail\": \"http://127.0.0.1:4000/sender/mail\",        \"dashboard\": \"http://127.0.0.1:8081\",        \"plus_api\":\"http://127.0.0.1:8080\",        \"plus_api_token\": \"default-token-used-in-server-side\"    },    \"falcon_portal\": {        \"addr\": \"root:123456@tcp(127.0.0.1:3306)/alarms?charset=utf8&amp;loc=Asia%2FChongqing\",        \"idle\": 10,        \"max\": 100    },    \"worker\": {        \"im\": 10,        \"sms\": 10,        \"mail\": 50    },    \"housekeeper\": {        \"event_retention_days\": 7,        \"event_delete_batch\": 100    }}配置 Nodata 服务  nodata用于检测监控数据的上报异常。nodata和实时报警judge模块协同工作,过程为: 配置了nodata的采集项超时未上报数据,nodata生成一条默认的模拟数据;用户配置相应的报警策略,收到mock数据就产生报警。采集项上报异常检测,作为judge模块的一个必要补充,能够使judge的实时报警功能更加可靠、完善。cd /opt/local/open-falcon/nodata/configvi cfg.json {    \"debug\": true,    \"http\": {        \"enabled\": true,        \"listen\": \"0.0.0.0:6090\"    },    \"plus_api\":{        \"connectTimeout\": 500,        \"requestTimeout\": 2000,        \"addr\": \"http://127.0.0.1:8080\",        \"token\": \"default-token-used-in-server-side\"    },    \"config\": {        \"enabled\": true,        \"dsn\": \"root:123456@tcp(127.0.0.1:3306)/falcon_portal?loc=Local&amp;parseTime=true&amp;wait_timeout=604800\",        \"maxIdle\": 4    },    \"collector\":{        \"enabled\": true,        \"batch\": 200,        \"concurrent\": 10    },    \"sender\":{        \"enabled\": true,        \"connectTimeout\": 500,        \"requestTimeout\": 2000,        \"transferAddr\": \"127.0.0.1:6060\",        \"batch\": 500    }}配置 Aggregator 服务  集群聚合模块。聚合某集群下的所有机器的某个指标的值,提供一种集群视角的监控体验。cd /opt/local/open-falcon/aggregator/configvi cfg.json{    \"debug\": true,    \"http\": {        \"enabled\": false,        \"listen\": \"0.0.0.0:6055\"    },    \"database\": {        \"addr\": \"root:123456@tcp(127.0.0.1:3306)/falcon_portal?loc=Local&amp;parseTime=true\",        \"idle\": 10,        \"ids\": [1, -1],        \"interval\": 55    },    \"api\": {        \"connect_timeout\": 500,        \"request_timeout\": 2000,        \"plus_api\": \"http://127.0.0.1:8080\",        \"plus_api_token\": \"default-token-used-in-server-side\",        \"push_api\": \"http://127.0.0.1:1988/v1/push\"    }}启动所有服务cd /opt/local/open-falcon./open-falcon start./open-falcon check        falcon-graph         UP           71646           falcon-hbs         UP           71658         falcon-judge         UP           71670      falcon-transfer         UP           71678        falcon-nodata         UP           71686    falcon-aggregator         UP           71695         falcon-agent         UP           71706       falcon-gateway         UP           71715           falcon-api         UP           71724         falcon-alarm         UP           71738 配置 Agent  agent用于采集机器负载监控指标,比如cpu.idle、load.1min、disk.io.util等等,每隔60秒push给Transfer。agent与Transfer建立了长连接,数据发送速度比较快,agent提供了一个http接口/v1/push用于接收用户手工push的一些数据,然后通过长连接迅速转发给Transfer。cd /opt/local/open-falcon/agent/config# Agent 配置文件{    \"debug\": true,    \"hostname\": \"\",    \"ip\": \"\",    \"plugin\": {        \"enabled\": false,        \"dir\": \"./plugin\",        \"git\": \"https://github.com/open-falcon/plugin.git\",        \"logs\": \"./logs\"    },    \"heartbeat\": {        \"enabled\": true,        \"addr\": \"127.0.0.1:6030\",        \"interval\": 60,        \"timeout\": 1000    },    \"transfer\": {        \"enabled\": true,        \"addrs\": [            \"127.0.0.1:8433\"        ],        \"interval\": 60,        \"timeout\": 1000    },    \"http\": {        \"enabled\": false,        \"listen\": \":1988\",        \"backdoor\": false    },    \"collector\": {        \"ifacePrefix\": [\"eth\", \"em\"],        \"mountPoint\": []    },    \"default_tags\": {    },    \"ignore\": {        \"cpu.busy\": true,        \"df.bytes.free\": true,        \"df.bytes.total\": true,        \"df.bytes.used\": true,        \"df.bytes.used.percent\": true,        \"df.inodes.total\": true,        \"df.inodes.free\": true,        \"df.inodes.used\": true,        \"df.inodes.used.percent\": true,        \"mem.memtotal\": true,        \"mem.memused\": true,        \"mem.memused.percent\": true,        \"mem.memfree\": true,        \"mem.swaptotal\": true,        \"mem.swapused\": true,        \"mem.swapfree\": true    }}# agent 脚本  添加 hostname = IP#!/bin/bashmkdir /opt/localcd /opt/localwget http://172.16.1.100/agent.tar.gztar zxvf agent.tar.gzrm -rf agent.tar.gzIPADDR=`ifconfig em1|grep inet|grep -v 127.0.0.1|grep -v inet6|awk '{print $2}'|tr -d \"addr:\"`sed -i 's/\\"hostname\\"\:.*$/\\"hostname\\"\: \\"'$IPADDR'\\"\,/g' open-falcon/agent/config/cfg.jsoncat open-falcon/agent/config/cfg.jsoncd open-falcon./open-falcon start agent./open-falcon check agent配置前端 dashboard初始化依赖yum install -y python-virtualenvyum install -y python-develyum install -y openldap-develyum install -y mysql-develyum groupinstall \"Development tools\"安装配置 dashboardcd /opt/local/open-falcongit clone https://github.com/open-falcon/dashboard.gitcd dashboard# 创建 python 独立运行环境virtualenv ./env# 安装 python 依赖模块# 执行安装./env/bin/pip install -r pip_requirements.txt -i http://mirrors.aliyun.com/pypi/simple/# 修改配置# 修改里面的 mysql 配置rrd/config.pyALARM_DB_PASS启动 dashboard# debug 模式./env/bin/python wsgi.py# 正常模式bash control start# 查看日志bash control tail 登陆 WEB UIhttp://172.16.1.100:8081/注册  root 帐号  为 admin 帐号监控报警配置 报警名单# 首先配置 用户组dashboard --&gt; Welcome root --&gt;  Teams Add+  -- &gt; Create Team# 创建一个 ICT 组名称: ICT简介: 运维组成员: root配置 nodata 监控 agent# 创建 HostGropdashboard --&gt; HostGroups添加一个名称 dev-server 的 HostGroups点击 hosts -- &gt; Add Host  添加  dev 相关服务器 # 创建 nodata# 监控 client 的 agent ,如果 agent 掉了, 那么无法上传数据,所以直接配置模板是不行的, 必须配置 nodata 在 agent 抓不到数据的时候 值为 -1 . dashboard --&gt; nodataAdd nodataname: nodata.agentendpoint选择:   机器分组  ---  dev-servermetric: agent.alivetype: GAUGE周期: 60数据上报中断时,补发如下值: -1# 创建 策略配置dashboard --&gt; Templates创建一个 名称为 agent-alive 的模板# 模板基础信息:name: agent-alive模板策略列表:metric: agent.alive   note: 无法连接agentif [all(#3)] &lt; 0 : alarm(); callback();save 保存# 模板报警配置:之前设置的 ICT# Save# 绑定 模板dashboard --&gt; HostGroups查找  dev-server   点击  templates查找  agent-alive   选择 + Bind# 测试关闭一个 agent 的进程等待60秒 查看 Alarm-Dashboard等待收取邮件~配置 系统监控指标dashboard --&gt; TemplatesAdd 添加一个 系统指标模块监控指标如下:FAQ修改 报警模板cd open-falcon/falcon-plus/modules/alarm/cron# 报警内容:cat builder.gopackage cronimport (        \"fmt\"        \"github.com/open-falcon/falcon-plus/common/model\"        \"github.com/open-falcon/falcon-plus/common/utils\"        \"github.com/open-falcon/falcon-plus/modules/alarm/g\")func BuildCommonSMSContent(event *model.Event) string {        return fmt.Sprintf(                \"[P%d][%s][%s][][%s %s %s %s %s%s%s][O%d %s]\",                event.Priority(),                event.Status,                event.Endpoint,                event.Note(),                event.Func(),                event.Metric(),                utils.SortedTags(event.PushedTags),                utils.ReadableFloat(event.LeftValue),                event.Operator(),                utils.ReadableFloat(event.RightValue()),                event.CurrentStep,                event.FormattedTime(),        )}func BuildCommonIMContent(event *model.Event) string {        return fmt.Sprintf(                \"[报警级别: %d][报警状态: %s][报警Host: %s][报警内容: %s][报警时间: %s]\",                event.Priority(),                event.Status,                event.Endpoint,                event.Note(),                //event.Func(),                //event.Metric(),                //utils.SortedTags(event.PushedTags),                //utils.ReadableFloat(event.LeftValue),                //event.Operator(),                //utils.ReadableFloat(event.RightValue()),                //event.CurrentStep,                event.FormattedTime(),        )}func BuildCommonMailContent(event *model.Event) string {        link := g.Link(event)        return fmt.Sprintf(                \"报警状态: %s\r\n报警级别: %d\r\n报警Host: %s\r\n报警事件: %s\r\n事件标签: %s\r\n报警表达式: %s: %s%s%s\r\n报警内容: %s\r\n最大报警次数: %d   当前报警次数: %d\r\n报警时间: %s\r\n报警模板: %s\r\n\",                event.Status,                event.Priority(),                event.Endpoint,                event.Metric(),                utils.SortedTags(event.PushedTags),                event.Func(),                utils.ReadableFloat(event.LeftValue),                event.Operator(),                utils.ReadableFloat(event.RightValue()),                event.Note(),                event.MaxStep(),                event.CurrentStep,                event.FormattedTime(),                link,        )}func GenerateSmsContent(event *model.Event) string {        return BuildCommonSMSContent(event)}func GenerateMailContent(event *model.Event) string {        return BuildCommonMailContent(event)}func GenerateIMContent(event *model.Event) string {        return BuildCommonIMContent(event)}"
                        } ,


my post 

https://github.com/jicki/jicki.github.io/blob/master/_posts/2017-08-18-Open-Falcon.md

Serve scale images

This is linked to issue #6 to enhance the template;
But creating a scale thumbmail for the blog page might cause bugs in the "retro zoom" when your mouse hover it.
I guess it is to minimize the loading of images bigger if they get then resized.

With html:

<a target="_blank" href="img_forest.jpg">
  <img src="img_forest.jpg" alt="Forest">
</a>

ERROR installing Jekyll: Failed to build gem native extension

I am having some difficulty installing jekyll.
I have version:

 gem v2.5.2
 ruby v2.3.3

I am trying to run sudo gem install jekyll

The error I am receiving is

ERROR:  Error installing jekyll:
	ERROR: Failed to build gem native extension.

    current directory: /Library/Ruby/Gems/2.3.0/gems/http_parser.rb-0.6.0/ext/ruby_http_parser
/System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/bin/ruby -r ./siteconf20180307-18103-4ueyyk.rb extconf.rb
mkmf.rb can't find header files for ruby at /System/Library/Frameworks/Ruby.framework/Versions/2.3/usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /Library/Ruby/Gems/2.3.0/gems/http_parser.rb-0.6.0 for inspection.
Results logged to /Library/Ruby/Gems/2.3.0/extensions/universal-darwin-17/2.3.0/http_parser.rb-0.6.0/gem_make.out

I have tried to run the development packages

sudo apt-get install ruby-dev
sudo yum ruby-devel

errors

sudo: apt-get: command not found
sudo: yum: command not found

Any help would be appreciated. Thanks!

Search breaks when there are double quotes inside {% highlight terminal %}

Hello, search breaks when there are double quotes inside {% highlight terminal %}. I supose it will break search in other highlights too
For example:

{% highlight terminal %}
...
Init4 = AT+CGDCONT=1,"IP","internetmas","",0,0
...
{% endhighlight %}

breaks it.
To fix it, you could change post and portfolio content search in _layouts -> search.hml
from
"content" : "{{ post.content | strip_html | strip_newlines }}"
to
"content" : "{{ post.content | strip_html | strip_newlines | replace: '"', '\\"' }}"

Thanks

Setting post_navigation: true results in syntax error

if I set post_navigation: true in _config.yml, I get the followin error when starting jekyll:

Liquid Exception: Liquid syntax error (/home/projects/test/_includes/post_nav.html line 20): Unknown tag 'endif' included in /_layouts/post.html

Links pointing to localhost

Some links are pointing to localhost:4000 even though I've set the actual address of the Apache server in baseurl and url in _config.yml.

Examples:

  • RSS feed
  • search
  • tags
  • portfolio

I have not modified the links in navbar.html:

<a class="clear" href="{{ site.url }}{{ site.baseurl }}/search">

Error when "bundle install"

Bundler could not find compatible versions for gem "bundler":
  In Gemfile:
    bundler (~> 1.12)

  Current Bundler version:
    bundler (1.11.2)
This Gemfile requires a different version of Bundler.
Perhaps you need to update Bundler by running `gem install bundler`?

Could not find gem 'bundler (~> 1.12)' in any of the sources

Page build warning

Dear,

I uploaded the project to github pages and am getting the error:

The page build completed successfully, but returned the following warning for the master branch:

You are attempting to use a Jekyll theme, "type-on-strap", which is not supported by GitHub Pages. Please visit https://pages.github.com/themes/ for a list of supported themes. If you are using the "theme" configuration variable for something other than Jekyll theme, we recommend you rename this variable throughout your site. For more information, see https://help.github.com/articles/adding-a-jekyll-theme-to-your-github-pages-site/.

How can I solve this?

First page title in navigation displays twice

Like, the title implies, the first nav item displays twice. In this case, it's the About page. I've attached a snippit below.
capture

I've tried it with a brand new jekyll site and it does the same thing.

ERROR installing Jekyll: Failed to build gem native extension.

While trying to install Jekyll on Ubuntu 16.04 32bits. I encountered an error.
Here is what I had:

  • gem 2.5.1
  • ruby 2.3.1

Trying to run:

gem install jekyll

And here is the error message:

Building native extensions.  This could take a while...
ERROR:  Error installing jekyll:
	ERROR: Failed to build gem native extension.

    current directory: /var/lib/gems/2.3.0/gems/ffi-1.9.18/ext/ffi_c
/usr/bin/ruby2.3 -r ./siteconf20171002-2379-1byb6u9.rb extconf.rb
mkmf.rb can't find header files for ruby at /usr/lib/ruby/include/ruby.h

extconf failed, exit code 1

Gem files will remain installed in /var/lib/gems/2.3.0/gems/ffi-1.9.18 for inspection.
Results logged to /var/lib/gems/2.3.0/extensions/x86-linux/2.3.0/ffi-1.9.18/gem_make.out

LinkedIn link is not working

Thanks for the great theme!

I have followed the documentation regarding links to other platforms like github etc, however, when I click on my LinkedIn icon it brings me to 404 Page Not Found. I have copied and pasted the whole url for linkedin on _config.yml as written in your documentation.

kramdown GFM toc

add _config.yml

# BUILD SETTINGS
markdown: kramdown
kramdown:
    input: GFM

the table of content

* TOC
{:toc}

  • How to add toc automatically and add toc to the side

  • Please help me thanks

"subtitle" field in post layout produces no result

As per docs:

layout: post
[...]
subtitle: "This is a subtitle"                    # A subtitle can be displayed below your title

However, using the field (both with and without quotations) produces no visible result. I thought it would produce the post summary instead of extracting it from the post body, but turns out excerpt does just that.

Should it produce any results for post layout or is it a leftover from page layout docs?

header_text_feature_image not displayed properly on mobile(android) browser

https://yshrsmz.github.io/

So here is my page.
when I browse this page on Android Chrome, header_text_feature_image is not displayed properly(it's way smaller than the display). it's displayed at the left side at first, and when I scroll it will be aligned to right.

Your demo page's header image ( https://sylhare.github.io/Type-on-Strap/ ) also looks strange. its width looks like wider than the display, but when you scroll, it becomes same width as display

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.