Skip to content

Instantly share code, notes, and snippets.

View ytnobody's full-sized avatar
♨️
470

ytnobody / satoshi azuma ytnobody

♨️
470
View GitHub Profile
@ytnobody
ytnobody / README.md
Created August 29, 2022 00:40
a rough script that helps to block rogue like client to your postfix server

postfix-scanner-block.sh

a rough script that helps to block rogue like client to your postfix server

usage

Anyway you should chmod +x and check behavior first.

# chmod +x ./postfix-scanner-block.sh
@ytnobody
ytnobody / example.go
Last active May 26, 2020 15:39
こういうことをやりたい
package main
import (
"database/sql"
_ "github.com/go-sql-driver/mysql"
"github.com/ytnobody/gomysqlerror"
"github.com/volatiletech/sqlboiler/boil"
)
@ytnobody
ytnobody / ecto-select-count-groupby.exs
Created December 2, 2019 06:12
[Ecto] SELECT bookshelf.id AS bookshelf_id, COUNT(book.id) AS books_count FROM bookshelf JOIN book ON bookshelf.id = book.bookshelf_id GROUP BY bookshelf.id
from(bookshelf in Bookshelf,
join: book in Book, on bookshelf.id == book.bookshelf_id,
group_by: bookshelf.id,
select: %{bookshelf_id: bookshelf.id, books_count: count(book.id)}
) |> Repo.all()
@ytnobody
ytnobody / iex.txt
Created September 2, 2019 02:48
failed etude of elixir mock server
iex(5)> sv = MyMock.run()
11:35:22.016 [info] Added handler for /user
11:35:22.016 [info] Added handler for /user/:id
%Mock.MockServer{
name: :my_mock,
pid: #PID<0.765.0>,
port: 64400,
route: %{
@ytnobody
ytnobody / azure-func-migrate-node
Last active November 15, 2018 00:40
Azure functions v1 -> v2 for Node.js applications for MacOSX
#!/bin/bash
show_help () {
cat <<EOF
Run "npm -g install azure-functions-core-tools" first.
EOF
exit;
}
list_required_extensions () {
@ytnobody
ytnobody / git-bar
Created November 1, 2018 10:07
キーワードでcommit logを引っ掛けてきて、宛先のbranchにcherry-pickするための中間ブランチをつくる、野蛮な工具
#!/bin/sh
help () {
cat <<EOF
Usage:
git-bar [keyword] [Dest Branch]
EOF
exit;
@ytnobody
ytnobody / mishimapm-3.md
Created June 3, 2018 02:08
Why people says "Perl is guilty" - mishima.pm #3

Why people says "Perl is guilty" ?

ytnobody


ytnobody

  • born: Hakodate
  • live: Ooi-machi
@ytnobody
ytnobody / cpanfile
Created February 27, 2018 05:30
cpanfile for kh_coder http://khc.sourceforge.net/
###
### cpanfile for KH Coder
###
#
# usage:
# $ cd kh_coder/
# $ LANG=C cpanm --installdeps -n .
#
requires 'perl' => '5.008';
<?php
/**
* LICENSE: The MIT License (the "License")
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
* https://github.com/azure/azure-storage-php/LICENSE
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
@ytnobody
ytnobody / sent-event.pl
Created February 18, 2017 07:27
Net::Azure::EventHubsを使ってAzure EventHubs経由でAzure Functionsの関数を起動する事例
use strict;
use warnings;
use utf8;
use Net::Azure::EventHubs;
### EventHubsの接続文字列をここに入れる
my $connection_string = '...';
### EventHubs向けにイベントを送るClientを作る
my $client = Net::Azure::EventHubs->new(