我通常習慣在Project folder開個Git repo,然後放個.gitignore,再commit其餘的文件,這樣我們就有了一個track list,也就是必要的Source Code和檔案。
然後在複製文件的時候,可以用git clean去清除不必要的檔案:
git clean -dfx-d代表directories(資料夾),-f代表files(檔案),-x代表.gitignore內所標識的檔案
可以先用dry run來確認一下哪些檔案會被刪除
git clean -n -dfx
git clean -dfx-d代表directories(資料夾),-f代表files(檔案),-x代表.gitignore內所標識的檔案
git clean -n -dfx
"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\bin\dumpbin.exe" /dependents PATH-TO-EXE
tshark -F libpcap -Y "ip.dst==1.2.3.4 and udp.port==110" -r "Input.pcap" -w "Output.pcap"
rpm -qa|grep ssh
groupadd sftpusers useradd -g sftpusers -d /upload -s /sbin/nologin myusername passwd myusername
mkdir -p /data/mysftpuser/upload chown -R root:sftpusers /data/myusername chown -R mysftpuser:sftpusers /data/myusername/upload
Match Group sftpusers ChrootDirectory /data/%u ForceCommand internal-sftp
service sshd restart
sudo chown -R www-data:www-data /coppermine sudo chmod -R 755 /coppermine
sudo chown -R www-data:www-data images/
sudo apt-get update sudo apt-get install ssmtp
root=user@example.commailhub=smtp.example.com:465 FromLineOverride=YES AuthUser=user@example.com AuthPass=password UseTLS=YES
echo "Hello world!" | ssmtp recipient@example.com
ssmtp recipient@example.com
TO: recipient@example.com FROM: <from@example.com> SUBJECT: Testing subject Hello world!
sendmail_path = /usr/sbin/ssmtp -t
wfLoadExtension( 'Scribunto' ); $wgScribuntoDefaultEngine = 'luastandalone';幫Lua程式加上執行權限,(雖然我試的時候已經有執行權限了):
chmod a+x /path/to/extensions/Scribunto/engines/LuaStandalone/binaries/yourOS/lua記得把yourOS換成自己的作業系統(我的是lua5_1_5_linux_64_generic)
$wgScribuntoUseGeSHi = true;
{{Navbox |name = Navbox/doc |state = uncollapsed |image = {{{image}}} |title = {{{title}}} |above = {{{above}}} |group1 = {{{group1}}} |list1 = {{{list1}}} |group2 = {{{group2}}} |list2 = {{{list2}}} |list3 = {{{list3}}} ''without {{{group3}}}'' |group4 = {{{group4}}} |list4 = {{{list4}}} |below = {{{below}}} See alternate navbox formats under: [[#Layout of table|''Layout of table'']] }}
dumpcap -P -i InterfaceName -a duration: DurationInSeconds -b filesize: MaxFileSizeForEachFile -f Filter & -w FilePath
Session.CodePage = 65001
Dim strPostData strPostData = Request.form If strPostData <> "" Then strPostData = strPostData & "&" strPostData = strPostData & ExtraPostData然後開啟XMLHTTP,把你的目標網頁(URLTarget)和GET request拼在一起,再連同POST request一起發送出去
SET httpRequest = Server.createObject("MSXML2.XMLHTTP") With httpRequest .Open "POST", URLTarget & "?" & Request.QueryString , FALSE .SetRequestHeader "Content-Type", "application/x-www-form-urlencoded" .Send strPostData End With最後再把取得的網頁內容寫出來,別忘了在Response header加上Character set,否則有些瀏覽器可能會用了錯的character set來解碼
Response.charset = "UTF-8" Response.write(httpRequest.ResponseText)
On Error Resume Next之後每當你想檢查剛剛的代碼有沒有出錯時,可以檢查Err.Number:
If Err.Number <> 0 Then Response.write Err.Description Err.Clear End If
sudo apt-get update
sudo apt-get install apache2
sudo service apache2 restart
sudo chmod o+w /var/www/html
<Directory "/var/www/html"> AllowOverride All </Directory>
Options -Indexes
sudo apt-get install mysql-server
mysql_secure_installation
systemctl status mysql.service
mysqladmin -p -u root version
mysql -u root -p
service mysqld start
service mysqld stop
sudo apt-get install php libapache2-mod-php php-mcrypt php-mysql
sudo apt-get install phpmyadmin php-mbstring php-gettext
sudo phpenmod mcrypt
sudo phpenmod mbstring
Order Allow,Deny Deny from All Allow from localhost
//Get UTC+8 Time (Windows MFC library) CTime ctNow = CTime::GetCurrentTime(); tm tmHongKongTime; (ctNow + CTimeSpan(0, 8, 0, 0)).GetGmtTm(tmHongKongTime); return tmHKT; // Get UTC+8 Time (Standard library) time_t t = time(NULL); struct tm *tmHKT = gmtime(&t); //still GMT, not yet HKT tmHKT->tm_hour += 8; //add 8 to GMT mktime(tmHKT); //recompute the values to make it valid return tmHKT; // Print time printf("Now is %d/%d/%d %02d:%02d:%02d HKT", tmHKT->tm_year + 1900, tmHKT->tm_mon + 1, tmHKT->tm_mday, tmHKT->tm_hour, tmHKT->tm_min, tmHKT->tm_sec);c#程式碼例子:
// Assume now is 2018:08:23 16:27:04 Hong Kong Time // UTC Time: 2018-08-23 08:27:04 Utc 8 636706096247972300 DateTime dtUTC = DateTime.UtcNow; Console.WriteLine("{0} {1} {2} {3}", dtUTC, dtUTC.Kind, dtUTC.Hour, dtUTC.Ticks); // Local Time (now Hong Kong Time): 2018-08-23 16:27:04 Local 16 636706384247972300 DateTime dtLocal = dtUTC.ToLocalTime(); Console.WriteLine("{0} {1} {2} {3}", dtLocal, dtLocal.Kind, dtLocal.Hour, dtLocal.Ticks); // Absolute Hong Kong Time (ignore machine timezone): 2018-08-23 16:27:04 Unspecified 16 636706384247972300 DateTime dtHKT = TimeZoneInfo.ConvertTimeFromUtc(dtUTC, TimeZoneInfo.FindSystemTimeZoneById("China Standard Time")); Console.WriteLine("{0} {1} {2} {3}", dtHKT, dtHKT.Kind, dtHKT.Hour, dtHKT.Ticks);JavaScript程式碼例子:
//JavaScript function GetAbsoluteHKTime() { var now = new Date(); now.setUTCHours(now.getUTCHours() + 8); return { "year" : now.getUTCFullYear(), "month" : now.getUTCMonth(), "date" : now.getUTCDate(), "hour" : now.getUTCHours(), "minute" : now.getUTCMinutes(), "second" : now.getUTCSeconds() }; } var j = GetAbsoluteHKTime(); console.log("Now is " + j.year + "/" + j.month + "/" + j.date + " " + ('0' + j.hour).slice(-2) + ":" + ('0' + j.minute).slice(-2) + ":" + ('0' + j.second).slice(-2) + " HKT");
// Get UTC+8 Time (Windows MFC library) SYSTEMTIME st; GetSystemTime(&st); CTime ctHongKongTime = CTime(st) + CTimeSpan(0, 8, 0, 0)
procdump -t PID