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

2016年12月21日 星期三

Action Plan in Dec 22 Pichiu change trunk configuration

Action Plan in Dec 22 Pichiu change trunk configuration

PC-SW01

interface Port-channel2
 description connect to PC-SIS-SW01 1/0/49-2/0/49
 switchport trunk allowed vlan 1,4,6
 switchport mode trunk



interface GigabitEthernet1/0/52
 switchport trunk allowed vlan 1,4,6
 switchport mode trunk
 spanning-tree portfast
 channel-group 2 mode on


interface GigabitEthernet2/0/52
 switchport trunk allowed vlan 1,4,6
 switchport mode trunk
 spanning-tree portfast
 channel-group 2 mode on





PC-SIS-SW01


interface Port-channel6
 description connect to PC-SW01 SW02 1/0/52 2/0/52
 switchport trunk allowed vlan 1,4,6
 switchport mode trunk


interface GigabitEthernet1/0/49
 description connect to PC-Sw01 1/0/52 trunk link
 switchport trunk allowed vlan 1,4,6
 switchport mode trunk
 spanning-tree portfast
 channel-group 6 mode on

interface GigabitEthernet2/0/49
 description connect to PC-SW02 2/0/52 trunk link
 switchport trunk allowed vlan 1,4,6
 switchport mode trunk
 spanning-tree portfast
 channel-group 6 mode on

2016年5月23日 星期一

Cisco upgrade and downgrade IOS

https://supportforums.cisco.com/document/98421/how-upgrade-or-downgrade-ios-isr-or-similar-router


Potential Caveats:
Usually these would only affect older routers but the main caveats would be ensuring there is enough system memory (RAM) and also flash to store the new IOS.
Step 1: Get the new IOS to the router.
If you are onsite then often the simplest way to get the new IOS to the router is to copy the IOS to a flash card, or on newer ISR G2s, USB thumb drive.
Otherwise you would copy the file to the router using TFTP, FTP, etc.  Detailed instructions for this step are out of scope but an example would be:
copy ftp: flash:       
(Follow the prompts for server IP and file name.)

Step 2: Verify the integrity of the new IOS binary
The next step we take is to verify that the IOS was not corrupted during transit or copying.
verify flash:c2800nm-advsecurityk9-mz.150-1.M8.bin
Success will show that the calculated MD5 hash is the same as the embedded hash.
Step 3: Change the boot statements to ensure that the correct IOS loads after restart
We need to remove the old boot statement(s) and add the new one.  (There are other ways to select which IOS to run but this is the simplest method.)
a. examine the current boot statement(s)
show run | include boot
boot-start-marker
boot system flash:c2800nm-advsecurityk9-mz.12.4-15.T3.bin
boot-end-marker
b. remove the old boot statement  (Output in step a)
config t
no boot system flash:c2800nm-advsecurityk9-mz.12.4-15.T3.bin
c. add the new boot statement  (this will include the file name of the new binary)
boot system flash:c2800nm-advsecurityk9-mz.15.0-1-M8.bin
Step 4: Save configuration changes
While still in configuration mode from before:
end
write memory
show start | include boot
boot-start-marker
boot system flash:c2800nm-advsecurityk9-mz.15.0-1-M8.bin
boot-end-marker
To recap all of the commands (in this example) would then be:
show run | include boot
config t
no boot system flash:c2800nm-advsecurityk9-mz.12.4-15.T3.bin
boot system flash:c2800nm-advsecurityk9-mz.15.0-1-M8.bin
end
write memory
show start | include boot
Step 5: Reload the device and verify that the correct IOS has loaded
For normal ISR's the only way to change the IOS is to reload the device.  (ISSU, In-Service Software Upgrade, is not currently supported.)
After the device has reloaded please do a "show version" and confirm that the router is now running the correct version of IOS. 
Then you are done.

2016年5月16日 星期一

Fortigate SCp backup command with linux

https://blog.linuxnet.ch/scp-backup-of-fortinet-configuration/


To create a Fortigate Backup you only need to copy the sys_config via SCP from the Firewall.
The following describes the steps to do a backup and to setup the SSH/SCP on the Fortigate:
  • Enable SSH Access on the Interface:
config system interface
edit <interface name>
set allowaccess ping https ssh
end
  • Enable SCP on the firewall
config system global
set admin-scp enable
end
  • Add Users Public Key
config system admin
edit admin
set ssh-public-key1 "ssh-rsa ... user@hostname.com"
next
end
  • Backup using SCP
From Linux:
scp admin@<fortinet-ip-address>:fgt-config /backup
From Windows:
pscp admin@<fortinet-ip-address>:fgt-config /backup

2016年5月3日 星期二

reset fortigate password

http://docs.fortinet.com/uploaded/files/1708/Resetting_a_lost_admin_password.pdf

. Now you should be connected to the firewall. To change the admin password you type the following… In a unit where vdoms are not enabled:


config system admin
edit admin set password (XXXXXX)