Deprecated: htmlspecialchars(): Passing null to parameter #1 ($string) of type string is deprecated in /home/public/var/Widget/Archive.php on line 1057

Fixed my corrupted database last night

March 3, 2019 分类:树莓派,Linux

For some reason, I turned off the power switch last night, before I have done it, I forgot to shut down my home servers correctly. Then, it was not a surprise that the database on one of my Raspi crashed.
In order to solve this problem, Follow the message it provide, use "journalctl -xe" command to show related information. Modify "my.cnf", add " innodb_force_recovery > 0 " then start the database, afterward comment the " innodb_force_recovery > 0" line in again, restart the database subsequently. Done.

Use a SMB directory on Apache2

February 23, 2019 分类:树莓派,Linux

Install samba client:

apt-get install  samba-common smbclient samba-common-bin smbclient  cifs-utils

mkdir /mnt/abc
mount -t cifs //yourIP/yourShare /mnt/abc

If you need to add credentials at the mount time:


mount -t cifs //server/share /mnt/abc -o user=user,pass=password,dom=domain

If you want to dismount the share later:

umount /mnt/abc

Mount permanently:

sudo nano /etc/fstab

Add: //server/share /mnt/abc cifs guest,uid=1000,iocharset=utf8,x-systemd.automount 0 0

For more information visit:
https://wiki.ubuntu.com/MountWindowsSharesPermanentlyUbuntu forum

Access Permission(May not necessary):

chown -R $USER:$USER /mnt/abc
chmod -R 755 /mnt/abc

Apache2 on Debian based OS:

Modify apache2.conf add lines:

<Directory /mnt/abc/>
    Options Indexes FollowSymLinks
    AllowOverride None
    Require all granted

Modify conf in sites-available directory:

    <VirtualHost *:80>
DocumentRoot /mnt/abc
ServerName myv.host.com
ServerAlias myv.host.com
ErrorLog logs/myvhost-error_log
CustomLog logs/myvhost-access_log combined
ServerAdmin [email protected]
<Directory /mnt/abc/>
    AllowOverride All
    Options +Indexes
</Directory>
</VirtualHost>

Typecho出现数据库错误

January 17, 2019 分类:树莓派,Linux

前几天突然发现我的树莓派数据库服务器挂了,想来是多次插拔移动硬盘导致意外重启,损坏了文件,表现为数据库无法运行,后来扒日志修复了。今天又突然发现租用的数据库也报错了,但查看数据库运行良好。想起来运营商发的邮件来,他们更新了管理套件相应的也会更新服务器环境。登陆phpadmin查看,是比较新的php7.1,数据库扩展有了变化,修改config.nic文件里的$db = new Typecho_Db('Mysql', 'xx_');为“$db = new Typecho_Db('Pdo_Mysql', 'xx_'); 就好了。基本上遇到问题都不必惊慌,查log和搜索总能解决的。当然了,定时备份总没有坏处。

技嘉Brix BLPD5005使用感受

December 28, 2018 分类:树莓派

用了几天这小东西感觉还行,除了我觉得价格依然小贵。万恶的资本家,明明已经搞出了能耗比更高的东西,就是不肯下放。感觉J5005也是牙膏挤到头不得已的升级,10瓦功耗换来passmark3000(cpubenchmark.net)分的表现,低阶产品历史最高了。。HP这块入门NVME算是浪费了一半的性能,毕竟这个板子只支持pcie2.0 x2模式,但起码比SATA3是好的。见下图。
crystal

as

看电影自然没有悬念即便是局域网播放,9560AC的无线速度也不会拖后腿。玩我的世界视野开到中远,关闭抗锯齿可以畅玩,粒子效果全开偶有掉帧(Hmmm)。
打字儿看网页整机功耗6-7w,播放10G的1080p死侍2功耗为12w,玩我的世界20w。风扇声音平时是觉察不到的除非你特意去在乎~ 整体操作流畅。

这好像是目前你能花最少的钱买到性能功耗比最高的产品。如果你用它作为一个家用服务器是非常合适的,不间断开机每个月的电费大概不到5块钱(增加一块额外2.5寸机械盘的情况下)。


我的花费:

      准系统 899元  (plus会员849元)
      内存 4Gx2  320元(闲鱼,镁光DDR4 2666)    
      硬盘 259元  (jd活动 HP ex900 256G) 

特定用途下你的花费只会更少。

how to shutdown your raspberry pi

February 5, 2013 分类:树莓派

there are 4 different ways:
sudo shutdown -h now
sudo halt
sudo poweroff
sudo init 0

reboot raspberry pi got 3:
sudo reboot
shutdown -r now
shutdown -r 18:23:52 #reboot on 18:23:52定时重启在18点23分52秒关闭