[PR] カード 比較

AlmaLinux 8.4 インストール後

timedatectl set-timezone Asia/Tokyo
dnf update -y
dnf install git -y
dnf groupinstall 'Development Tools' -y
dnf install git wget gcc gcc-c++ bzip2 openssl-devel libffi-devel readline-devel zlib-devel gdbm-devel ncurses-devel -y
dnf install openssl openssl-devel -y
dnf install curl -y
curl -sL https://dl.yarnpkg.com/rpm/yarn.repo | sudo tee /etc/yum.repos.d/yarn.repo
dnf install yarn -y
dnf install wget -y
dnf install bzip2-devel freetype-devel libjpeg-devel libpng-devel libtiff-devel giflib zlib-devel ghostscript libwmf libtool-ltdl-devel libX11-devel libXext-devel libXt-devel libxml2-devel librsvg2-devel
dnf install epel-release
dnf install dnf-utils http://rpms.remirepo.net/enterprise/remi-release-8.rpm
dnf install ImageMagick
dnf module list php
dnf module enable php:remi-8.0
dnf install php php-cli php-curl php-mysqlnd php-gd php-opcache php-zip php-intl
dnf install @mysql:8.0
dnf install httpd
dnf install python38 python38-devel
pip install chromedriver_binary
pip install chromedriver_binary==92.0.4515.107.0

read more

bundle update mimemagic

Fetching gem metadata from https://rubygems.org/.......
Your bundle is locked to mimemagic (0.3.3), but that version could not be found
in any of the sources listed in your Gemfile. If you haven't changed sources,
that means the author of mimemagic (0.3.3) has removed it. You'll need to update
your bundle to a version other than mimemagic (0.3.3) that hasn't been removed
in order to install.


bundle update mimemagic

read more

Rails6 select2 導入

$ yarn add tempusdominus-bootstrap-4
$ yarn add jquery
$ yarn add jquery-ui
$ yarn add select2

import 'bootstrap'
import "../stylesheets/application"
import 'jquery-ui/themes/base/core.css';
import 'jquery-ui/themes/base/menu.css';
import 'jquery-ui/themes/base/autocomplete.css';
import 'jquery-ui/themes/base/theme.css';
import 'select2/dist/css/select2.css';

@import 'bootstrap';
@import "~tempusdominus-bootstrap-4/src/sass/tempusdominus-bootstrap-4";

<select id="multiple" class="multiple" multiple="multiple">
<option value="value1">value1</option>
<option value="value2">value2</option>
<option value="value3">value3</option>
<option value="value4">value4</option>
<option value="value5">value5</option>

$(function () {
placeholder: 'Please Select',
allowClear: true,
dropdownAutoWidth: true,
width: 'auto',
multiple: true


read more

Ruby Devise 最終アクティブ時間の記録

Devise モデルじゃなくてもいいかもしれないけど・・・

カラム last_active_at datetime型をテーブルに追加

こんなふうにしてアクティ時間を更新させたいタイミングで touch メソッドを呼ぶ

class ApplicationController
before_filter :record_user_activity


def record_user_activity
if current_user
current_user.touch :last_active_at

read more

Apache Django連携


WSGIScriptAlias / path to project/project/wsgi.py
WSGIPythonPath path to project
WSGIPassAuthorization On

<Directory path to project/project/>
<Files wsgi.py>
Require all granted

Alias /static/ /path to project/app/static/
<Directory path to project/app/static>
Require all granted

read more

Django Basic 認証実装

# pip install wsgi-basic-auth
# pip install django_environ

.env ファイル作成してid, password を記述

wsgi.py 修正

import os
from django.core.wsgi import get_wsgi_application
from wsgi_basic_auth import BasicAuth
import environ
env = environ.Env()
env.read_env('path to .env')

#application = get_wsgi_application()
application = BasicAuth(get_wsgi_application())

Apache 側には WSGIPassAuthorization On をつける

read more

ModuleNotFoundError: No module named 'six'

# firewall-cmd --add-port=8000/tcp --zone=public --permanent
Traceback (most recent call last):
File "/usr/bin/firewall-cmd", line 31, in
from firewall.client import FirewallClient, FirewallClientIPSetSettings, \
File "/usr/lib/python3.6/site-packages/firewall/client.py", line 29, in
import slip.dbus
File "/usr/lib/python3.6/site-packages/slip/dbus/__init__.py", line 8, in
from . import service
File "/usr/lib/python3.6/site-packages/slip/dbus/service.py", line 30, in
from six import with_metaclass

ModuleNotFoundError: No module named 'six'

cp /usr/local/lib/python3.6/site-packages/six.py /usr/lib/python3.6/site-packages/

read more

Python plotlyでのグラフPDF出力 前準備

plotly, psutil, electron, orca が必要

# pip install plotly psutil
# npm install -g electron@1.8.4 orca --unsafe-perm=true --allow-root

Error: EACCES: permission denied, mkdir '/usr/local/lib/node_modules/electron/.electron'

read more

Python Apache 連携

# dnf -y install python3-mod_wsgi
# pip install mod-wsgi
# pip install mod-wsgi-httpd
# vi /etc/httpd/conf/httpd.conf

AddHandler wsgi-script .py
AddHandler wsgi-script .wsgi

Options +ExecCGI にしておくこと

# systemctl restart httpd.service


def application(environ, start_response):
status = '200 OK'
html = '<html>\n' \
'<body>\n' \
'<div style="width: 100%; font-size: 40px; font-weight: bold; text-align: center;">\n' \
'WSGI テストページ\n' \
'</div>\n' \
'</body>\n' \
response_header = [('Content-type','text/html')]
return [html]

read more

Swift Socket.IO サーバーに接続できない場合

node,js の sockect.io のバージョンが原因であるかもしれない。


npm install express@4.16.3
npm install socket.io@2.1.0


read more

Recent entry


Tag Cloud

Page Top