Skip to content

Instantly share code, notes, and snippets.

View masawada's full-sized avatar

Masayoshi Wada masawada

View GitHub Profile
@ftpmorph
ftpmorph / Details and config tips.txt
Last active April 22, 2024 19:47
Amazon AWS S3 IAM permissions required for Mastodon
When setting up a Mastodon instance I had a very hard time working out the required S3 permissions.
Wasted a day on it. None of the tutorials or even the official documentation gave me this information.
In the end I gave up and just gave it blanket access to all permissions for the Mastodon bucket (S3Administrator).
But this didn't set well with me - I don't like granting unnecessary permissions, especially not when S3 has about 100 of them.
If the server were to become compromised or the keys were to otherwise fall into the wrong hands I'd want a potentially malicious actor to have as limited permissions as possible.
Anyway I finally worked out the permissions required to for Mastodon to function with an S3 bucket as its media storage.
See below for the IAM policy.
@masayoshi634
masayoshi634 / rbenv_install_for_archlinux.sh
Last active May 31, 2019 04:04
ArchLinuxでruby-buildする時のメモ
#!/bin/sh
#####################
# for archlinux 2017/11/05
# depend
sudo pacman -S libffi libyaml openssl zlib openssl-1.0 --noconfirm
yay -S gcc6 --noconfirm
# 権限のチェック
if (!([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole(`
[Security.Principal.WindowsBuiltInRole] "Administrator")) {
Write-Warning "管理者として実行してください"
exit 1
}
echo "Windowsの開発環境を構築します"
echo ""
echo "127.0.0.1\ttwitter.com
127.0.0.1\twww.facebook.com
127.0.0.1\tslack.com
127.0.0.1\tanond.hatelabo.jp" >> /etc/hosts
@subfuzion
subfuzion / curl.md
Last active July 3, 2024 11:43
curl POST examples

Common Options

-#, --progress-bar Make curl display a simple progress bar instead of the more informational standard meter.

-b, --cookie <name=data> Supply cookie with request. If no =, then specifies the cookie file to use (see -c).

-c, --cookie-jar <file name> File to save response cookies to.

@fand
fand / Dispatcher.js
Last active February 15, 2016 08:06
簡易Flux
/**
* A simple Flux implementation with EventEmitter.
* @author amagitakayosi <amagitakayosi@hatena.ne.jp>
* @license MIT License
* /
'use strict';
const EventEmitter = require('events').EventEmitter;
@aereal
aereal / 00_compile.t
Created May 22, 2015 03:55
Manage Perl modules with NPM
use strict;
use warnings;
use Test::More;
use lib glob 'node_modules/*';
require_ok 'Dep1';
require_ok 'Dep2';
done_testing;
@koba04
koba04 / .gitignore
Last active December 21, 2018 02:21
karma + mocha + browserify + babel + power-assert
node_modules/

Atomコードリーディングメモ

ビルド方法

script/build

起動したらsrc/window-bootstrap.coffeeが起動時間のログを出してるので、そいつをgrepすると/src/broweser/atom-application.coffee が引っかかる。

src/broweser/atom-application.coffee は、 src/browser/main.coffee に呼ばれている

/*
Copyright © 2014 Hidekazu Kobayashi
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE