Skip to content

Instantly share code, notes, and snippets.

@yut304
yut304 / brew-install-dnsmasq-macos-m1.md
Last active May 5, 2024 00:31
Install dnsmasq on macos m1

Install dnsmasq with brew:

$ brew install dnsmasq

Setup *.test hosts with:

$ echo 'address=/.test/127.0.0.1' >> /opt/homebrew/etc/dnsmasq.conf

If want to use other device to resolv nameserver ( default only 127.0.0.1 )

@yut304
yut304 / LoginAttempt.php
Created December 4, 2018 09:51 — forked from jamband/LoginAttempt.php
Yii Framework: Login Attempt
<?php
class LoginAttempt extends ActiveRecord
{
const LOGIN_ATTEMPT_LIMIT = 5; // ログイン試行回数のリミット
const BANNED_IP_EXPIRATION_TIME = '+1 hour'; // この場合は禁止されてから一時間経たないとログインできない
...
/**
* @see CActiveRecord::beforeSave()
*/
@yut304
yut304 / install-python.sh
Last active March 29, 2018 06:43 — forked from osterman/install-python.sh
Install Python on CoreOS
#!/bin/bash -uxe
VERSION=2.7.14.2717
PACKAGE=ActivePython-${VERSION}-linux-x86_64-glibc-2.12-404899
# make directory
mkdir -p /opt/bin
cd /opt
wget http://downloads.activestate.com/ActivePython/releases/${VERSION}/${PACKAGE}.tar.gz