那些坑了我N多时间的问题(持续更新)

来源:互联网 发布:sql属于什么数据库语言 编辑:程序博客网 时间:2024/05/15 10:51

【2015-11-29】
1.版本小于1.7的nginx不支持syslog功能。
2.nginx 1.8版本的conf文件有较大变动,site-enble及site-available目录都已被取消。固从低版本升级到1.8版本首先要备份原conf配置文件,使用apt-get purge nginx在卸载nginx的同时删除配置文件。
3.rsyslog的Properties参考:
http://www.rsyslog.com/doc/master/configuration/properties.html
rsyslog的filter参考:
http://www.rsyslog.com/doc/v8-stable/configuration/filters.html

【2015-12-3】
某些意外关机或断电的情况下,windows10在再次启动时会卡在recovery上。
windows10禁止启用Recovery:

bcdedit /set {current} bootstatuspolicy displayallfailuresbcdedit /set {current} bootstatuspolicy ignoreallfailuresbcdedit /set {current} recoveryenabled No

【2015-12-11】
windows 10 家庭版可用激活码: TX9XD-98N7V-6WMQ6-BX7FG-H8Q99

【2015-12-28】
uwsgi 重启失败日志:
unlink(): Operation not permitted [core/socket.c line 135]
bind(): Address already in use [core/socket.c line 185]
解决方法:删除uwsgi manage.uwsgi.sock 文件 重启uwsgi

【2016-1-5】
超级蛋疼的urllib2设置proxy代理问题,最终原因是我设置的是http代理,但访问的是https网站,导致设置的代理总是无效。
解决方法:urllib2.ProxyHandler中设置https代理。

【2016-1-6】
用Python写了一个通过smtp.gmail.com发送邮件的模块,账号密码总是无法通过验证提示:
Please log in via your web browser and\n5.7.14 then try again.\n5.7.14 Learn more at\n5.7.14 https://support.google.com/mail/answer/78754 dg1sm138134795pad.18 - gsmtp’)
解决方法:访问https://www.google.com/settings/security/lesssecureapps
设置为Turn on

【2016-1-8】
AWS创建NAT-gateway后private-subnet总是无法访问外部网络。
原因:创建NAT-gateway时将其创建到了private-subnet,导致其本身无法有向internet的route。
参考AWS Troubleshooting NAT Gateways
The NAT gateway must be in a public subnet with a route table that routes Internet traffic to an Internet gateway.
解决方法:删除原先NAT-gateway,将新的nat-gateway创建到public-subnet中即可。
PS: AWS 删除VPC的操作要先删除该VPC中的internet gateway.

【2016-1-17】
windows 10 32位专业版 intel Atom Z3735F 芯片 PCI 加密/解密驱动无法安装。
解决方法:使用“鲁大师”安装驱动。(给鲁大师100个赞)

【2016-2-28】
ssh无法连接 日志提示 fatal Missing privilege separation directory /var/run/sshd
解决方法:mkdir /var/run/sshd
某些centos下的包与ubuntu包对应:
openldap 对应 libldap2-dev
pam-devel 对应 libpam0g-dev
openssl-devel 对应 libssl-dev

【2016-3-22】
windows 10 启用BitLocker出现的错误解决方法:
(1)This device can’t use a Trusted Platform Module.Your administrator must set “Allow BitLocker without a compatible TPM” option in the “Require addtional authentication at startup” policy for OS volumes.
解决方法:
打开组策略:gpedit.msc
Computer Configuration \ Administrative Templates \ Windows Components \ BitLocker Drive Encryption \ Operating System Drives
Double-click the “Require additional authentication at startup” setting, select Enabled, and check the “Allow BitLocker without a compatible TPM” option. Click OK to save the new setting.
(2)This PC deosn’t support entering a BitLocker recovery password during startup. Ask your administrator to configure Windows Recovery Environment so that you can use BitLocker.
解决方法:
cmd中运行:

powershell.exe -command "New-Item -Path HKLM:\SOFTWARE\Policies\Microsoft -Name FVE; Set-ItemProperty -Path HKLM:\SOFTWARE\Policies\Microsoft\FVE -Name OSEnablePrebootInputProtectorsOnSlates -Value 1 -Type DWord -Force"

【2016-3-24】
apache中修改DocumentRoot后403错误
解决方法:
在apache2.conf中添加自定义目录的权限

<Directory /usr/local/www>        Options Indexes FollowSymLinks        AllowOveride None        Require all granted</Directory>

【2016-5-22】
配置pptpd服务连接失败,日志中出现:
pppd[4004]: The remote system is required to authenticate itself pppd[4004]: but I couldn’t find any suitable secret (password) for it to use to do so.
解决:/etc/ppp/chat-secrets中的密码中包含一些ppp无法识别的字符。

【2016-5-31】
将django从1.6升级到1.9后,nginx 502错误,日志如下:
upstream prematurely closed connection while reading response header from upstream……
原因是django工程中的 django_wsgi.py脚本不能再使用前版本的写法:
以前的写法为:

import osimport sysfrom django.core.handlers.wsgi import WSGIHandleros.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'application = WSGIHandler()

django 1.7后的写法为:

import osimport sysfrom django.core.wsgi import get_wsgi_applicationos.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'application = get_wsgi_application()

【2016-6-1】
在将django 从1.6升级到1.9后,原先的ORM中的proxystatus.add方法出现错误如下:
ValueError: instance isn’t saved. Use bulk=False or save the object first.
导致无法添加新的proxy,解决方法如下:
将原先的添加方式:com.proxystatus_set.add(proxy_status)
修改为:com.proxystatus_set.add(proxy_status,bulk=False)

【2016-6-28】
在装有anydesk的系统中进行ghost克隆后,所有的克隆的系统的anydesk address都是一样的。
解决方法:please stop the AnyDesk service and delete service.conf (位于C:\ProgramData\AnyDesk下)

【2016-9-1】

用ultraiso做了一个ubuntu14.04的安装U盘,出现问题:Failed to copy file from CD-ROM….

解决方法:使用win32diskimager工具来制作U盘。

【2016-12-30】
Jquery Tag-it b.curCSS is not a valid function error.
解决方法:
curCSS was removed from jQuery 1.8 and up, so you need to upgrade your jquery.ui. Looking at http://bugs.jqueryui.com/ticket/8501 you will see the issue.
Take a look at:
https://github.com/jquery/jquery-ui/commit/98772fd0a1094f7fb2fbe1d8a95557bf2b545f6e

If you can’t upgrade your jQuery UI library, simply add this javascript after your jQuery file, before the jQuery UI file(s).

(function($) {    if (!$.curCSS) {       $.curCSS = $.css;    }})(jQuery);

【2016-12-31】
Django 1.8: Create initial migrations for existing schema
解决方法:

1. Empty the django_migrations table: delete from django_migrations; 2. For every app, delete its migrations folder: rm -rf <app>/migrations/ 3. Reset the migrations for the "built-in" apps: python manage.py migrate --fake 4. For each app run: python manage.py makemigrations <app>. Take care of dependencies (models with ForeignKey's should run after their parent model). 5. Finally: python manage.py migrate --fake-initial

【2017-2-11】
修改RDP端口
cmd版

reg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" /v PortNumber /t REG_DWORD /d 33333 /freg add "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" /v PortNumber /t REG_DWORD /d 33333 /f

powershell版

New-ItemProperty  -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\Wds\rdpwd\Tds\tcp" -Name PortNumber -PropertyType DWORD -Value 33333 -ForceNew-ItemProperty  -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name PortNumber -PropertyType DWORD -Value 33333 -Force

启用声音服务

sc config Audiosrv start= autonet start Audiosrv
0 0