此内容被密码保护

Categories:Linux June 28, 2019

请输入密码访问

cannot open serial ttyACM0 on ubuntu

Categories:FPV May 21, 2019

sudo usermod -a -G dialout

firmware:

create a file : 45-stdfu-permissions.rules
and fill with:

# DFU (Internal bootloader for STM32 MCUs)
SUBSYSTEM=="usb", ATTRS{idVendor}=="0483", ATTRS{idProduct}=="df11", MODE="0664", GROUP="plugdev"

then:

sudo cp 45-stdfu-permissions.rules /etc/udev/rules.d

sudo usermod -a -G plugdev <username>

Fixed my corrupted database last night

Categories:树莓派,Linux March 3, 2019

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

Categories:树莓派,Linux February 23, 2019

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出现数据库错误

Categories:树莓派,Linux January 17, 2019

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