Skip to content

Instantly share code, notes, and snippets.

@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
@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()
*/