This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PROVIDE: god | |
# REQUIRE: LOGIN | |
# KEYWORD: shutdown | |
# | |
# Add the following lines to /etc/rc.conf to enable the puppet agent: | |
# | |
# god_enable="YES" |
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
God.watch do |god| | |
god.name = 'growi' | |
god.env = { | |
'NODE_ENV' => 'production', | |
'MONGO_URI' => 'mongodb://localhost:27017/growi', | |
'PORT' => '3012', | |
} | |
god.dir = '/home/growi/growi' | |
god.uid = 'growi' | |
god.start = 'node /home/growi/growi/src/server/app.js' |
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
path = ENV['PATH'].split(':') | |
path.unshift('/sbin') | |
path.unshift('/usr/sbin') | |
path.unshift('/usr/local/sbin') | |
path.unshift('/bin') | |
path.unshift('/usr/bin') | |
path.unshift('/usr/local/bin') | |
path.uniq! | |
ENV['PATH'] = path.join(':') |
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
systemLog: | |
destination: syslog | |
storage: | |
dbPath: /var/db/mongodb | |
journal: | |
enabled: true | |
processManagement: | |
fork: true |
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
require 'rest-client' | |
response = RestClient.post( | |
'https://mstdn.example.com/api/v1/media', | |
{file: File.new(filepath, 'rb')}, | |
{'Authorization' => "Bearer #{token}"}, | |
) | |
media_id = JSON.parse(response.body)['id'].to_i |
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
require 'amazon/ecs' | |
Amazon::Ecs.configure do |options| | |
options[:AWS_access_key_id] = AMAZON_ACCESS_KEY | |
options[:AWS_secret_key] = AMAZON_SECRET_KEY | |
options[:associate_tag] = AMAZON_ASSOCIATE_TAG | |
end | |
begin | |
response = Amazon::Ecs.item_lookup(asin, {country: 'jp', response_group: 'Images'}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT | |
attachments.id AS attachment_id, | |
toots.id AS toot_id, | |
attachments.file_content_type AS content_type, | |
attachments.file_file_name AS file_name, | |
attachments.file_file_size AS file_size, | |
attachments.file_meta AS meta, | |
attachments.updated_at | |
FROM media_attachments AS attachments | |
INNER JOIN statuses AS toots ON attachments.status_id=toots.id |
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
listen = * | |
login_access_sockets = tcpwrap | |
# auth | |
auth_verbose = yes | |
disable_plaintext_auth = no | |
auth_mechanisms = plain login | |
passdb { | |
driver = passwd | |
} |
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 | |
require 'shellwords' | |
DEST_DIR = '/usr/local/samba/movie' | |
OPTIONS = '-y -vf scale=720:-1' | |
unless ARGV.first | |
puts "usage: #{File.basename(__FILE__)} filename" | |
exit 1 |
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
const axios = require('axios'); | |
const querystring = require('querystring') | |
/* | |
いろいろやる | |
*/ | |
const createClientID = (id, secret) => { | |
const source = new Buffer([id, secret].join(':')); | |
return source.toString('base64'); |