2020年8月7日 星期五

Synology NAS smartctl

需要兩個額外參數

smartctl -a -d sat -T permissive /dev/sda

-d sat

Specifies device type. [Sat]  is SCSI to ATA Translation (SAT) that is required with Synology.

 -T permissive
Defines tolerance type. [Permissive] tells to ignore failure(s) of mandatory SMART commands and is required with Synology.

2020年8月2日 星期日

centos 7 + mysql 5.7 + /tmp/mysql.sock



## install mysql 5.7

yum update

yum install yum-utils -y

yum localinstall  https://repo.mysql.com//mysql80-community-release-el7-3.noarch.rpm -y

yum-config-manager --disable mysql80-community

yum-config-manager --enable mysql57-community

yum install mysql-community-server -y


# edit  /etc/my.cnf

# 1. change socket=/tmp/mysql.sock under [mysqld] section

# add [client] section if not exist

# 2. change or add  socket=/tmp/mysql.sock under [client] section


# install selinux utils

yum install policycoreutils-python-2.5-34.el7.x86_64


# start mysql service to get fail audit log for next step

systemctl start mysqld.service  # this will not work and report error at this time


# modify selinux by analyzing audit log automatically

ausearch -c 'mysqld' --raw | audit2allow -m my-mysqld

semodule -i my-mysqld.pp


# start mysql service

systemctl start mysqld.service   # service should  start up accordingly


# get mysql temporary password in /var/log/mysqld.log

grep 'temporary password' /var/log/mysqld.log


# test mysql client connection

 mysql -p 


# change mysql root password and secure installation

mysql_secure_installation




2019年5月30日 星期四

Wordpress 代誌毋是親像憨人所想的遐爾簡單

代誌毋是親像憨人所想的遐爾簡單。wordpress很好裝沒錯,但是加上 AWS Load Balancer / SSL termination 就搞死人囉。



if($_SERVER['HTTP_X_FORWARDED_PROTO'] == 'https'){

    $_SERVER['HTTPS'] = 'on';
    $_SERVER['SERVER_PORT'] = 443;
}



/* That's all, stop editing! Happy publishing. */

2019年4月28日 星期日

帝雉480p



https://youtu.be/THmNjjQXQ1Q

感謝這對大雞夫妻賞臉,讓我們跟拍10多分鐘

2018年8月2日 星期四

Ubuntu 18.04 suspend problem on Zenbook UX410UQK + Nvidia 940M


在 ASUS Zenbook UX410UQK 筆電上 踩到 Nvidia 940MX ,在Ubuntu18.04上 suspend之後系統會掛掉。  目前的18.04.1依然無解。
只好改用最愛的 Debian Sid, kernel 4.17。 OK。

update:
https://wiki.archlinux.org/index.php/bumblebee#Failed_to_initialize_the_NVIDIA_GPU_at_PCI:1:0:0_.28Bumblebee_daemon_reported:_error:_.5BXORG.5D_.28EE.29_NVIDIA.28GPU-0.29.29
I ended up with this service in /etc/systemd/system/gpu-fix.service:

[Unit]
Description=Fix GPU after waking up from suspension
After=suspend.target
[Service]
User=root
Type=oneshot
# Sleep is because we want to ensure fastest wake up
ExecStart=/usr/bin/bash -c "sleep 2 && echo 1 > /sys/bus/pci/rescan"
TimeoutSec=0
[Install]
WantedBy=suspend.target

2018年2月28日 星期三

debian sid python3-zeitgeist bug dirty fix

又撞上一個熱騰騰的 Debian sid bug ,是在更新  python3-zeitgeist 套件時報掉的。

https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=891615

看來是開發者沒有留意python2 |  python3  try except raise 的語法差異所造成。

我不會寫 python ,可是照著 error message 丟出來的訊息


Setting up python3-zeitgeist (1.0.1-0.1) ...

File "/usr/lib/python3/dist-packages/zeitgeist/client.py", line 1061

raise TypeError, 'enabled_callback: expected a callable method'

^

SyntaxError: invalid syntax

,再查一下 python3 語法範例,土法煉鋼把報錯的檔案改完,ㄝ,可以了
apt upgrade 就過了。

跟Sid朝夕相處的刺激感覺實在不錯啊。

2018年2月6日 星期二

Last Night I Had the Strangest Dream






身在網路新創公司,每次聽到那些 buzzword,我就想起這首歌。
buzzword的生命週期跟這首歌的長度差不多。
buzzword的內容跟這首歌詞一樣,都是祈求世界和平。
buzzword的旋律聽起來就像這首歌,像童話故事一般夢幻。
buzzword風潮過了,就像聽完這首歌一樣.....

Last Night I Had the Strangest Dream......

寫在February 5, 2018 Paul Simon 宣佈停止演出