用C#寫了一個BarCodeChecker
用visual studio 2017 練習開發BarCodeChecker, 總共有兩個版本,一個是離線版用access, 一個是mssql, 有興趣的可以參考參考

https://bitbucket.org/inmethod/barcodechecker/src/scan_warning_if_multiple_mssql/BarCode/disks/
用visual studio 2017 練習開發BarCodeChecker, 總共有兩個版本,一個是離線版用access, 一個是mssql, 有興趣的可以參考參考
https://bitbucket.org/inmethod/barcodechecker/src/scan_warning_if_multiple_mssql/BarCode/disks/
公司某天刷臉機器因停電造成時間錯誤, IT人員未即時更新(因為週六), 導致少數加班人員吃飯刷卡紀錄錯誤,少了11小時, 因此必須加回去原本的資料庫 , 可使用 dateadd(hour, 預加或減的小時數字, 欄位名稱) 的方式處理.
update dbo.KQZ_Card set CardTime= dateadd(hour,11,KQZ_card.CardTime) where DevID=9 and year(CardTime)=2019 and Month(CardTime)=4 and day(CardTime)=27;
最近筆電預載的office很難移除, 若買來馬上就安裝之前已經購買舊版的office並且啟用,最後還是會遇要你啟用的訊息,真是有夠麻煩的.
以下是啟用的相關步驟
1. 開始->最近新增
會出現一堆app, 請手動解除安裝所有office
2. 開始->設定-> 應用程式
會出現一堆app, 再看一次是否有漏掉的office沒解除
3.下載解除程式
按這裡下載官方的程式,或是上官網下載, 然後執行解除任務, 有可能會出現未成功, 請重開機後再執行一次
4. 執行 regedit
刪除以下連結所有資料 , 或是參照官網的建議
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\Office
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Office\
visual studio code 是微軟出品的跨平台開源軟體, 該軟體跳脫了編輯器的功能, 整合了開發, 版本控管,與很多第三方擴充的功能, 一般直接稱作 vscode 或是 code.
咖啡偶直到現在才發現, 使用了一下, 發現不得了, 非常好用, 尤其內建git版本控管, 檔案總管, 終端機,與powershell功能, 真讓人可以不管用哪個作業系統, 都能一個環境習慣到底呢, 其實可以取代notepad++了.
這裡紀錄一下ubuntu初用vscode的注意事項.
1. 安裝
直接使用網站的檔案即可
2. 重設vscode環境,回到初始值
刪除 /home/帳號/.config/Code
1. vi /etc/dovecot/conf.d/10-auth.conf uncommand the following setting #!include auth-ldap.conf.ext as !include auth-ldap.conf.ext
2. vi /etc/dovecot/conf.d/auth-ldap.conf.ext
auth_username_format = %Lu
passdb ldap {
args = /etc/dovecot/dovecot-ldap.conf.ext
}
userdb static {
args = uid=501 gid=501 home=/home/vmail/%u
}
3. vi /etc/dovecot/dovecot-ldap.conf.ext
hosts = ad_server_ip
base = dc=test,dc=com,dc=tw
ldap_version = 3
auth_bind = yes
ldap_version = 3
auth_bind_userdn = test%u
pass_filter = (&(objectclass=person)(uid=%u))
ps. uid and gid must the same with postfix and directory in linux server
ex: create one user "vmail"
user id is 501 , gid is 501
4. postfix's main.cf
virtual_mailbox_domains = $mydomain
virtual_mailbox_base = /home/vmail/
virtual_mailbox_maps = ldap:/etc/postfix/ldap-users.cf
virtual_uid_maps = static:501
virtual_gid_maps = static:501
virtual_alias_maps = hash:/etc/aliases,ldap:/etc/postfix/ldap-aliases-inner.cf
#smtp auth
smtpd_sasl_auth_enable = yes
smtpd_sasl_authenticated_header = no
smtpd_sasl_local_domain =
smtpd_sasl_security_options = noanonymous
broken_sasl_auth_clients = yes
#additional param
message_size_limit = 40960000
smtpd_helo_required = yes
disable_vrfy_command = yes
strict_rfc821_envelopes = yes
bounce_queue_lifetime = 1d
maximal_queue_lifetime = 1d
data_directory = /var/db/postfix
header_checks = regexp:/etc/postfix/header_checks
smtp_host_lookup = native, dns
...
5. vi /etc/postfix/ldap-users.cf
server_host = ad_server_ip
search_base = dc=test,dc=com,dc=tw
version = 3
query_filter = (&(objectclass=*)(mail=%s))
result_attribute = samaccountname #Account from DC
result_format = %s/Maildir/
bind = yes
bind_dn = cn=ldap,cn=Users,dc=test,dc=com,dc=tw
bind_pw = ldappassword
6. vi //etc/sysconfig/saslauthd
# Directory in which to place saslauthd's listening socket, pid file, and so
# on. This directory must already exist.
SOCKETDIR=/var/run/saslauthd
# Mechanism to use when checking passwords. Run "saslauthd -v" to get a list
# of which mechanism your installation was compiled with the ablity to use.
#MECH=pam
MECH=ldap
# Additional flags to pass to saslauthd on the command line. See saslauthd(8)
# for the list of accepted flags.
FLAGS="-O /etc/postfix/saslauthd.conf -c -r"
7. vi /etc/postfix/saslauthd.conf
ldap_servers: ldap://ad_server_ip:389/
ldap_search_base: dc=test,dc=com,dc=tw
ldap_auth_method: bind
ldap_version: 3
ldap_bind_dn: cn=ldap,cn=Users,dc=test,dc=com,dc=tw
ldap_bind_pw: ldappassword
ldap_filter: (sAMAccountName=%u)
8. vi /etc/postfix/ldap-aliases-inner.cf
server_host = ad_server_ip
search_base = dc=test,dc=com,dc=tw
#scope = sub
query_filter = (memberOf:1.2.840.113556.1.4.1941:=CN=%s,OU=aliases_inner,DC=test,DC=com,DC=tw)
result_attribute = mail
result_format = %s
version = 3
bind = yes
bind_dn = cn=ldap,cn=Users,dc=test,dc=com,dc=tw
bind_pw = ldappassword
w32tm /config /manualpeerlist:"time.stdtime.gov.tw clock.stdtime.gov.tw
tick.stdtime.gov.tw tock.stdtime.gov.tw watch.stdtime.gov.tw,0×4"
/syncfromflags:manual /reliable:yes /update
w32tm /resync /nowait /rediscover
net time /querysntp
公司ERP(tiptop) 使用 linux 系統(RHEL5)
因此登入的時候若能整合AD
將是再好不過了.
初期網路上找一找,很快就能使用AD帳號登入
http://www.linuxmail.info/active-directory-linux/
但是若公司有多個網域怎麼辦呢?
這個我試了很多次都失敗
後來將samba升級成3.5.x,就可以完成了.
以下是簡單步驟
1. 網域須互相信任(互相信任時,須提供共用帳號與密碼)
2. samba升級成3.5.x
3. 在linux上使用上述互相信任的帳號,執行加入網域指令
net rpc join -U <信任帳號>
net ads join -U <信任帳號>
4. 重開winbind
5. 檢查是否成功
getent passwd
若出現多網域使用者訊息,即代表成功.
6. 開心登入囉, 登入時帳號格式: "domain alias""account"
ex:
yahoouserwilliam
ps. 重點在於rhel 5.5 的samba只能更新到3.0.x, 必須另外找方式升級到3.5.x
我的環境:
rhel 5.5
samba 3.5.x
--
後記
當這樣做的時候,可能會造成原本passwd上面帳號認證的錯誤
請修改/etc/pam.d/system-auth
將uid500改成passwd上最大的uid號碼即可
因為工作需要寫windows application, 初期使用java(netbean) + SQLite(3.6.x) 的方式進行
沒想到sqlite 的insert效率奇差無比, 只好選擇別種資料庫.
改用 h2(1.1.x) , insert的效率變好了,但是select的效率變得很差.
再改用 hsql(2.0) , 各方面的效率都變快,真是太棒了.