Skip to content

Instantly share code, notes, and snippets.

View sunaoka's full-sized avatar

SUNAOKA Norifumi sunaoka

View GitHub Profile
@sunaoka
sunaoka / Mountpoint for Amazon S3 v1.0.0.md
Last active August 10, 2023 04:42
Mountpoint for Amazon S3 v1.0.0

Mountpoint for Amazon S3 v1.0.0

検証環境

cat /etc/os-release
@sunaoka
sunaoka / basic-authentication.js
Created May 6, 2021 09:19
Amazon CloudFront Functions - Basic Authentication
var username = 'username';
var password = 'password';
function handler(event) {
var headers = event.request.headers;
var authorization = `Basic ${(`${username}:${password}`).toString('base64')}`;
if (headers.authorization === undefined || headers.authorization.value !== authorization) {
return {
statusCode: 401,
@sunaoka
sunaoka / aws-ena.md
Last active December 11, 2019 00:42

ENA 対応

OS が ENA に対応しているか確認

modinfo ena

ENA に対応している場合

@sunaoka
sunaoka / laravel-5.8-to-6.0.diff
Last active March 13, 2020 01:00
Difference from laravel 5.8.x to 6.0.x
diff -urd --exclude vendor --exclude composer.lock laravel-5.8/.env laravel-6.0/.env
--- laravel-5.8/.env 2019-09-20 11:16:56.000000000 +0900
+++ laravel-6.0/.env 2019-09-20 11:17:40.000000000 +0900
@@ -9,9 +9,9 @@
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_PORT=3306
-DB_DATABASE=homestead
-DB_USERNAME=homestead
-DB_PASSWORD=secret
/*
Adapted from https://github.com/sindresorhus/github-markdown-css
The MIT License (MIT)
Copyright (c) Sindre Sorhus <[email protected]> (sindresorhus.com)
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
@kotnik
kotnik / hook.sh
Created August 1, 2016 08:41
Git update hook to allow only signed commits
#!/usr/bin/env bash
##############################################################################
#
# check-commit-signature
# ----------------------
# A server-side update git hook for checking the GPG signature of a pushed
# commit.
#
# To enable this hook, rename this file to "update".
#
<?php
declare(strict_types = 1);
ini_set('memory_limit', '1024M');
class Benchmark
{
private $start;
public function __construct()
@kookxiang
kookxiang / Database.php
Last active September 24, 2019 11:45
PDO with multi server support
<?php
/**
* This file is a part of KK Framework
* Author: kookxiang <[email protected]>
*/
namespace Core;
class Database {
const MASTER = 'MASTER';
const SLAVE = 'SLAVE';
@mochizuki-masao
mochizuki-masao / count.rb
Last active September 8, 2016 17:50
S3_count_storage_size
#!/usr/bin/env ruby
require 'aws-sdk'
require 'optparse'
begin
require 'aws/profile_parser'
rescue LoadError; end
def conv_unit size
@wbroek
wbroek / genymotionwithplay.txt
Last active December 16, 2025 11:18
Genymotion with Google Play Services for ARM
NOTE: Easier way is the X86 way, described on https://www.genymotion.com/help/desktop/faq/#google-play-services
Download the following ZIPs:
ARM Translation Installer v1.1 (http://www.mirrorcreator.com/files/0ZIO8PME/Genymotion-ARM-Translation_v1.1.zip_links)
Download the correct GApps for your Android version:
Google Apps for Android 6.0 (https://www.androidfilehost.com/?fid=24052804347835438 - benzo-gapps-M-20151011-signed-chroma-r3.zip)
Google Apps for Android 5.1 (https://www.androidfilehost.com/?fid=96042739161891406 - gapps-L-4-21-15.zip)
Google Apps for Android 5.0 (https://www.androidfilehost.com/?fid=95784891001614559 - gapps-lp-20141109-signed.zip)