那些坑了我N多時間的問題(持續更新)

【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 displayallfailures
bcdedit /set {current} bootstatuspolicy ignoreallfailures
bcdedit /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 os
import sys

from django.core.handlers.wsgi import WSGIHandler

os.environ['DJANGO_SETTINGS_MODULE'] = 'myapp.settings'
application = WSGIHandler()

django 1.7後的寫法爲:

import os
import sys

from django.core.wsgi import get_wsgi_application

os.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 /f
reg 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 -Force
New-ItemProperty  -Path "HKLM:\SYSTEM\CurrentControlSet\Control\Terminal Server\WinStations\RDP-Tcp" -Name PortNumber -PropertyType DWORD -Value 33333 -Force

啓用聲音服務

sc config Audiosrv start= auto
net start Audiosrv
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章