2017年9月29日 星期五

wINODWS 2012 R2 time sync W32TM

w32tm /config /manualpeerlist:"192.168.31.2" /syncfromflags:manual /reliable:yes /update
w32tm /resync
w32tm/query /status


https://technet.microsoft.com/en-us/library/cc731191(v=ws.10).aspx



http://www.sysadminlab.net/windows/configuring-ntp-on-windows-server-2012


Start from scratch
If you completely screwed up the config, you can always do the following command and it will completely erase and add a default W32time configuration:
Stop-Service w32time
w32tm /unregister
w32tm /register

2017年9月28日 星期四

connect Load balancer and static route

LInux base,

connect Load balancer and static route


Web server gateway
Default route:
10.229.3.0 to 0.0.0.0 eth0
0.0.0.0 to 192.168.10.254 eth1 (to LB)

powershell reset office 365 password

reset password

PS C:\> Set-MsolUserPassword -UserPrincipalName "30234653@stu.scs.cuhk.edu.hk" -NewPassword "Lriwsajiu456"

2017年7月24日 星期一

powershell check inactive user

last logon server user account  over 400 days

Search-ADAccount -UsersOnly -AccountInactive -TimeSpan 400 | ?{$_.enabled -eq $True} | Get-ADUser -Properties Name, sAMAccountName, givenName, sn | Select Name, sAMAccountName, givenName, sn


---------------------------------------------------------------------------------------------------------
Fine tune script over 400 days

Search-ADAccount -UsersOnly -AccountInactive -TimeSpan 400 | Get-ADUser -Properties Name, sAMAccountName, givenName, sn | Select Name, sAMAccountName, givenName, sn > c:\report\test1.txt


Search-ADAccount -UsersOnly -AccountInactive -TimeSpan 400 | Get-ADUser -Properties Name, sAMAccountName, givenName, sn | Select Name, sAMAccountName, givenName, sn | export-csv c:\report\test1.csv



-------------------------------------------------------------------------------------------------------

since day

Search-ADAccount -AccountInactive -DateTime 10/15/2015 | where {$_.ObjectClass -eq 'user'} | FT Name,ObjectClass –A > c:\temp\xxx.txt

-----------------------------------------------------------------------------------------------------
Base OU finding incative account

Search-ADAccount -UsersOnly -SearchBase "OU=Students,OU=SCS Users,DC=scs,DC=local" -AccountInactive -TimeSpan 400 | Get-ADUser -Properties Name, sAMAccountName, givenName, sn | Select Name, sAMAccountName, givenName, sn > c:\temp\test1.txt


"OU=Students,OU=SCS Users,DC=scs,DC=local"

Data center server 過熱對答

Dear Operator,

Recently our IBM SAN Storage DS4700 (installed at the bottom of Colo-2, CDC1 at PiChiu) has generated a lot of Critical Alerts, stating the device has exceeded its nominal temperature.
We have already tried our best to clear all unused objects around the device, and we checked the cooling system of the device is working properly, but the overheat situation still occur. Would you please help to take a look at this issue, and improve the cooling performance of Colo-2 accordingly?

Thank you very much.

Best regards,



------------------------------------------------------------------------------------------------------------------------------------------
We checked the temperature at the back side of COLO-2 was 31°C at 1000, July 24, 2017.  It is caused by compressor failure of one of the air conditioners in CDC1.  The anticipated recovered time of the captioned event is July 28, 2017 due to waiting for parts delivery.

At 1030, July 24, 2017, the on-duty computer operators had set up the cooling fan at the back side of COLO-2 and the temperature was dropped to 26°C at 1300, July 24, 2017.  We will monitor the temperature closely.


Please have a check of your servers in COLO-2.

2017年5月3日 星期三

Windows Time Sync

https://technet.microsoft.com/en-us/library/cc756549(v=ws.10).aspx


Verify

To perform this procedure, you must have membership in Administrators, or you must have been delegated the appropriate authority.
To verify that the Windows Time service is synchronizing correctly:
  1. Open a command prompt as an administrator. To open a command prompt as an administrator, click Start. In Start Search, type Command Prompt. At the top of the Start menu, right-click Command Prompt, and then click Run as administrator. If the User Account Control dialog box appears, confirm that the action it displays is what you want, and then click Continue.
  2. At the command prompt, type W32TM /resync, and then press ENTER.
  3. At the command prompt, type W32TM /query /status, and then press ENTER. The command displays the status of the Windows Time service synchronization. The Last Successful Sync Time line of the output displays the date and time that you ran the W32TM /resync command in the previous step. Also, check the computer name that is shown as the Source. This should be the name of a domain controller (or administrator-configured time server).
To confirm that the Windows Time service was synchronized successfully with its time source when you ran the W32TM /resync command, verify that Event ID 35 appears in the Event Viewer.

2017年3月1日 星期三

靈修減壓 簡短退修 程序

1.         靜坐 (10-20分鐘)
  • 找一處安全、寧靜,溫度和光線適中的地方坐下,然後關上所有響鬧裝置。
  • 端正坐著,輕輕閉目,收歛心神,短禱:「上帝,我在這裡,求你使我安靜、專心,走近你。」
  • 有意識地逐一放鬆身體各部份,特別是頭、頸、膞、手和腳。
  • 做三次深、長、細的呼吸,然後讓呼吸自動調節至自然。
  • 身體放鬆,心靈專注,默數呼吸五十至一百下。
2.         唱詩歌或頌讀詩篇 (10分鐘)
  • 用心地、細聲地唱一首讚美詩歌送給上帝。
  • 專注地慢慢誦讀一首詩篇,如33、43篇。
  • 用心留意自己的思想和感受,簡單地告訴上帝。
  • 又留意上帝在當下的的安慰和指引。
3.         默想大自然 (10-20分鐘)
  • 放眼大自然,選擇一種被造物作為觀賞對象,如花、草、樹、水、風等。
  • 運用眼睛觀看、用心細聽、用靈感通,透過此被造物與上帝談談人生世情。
  • 將帶來的重擔一一放下給造物主,再一次邀請祂參與你的生命和生活之中。
  • 最後,安靜3-5分鐘,在上帝面前默言不語。
4.         與上帝漫步離開
  • 慢慢地收拾行裝
  • 與上帝一同漫步,離開,直至你的意識轉到外物為止。
在簡短退修過程中,要放慢、放鬆、安靜和專注,全知、情、意地投入與上帝獨處。
讓上帝淨化我們的心靈,調整我們的脈搏,消解我們的紊亂。

2017年2月9日 星期四

Linux GZ and ungz comman


#!/bin/bash


# Set $DATE to current date and time
DATE="`date +%Y-%m-%d`"

 cd /backup
mysqldump -u root -pqazw123# mysql | gzip -c > mysql$DATE.sql.gz
mysqldump -u root -pqazw123# glpi | gzip -c > glpi$DATE.sql.gz


#mysqldump -u root -pqazw123# mysql > mysql$DATE.sql
#mysqldump -u root -pqazw123# glpi > glpi$DATE.sql


https://www.cyberciti.biz/faq/howto-compress-expand-gz-files/


gz
mysqldump -u root -pqazw123# mysql | gzip -c > mysql$DATE.sql.gz


ungz 

gzip -d file.gz