This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Script to reset a Concerto demo instance and include useful demo data | |
# This should be invoked with bundle exec rails runner concerto_demo_script.rb | |
# Recommended cron entry: 00 00 * * * ruby path/to/concerto_demo_script.rb | |
#drop, migrate, and seed the database | |
require 'rake' | |
Rake.load_rakefile Rails.root.join( 'Rakefile' ) | |
Rake::Task["db:reset"].invoke | |
# At this point, a demo screen, feed, and group exist. All that's needed is an initial admin, some sample users, and content |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# systemd unit file | |
# | |
# Customize this file based on your bundler location, app directory, etc. | |
# Put this in /usr/lib/systemd/system (CentOS) or /lib/systemd/system (Ubuntu). | |
# Run: | |
# - systemctl enable rectifier_mailman | |
# - systemctl {start,stop,restart} rectifier_mailman | |
# | |
# See Inspeqtor's Systemd wiki page for more detail about Systemd: | |
# https://github.com/mperham/inspeqtor/wiki/Systemd |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
You may be concerned that the NSA is reading your e-mail. Is there really anything you can do about it though? After all, you don’t really want to move off of GMail / Google Apps. And no place you would host is any better. | |
Except, you know, hosting it yourself. The way that e-mail was originally designed to work. We’ve all just forgotten because, you know, webapps-n-stuff. It’s a lot of work, mkay, and I’m a lazy software developer. | |
Today we kill your excuses. Because I’m going to show you exactly how to do it, it’s going to take about two hours to set up, and it’s a “set it and forget it” kind of setup. Not only that, but it is actually going to be better than GMail, from a purely features perspective. It might surprise you to learn that people continue to develop email server software in a post-Google-apps world, and that the state of self-hosted is much better than you remember. | |
Now fair warning: it took me about two days to figure the stuff out you’re going to see in this blogpost, starting from knowin |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
namespace :reset_nightly do | |
system("git checkout .") | |
system("git pull") | |
Rake::Task["db:reset"].invoke | |
Rake::Task["db:migrate"].invoke | |
@user = User.new(:email => '[email protected]', :password => 'some_password', :password_confirmation => 'some_password', :is_admin => true) | |
@user.save | |
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
find . -name "*.flac" -type f -exec sh -c 'ffmpeg -i "$0" -acodec alac "`basename "$0" .flac`.m4a"' {} \; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
In the application controller: | |
#call on this method to get access to the current user session in models (used in Task model for cocaine) | |
def set_current_user | |
User.current = current_user | |
end | |
In the User model: | |
#used to fetch the current user session in models | |
def self.current | |
Thread.current[:user] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env ruby | |
#https://api.github.com/repos/concerto/concerto/git/refs/tags | |
require 'net/https' | |
require 'uri' | |
require 'json' | |
uri = URI.parse('https://api.github.com/repos/concerto/concerto/git/refs/tags') | |
http = Net::HTTP.new(uri.host, uri.port) | |
if uri.scheme == "https" # enable SSL/TLS |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
class Configuration < ActiveRecord::Base | |
TRUE = "t" | |
FALSE = "f" | |
validates_presence_of :key | |
validates_uniqueness_of :key | |
# Enable hash-like access to table for ease of use | |
# Returns false if key isn't found |