以下介紹icatch監視器APP設定的部驟:
這篇介紹如何啟用MS-Word的多人共筆的功能,Word的功能非常強大,但大多我們都沒用過,故特別寫這篇教大家開啟Word強大的共筆功能。共筆是指多個人編輯同一份Word的文件,尤其這篇要教的是用單機版Word,多台電腦同時編一份文件(非網頁介面)。啟用功能的步驟:
come and talk to me
come and walk with me
渴
詩篇50:14-15你要向神獻上感謝祭;又要向至高者還你的願;並要在患難之日呼求我:我必搭救你,你也要榮耀我。
sudo dpkg -i hello_2.8-4_amd64.deb
apt-get install -f
轉貼自:https://www.lewan.com/blog/2012/02/10/making-a-bootable-usb-stick-on-an-apple-mac-os-x-from-an-iso
1. Open the Terminal
2. Convert the .iso file to .img using the convert option of hdiutil:
hdiutil convert -format UDRW -o /path/to/target.img /path/to/source.iso
Note: OS X tends to put the .dmg ending on the output file automatically. Rename the file by typing:
3. mv /path/to/target.img.dmg /path/to/target.img
4. Run diskutil list again and determine the device node assigned to your flash media (e.g. /dev/disk2)
5. Run diskutil unmountDisk /dev/diskN (replace N with the disk number from the last command - in the previous example, N would be 2)
6. Execute sudo dd if=/path/to/downloaded.img of=/dev/rdiskN bs=1m (replace /path/to/downloaded.img with the path where the image file is located; for example, ./ubuntu.img or ./ubuntu.dmg).
Note: Using /dev/rdisk instead of /dev/disk may be faster.
將 .rpm 檔轉換為 .deb 檔 (取自官網說明 )
另外一種套件擋是使用 .rpm 字尾的 Red Hat 套件管理員 檔。不建議您在 Ubuntu 系統安裝它們。在大部份情況下,
您都能找到原生的 Ubuntu .deb 套件。但若真的需要,.rpm 檔是可以以 alien 程式轉換成 .deb 套件。
1.
安裝 alien 套件(章 2, 新增、移除以及更新應用程式)。
2.
在終端機下以管理者權限執行以下指令:
sudo alien 套件檔案.rpm
版本: 6.2.2-24922-4
(2019-11-05)
注意事項
此更新預計在數天內發佈至所有地區,但各地區的實際發佈時間可能略有不同。
此更新將會重新啟動您的 Synology NAS。
問題修正
修正 DS118、DS218、DS218play、DS418、DS418j 與 RS819 硬碟 LED 指示燈無法正常閃爍的問題。
修正憑證在更新失敗時可能無法正常運作的問題。
修正手動更新憑證後可能無法套用至相關服務的問題。
修正有關 Net-SNMP 的安全性弱點 (CVE-2018-18066)。
修正有關 Nginx 的安全性弱點 (Synology-SA-19:33)。
修正多個安全性弱點 (Synology-SA-19:37)。
sudo su - apachectl start Browser開下列網址測試 http://localhost/ cd /etc/apache2/ cp httpd.conf httpd.conf.bak vi httpd.conf Uncomment: LoadModule php7_module libexec/apache2/libphp7.so apachectl restart echo ' /Library/WebServer/Documents/phpinfo.php Browser開下列網址測試PHP http://localhost/phpinfo.php
from flask import Flask
import logging
app = Flask(__name__)
@app.route('/')
def root():
app.logger.debug('A value for debugging')
app.logger.warning('A warning occurred (%d apples)', 42)
app.logger.error('An error occurred')
if __name__ == '__main__':
app.logger.addHandler( logging.FileHandler('flask.log') )
app.run( debug=True )
from flask import Flask, request, abort
app = Flask(__name__)
@app.route('/login')
def login():
abort(404)
@app.errorhandler(404)
def page_not_found(error):
return render_template('page_not_found.html'), 404
if __name__ == "__main__":
app.run(debug=True)
q_target
參數(切斷相關性)
{
"start" : {
"unixtime": 1554872400,
"hour": 13,
"minute": 0,
"second": 0
},
"end" : {
"unixtime": 1554963123,
"hour": 18,
"minute": 0,
"second": 0
}
}
{
"start" : {
"unixtime": 1554872400,
"year": 2019,
"month": 5,
"day": 1
},
"end" : {
"unixtime": 1554963123,
"year": 2019,
"month": 5,
"day": 31
}
}
#!/bin/bash
echo "start..."
#DUMP遠端資料表2個,不用在Inser資料時LOCK,不然LOCK來不及放掉,其它Client就要等很久。
mysqldump --skip-add-locks -h HOST_IP -u USERNAME -pPASSWORD DBNAME TABLENAME1 TABLENAME2 > /tmp/BACKUP.sql
#搜尋一些東西,替代掉
sed -i -e 's/TABLENAME/NEW_TABLENAME/g' /tmp/BACKUP.sql
sed -i -e 's/utf8mb4_unicode_ci/utf8_general_ci/g' /tmp/BACKUP.sql
sed -i -e 's/utf8mb4/utf8/g' /tmp/BACKUP.sql
sed -i -e 's/InnoDB/MyISAM/g' /tmp/BACKUP.sql
sed -i -e 's/`Query` text COLLATE utf8_general_ci COMMENT/`Query` text COLLATE utf8_general_ci NOT NULL DEFAULT "" COMMENT/g' /tmp/BACKUP.sql
#導入資料表到新的資料庫
mysql -u username -pPassword DBNAME < /tmp/BACKUP.sql
#修改一些資料表格式,剛才沒替代掉的
mysql -u username -pPassword -e "ALTER TABLE mytablename CHANGE colname newcolname CHAR(191)_type" DBNAME
mysql -u username -pPassword -e "ALTER TABLE mytablename MODIFY COLUMN colname VARCHAR(191)_newtype" DBNAME
echo "finish"
def normDateRange(strDate): strDate = wf2nf.wf2nf(strDate) d = datetime.datetime.now() ts = int(d.timestamp()) oneDay = 86400 # 24*60*60 listMonthWith31day = [1, 3, 5, 7, 8, 10, 12] listMonthWith30day = [4, 6, 9, 11] theYear = d.year theDay = d.day theMonth = d.month theWeekday = d.weekday() regex = r"(這|上|下)?週末" match = re.search(regex, strDate, re.MULTILINE) if match != None: day2Weekend = 6 - theWeekday tsEnd = ts + day2Weekend * oneDay tsStart = tsEnd - oneDay if match.group(1) == "上": tsStart -= 7 * oneDay tsEnd -= 7 * oneDay elif match.group(1) == "下": tsStart += 7 * oneDay tsEnd += 7 * oneDay dtStart = datetime.datetime.fromtimestamp(tsStart) dtEnd = datetime.datetime.fromtimestamp(tsEnd) return [dtStart.year, dtStart.month, dtStart.day, dtEnd.year, dtEnd.month, dtEnd.day] regex = r"(這|上|下)(週|周|禮拜|星期)" match = re.search(regex, strDate, re.MULTILINE) if match != None: if match.group(1) == "上": tsEnd = ts - (theWeekday + 1) * oneDay # last sunday tsStart = tsEnd - (6 * oneDay) # last monday elif match.group(1) == "下": day2Weekend = 7 - theWeekday tsStart = ts + day2Weekend * oneDay tsEnd = tsStart + ( 6 * oneDay ) elif match.group(1) == "這": tsStart = ts - (theWeekday * oneDay ) tsEnd = tsStart + ( 6 * oneDay ) else: return [-1] dtStart = datetime.datetime.fromtimestamp(tsStart) dtEnd = datetime.datetime.fromtimestamp(tsEnd) return [dtStart.year, dtStart.month, dtStart.day, dtEnd.year, dtEnd.month, dtEnd.day] regex = r"(明年|去年|前年)?([零一二兩三四五六七八九十0123456789]+)月" match = re.search(regex, strDate, re.MULTILINE) if match != None: if match.group(1) == "明年": theYear += 1 elif match.group(1) == "去年": theYear -= 1 elif match.group(1) == "前年": theYear -= 2 theMonth = chinese_to_arabic2(match.group(2)) if theMonth in listMonthWith31day: result = [theYear, theMonth, 1, theYear, theMonth, 31] elif theMonth in listMonthWith30day: result = [theYear, theMonth, 1, theYear, theMonth, 30] elif theMonth == 2: ts = datetime.datetime(year=theYear, month=(theMonth+1), day=1).timestamp() d2 = datetime.datetime.fromtimestamp(ts - oneDay) result = [theYear, theMonth, 1, theYear, theMonth, d2.day] else: result = [-1] return result regex = r"下個?月" match = re.search(regex, strDate, re.MULTILINE) if match != None: theMonth += 1 if theMonth in listMonthWith31day: lastDay = 31 elif theMonth in listMonthWith30day: lastDay = 30 elif theMonth == 2: ts = datetime.datetime(year=theYear, month=(theMonth+1), day=1).timestamp() d2 = datetime.datetime.fromtimestamp(ts - oneDay) lastDay = d2.day elif theMonth == 13: theYear += 1 theMonth = 1 lastDay = 31 else: return [-1] return [theYear, theMonth, 1, theYear, theMonth, lastDay] regex = r"上個?月" match = re.search(regex, strDate, re.MULTILINE) if match != None: theMonth -= 1 if theMonth in listMonthWith31day: lastDay = 31 elif theMonth in listMonthWith30day: lastDay = 30 elif theMonth == 2: ts = datetime.datetime(year=theYear, month=(theMonth+1), day=1).timestamp() d2 = datetime.datetime.fromtimestamp(ts - oneDay) lastDay = d2.day elif theMonth == 0: theYear -= 1 theMonth = 12 lastDay = 31 else: return [-1] return [theYear, theMonth, 1, theYear, theMonth, lastDay] return [-1]
-A INPUT -p tcp -m tcp --dport 80 -j TaiwanIP
:INPUT DROP [27:1852]
:FORWARD ACCEPT [0:0]
:OUTPUT ACCEPT [164:21816]
:TaiwanIP - [0:0]
iptables -N TaiwanIP
sudo iptables-restore < /etc/iptables.rulesP.S. 有些單位的IP範圍不在清單上,好像是比較敏感的單位。
# -*- coding: utf-8 -*- ''' 產生台灣IP清單及iptables指令 ''' import urllib.request import pandas as pd import ipaddress from bs4 import BeautifulSoup response = urllib.request.urlopen('https://rms.twnic.net.tw/twnic/User/Member/Search/main7.jsp?Order=ORG.ID') html = response.read().decode(response.headers.get_content_charset()) soup = BeautifulSoup(html, 'html.parser') listTagTable = soup.find_all('table') df = pd.read_html( str(listTagTable[5]),header=0 )[0] def getIP(x): ipStart, ipEnd = x.split(' - ') ipStartInt = int(ipaddress.IPv4Address(ipStart)) ipEndInt = int(ipaddress.IPv4Address(ipEnd)) return pd.Series([ipStart, ipEnd, ipStartInt, ipEndInt], index=['ipStart', 'ipEnd', 'ipStartInt', 'ipEndInt']) df2 = df.iloc[:,3].apply( getIP ) #只一行Series,可以不指定axis df['ipStart'] = 0 df['ipEnd'] = 0 df['ipStartInt'] = 0 df['ipEndInt'] = 0 df[ ['ipStart', 'ipEnd', 'ipStartInt', 'ipEndInt'] ] = df2 df = df.sort_values(by=['ipStartInt']) dicMerge = {'name':[df.iloc[0, 0]] , 'ID':[df.iloc[0, 1]] , 'ipStart':[df.iloc[0, 5]] , 'ipEnd':[df.iloc[0, 6]] , 'ipStartInt':[df.iloc[0, 7]] , 'ipEndInt':[df.iloc[0, 8]] } rowN, colN = df.shape dicMergeIndex = 0 #下列For是將IP範圍相鄰的合併,如此只需一組 for i in range(1,rowN): if (df.iloc[i, 7] - dicMerge['ipEndInt'][dicMergeIndex]) == 1: dicMerge['ipEndInt'][dicMergeIndex] = df.iloc[i, :]['ipEndInt'] dicMerge['ipEnd'][dicMergeIndex] = df.iloc[i, :]['ipEnd'] else: dicMerge['name'].append(df.iloc[i, 0]) dicMerge['ID'].append(df.iloc[i, 1]) dicMerge['ipStart'].append(df.iloc[i, 5]) dicMerge['ipEnd'].append(df.iloc[i, 6]) dicMerge['ipStartInt'].append(df.iloc[i, 7]) dicMerge['ipEndInt'].append(df.iloc[i, 8]) dicMergeIndex += 1 dfTaiwanIP = pd.DataFrame(dicMerge) rowN2, colN2 = dfTaiwanIP.shape with open('TaiwanIP.txt', 'w', encoding='utf8') as f: for i in range(0, rowN2): f.write("-A TaiwanIP -m iprange --src-range %s-%s -j ACCEPT\n" % (dfTaiwanIP.iloc[i]["ipStart"], dfTaiwanIP.iloc[i]["ipEnd"]) ) #上述會產生一連串的iptables指令到TaiwanIP.txt這個檔案,直接貼到/etc/iptables.rules。但我是寫給"TaiwanIP" chain,故前面要有":TaiwanIP - [0:0]"
import sys import json import dateutil.parser # 檔案名,此檔包含從ckan抓回來的,資料集內的檔案清單 jsonFile = sys.argv[1] # 基準時間,時間格式是ISO 8601 baseTime = sys.argv[2] # 將Dataset的資料JSON讀出來 with open(jsonFile, 'r') as f: try: jsonDatasetMeta = json.load(f) except: print('-1') print('JSON format error') exit(1) # 將基準時間轉成時間變數 try: lastTime = dateutil.parser.parse(baseTime) except: print('-1') print('base time error') exit(1) if 'result' not in jsonDatasetMeta: print('-1') print('JSON file content error: result not in jsonDatasetMeta') exit(1) if 'resources' not in jsonDatasetMeta['result']: print('-1') print('JSON file content error: resources not in jsonDatasetMeta') exit(1) try: for file in jsonDatasetMeta['result']['resources']: fileCreated = dateutil.parser.parse(file['created'] + 'Z') if fileCreated > lastTime: print(file['url']) except Exception as e: print('-1') print('File created time error.') print(e) exit(1)
好不容易裝好IKEA買來的吊櫃,花了三天。 從組裝,鑽牆,上牆調水平,累死我了。