- Create a service file like
dash_sniffer.service - Put it in
/lib/systemd/system/ - Reload
systemdusing command:systemctl daemon-reload - Enable auto start using command:
systemctl enable dash_sniffer.service
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
| # lib/tasks/db_fixtures_export.rake | |
| namespace 'db:fixtures' do | |
| desc "generate fixtures from the current database" | |
| task :export => :environment do | |
| Rails.application.eager_load! | |
| models = defined?(ApplicationRecord) ? ApplicationRecord.descendants : ActiveRecord::Base.descendants | |
| models.each do |model| | |
| puts "exporting: #{model}" |
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
| [options] | |
| # | |
| # WARNING: | |
| # If you use the Odoo Database utility to change the master password be aware | |
| # that the formatting of this file WILL be LOST! A copy of this file named | |
| # /etc/odoo/openerp-server.conf.template has been made in case this happens | |
| # Note that the copy does not have any first boot changes | |
| #----------------------------------------------------------------------------- | |
| # Odoo Server Config File - TurnKey Linux |
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
| #!/usr/bin/env bash | |
| apt-get install -y libpcre3 libpcre3-dev libssl-dev unzip make \ | |
| libgoogle-perftools-dev google-perftools jq | |
| mkdir /tmp/ngxbuild | |
| cd /tmp/ngxbuild | |
| latestNginx=$(curl -s http://hg.nginx.org/nginx/tags | | |
| grep "^ *release-" | head -1 | cut -c 9-) | |
| latestNaxsi=$(curl -s https://api.github.com/repos/nbs-system/naxsi/releases | | |
| jq -r .[].tag_name | grep -v rc | head -1) |
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
| # Build script for Jenkins. This builds the checked out code and will deploy it if the commit came from | |
| # an environment specified in DEPLOYABLE_ENVIRONMENTS after a successful build. | |
| require 'open-uri' | |
| HIPCHAT_AUTH_TOKEN = "FILL ME IN" | |
| HIPCHAT_ROOM = "FILL ME IN" | |
| PROJECT_NAME = "FILL ME IN" | |
| STAGING_URL = "https://staging.example.com" | |
| PRODUCTION_URL = "https://www.example.com" |
Common code statements in different languages for quick reference and comparison: Java, JavaScript, Kotlin, Objective-C, Python, Ruby, Scala, Swift.
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
| # Original from http://snippets.dzone.com/posts/show/4468 by MichaelBoutros | |
| # | |
| # Optimized version which uses to_yaml for content creation and checks | |
| # that models are ActiveRecord::Base models before trying to fetch | |
| # them from database. | |
| namespace :db do | |
| namespace :fixtures do | |
| desc 'Dumps all models into fixtures.' | |
| task :dump => :environment do | |
| models = Dir.glob(RAILS_ROOT + '/app/models/**.rb').map do |s| |
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
| # MySQL. Versions 4.1 and 5.0 are recommended. | |
| # | |
| # Install the MySQL driver: | |
| # gem install mysql2 | |
| # | |
| # And be sure to use new-style password hashing: | |
| # http://dev.mysql.com/doc/refman/5.0/en/old-client.html | |
| development: | |
| adapter: mysql2 | |
| encoding: utf8 |
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
| echo 'export PATH=$HOME/local/bin:$PATH' >> ~/.bashrc | |
| . ~/.bashrc | |
| mkdir ~/local | |
| mkdir ~/node-latest-install | |
| cd ~/node-latest-install | |
| curl http://nodejs.org/dist/node-latest.tar.gz | tar xz --strip-components=1 | |
| ./configure --prefix=~/local | |
| make install # ok, fine, this step probably takes more than 30 seconds... | |
| curl https://www.npmjs.org/install.sh | sh |
NewerOlder