2022年10月2日 星期日

Memo of GitLab Backup and Restore

1. Backup

Similar to the reference, first one (origin English) and second one (Chinese working note),

https://pikedom.com/migrate-gitlab-instance-to-new-host/#Backup_GitLab

https://davidlin12tw.wordpress.com/2018/08/07/%E5%B7%A5%E4%BD%9C%E6%97%A5%E8%AA%8C8-6%E4%BA%8C-1gitlab%E5%82%99%E4%BB%BD%E9%82%84%E5%8E%9F/

 

a. Config Backup

Which backup all config setting at "/etc/gitlab" and pack them to one .tar file.


b. Application data backup

Very simple and quick to follow from official GitLab menual as

https://docs.gitlab.com/ee/raketasks/backup_restore.html

Lots of settings you can try and set.


c. Host backup (opt)

This is optional for the hostkey or related stuffs. Usually not in daily / frequently backup.


2. Restore

Stop the GitLab related process is the first step.

Extract and restore application data and config files.

First the application data and then the config files if necessary.

Remember to run the "gitlab:check" to check all stored database / repositories.

 

Ref:

1. https://pikedom.com/migrate-gitlab-instance-to-new-host/#Backup_GitLab

2. https://davidlin12tw.wordpress.com/2018/08/07/%E5%B7%A5%E4%BD%9C%E6%97%A5%E8%AA%8C8-6%E4%BA%8C-1gitlab%E5%82%99%E4%BB%BD%E9%82%84%E5%8E%9F/

3. https://docs.gitlab.com/ee/raketasks/backup_restore.html


Other info:

http://mycodetub.logdown.com/posts/260395-gitlab-backup-restore-settings-notes


2022年7月30日 星期六

Memo of DevOps with GitLab system

 GitLab system composes with GitLab Server and GitLab Runner.

GitLab Server is the source and image repo single site (or other architecture depending).

GitLab Runner is the supporting tool to execute the CI / CD jobs and is able to be installed in lots different systems / environments.

Tips for DevOps with GitLab system:

1. For GitLab server,

If self-managed tier, install with Domain Name and certificate with HTTPS to provide GitLab container registry and well connections to GitLab Runners.


2. For GitLab runner,

An GitLab server can connect to many other GitLab runners with different application situations.

I had tried 3 types of GitLab runner:

- "shell" executor:

This type is the very conventional type to work in an environment with all supporting from bare machine. You have to prepare all necessaries (including git, compiler, builder, ... etc) and apply shell commands to build your application.

- "docker" executor:

This type is the basic docker environment to let your application build / run / deploy in a clean container environment. You are unable to use docker related commands such as: docker info, docker build, docker run to execute a docker. You are only able to use the built container environment as a clean starting point and close at the end.

- "docker" executor with socket binding:

This type is the advanced docker environment which lets you to proceed any docker related commands. It is recommended to apply this type if you want to build an image cleanly and execute during your CI / CD pipeline. This is the preferred method to build and run your applications with docker build and docker run commands.


Note:

a. "docker" executor with dind (docker in docker):

This is another type to execute docker commands in a docker environment. It is very straight forward thinking to execute a docker inside a docker environment. But there are some flaws to use this type from a docker developer view: https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-ci/

This type is like the parent-child relationship. You have one docker running and inside it, you start another docker. So the second docker is the child and the first one is the parent. This could go into nested problem. This type likes the "scale up" case.

b. "docker" executor with socket binding:

This is the recommended way to run docker commands from a docker environment. Though it seems still has some problems?

This type is like the sibling relationship. You have one docker running. Then you ask this docker to help you to create another running docker parallel. So you will see lots docker containers concurrently from the monitor. It likes the "scale out" case.


The debate could be continued.






2019年12月27日 星期五

利用Docker在Synology NAS上安裝Wekan

目的:
由於Trello免費版本開始限制看板上限,只好自己找個Open source的免費版本來玩看看。


必要條件:
1.可以安裝Docker的Synology NAS一台(詳細清單請洽Synology官網)
  或
2.Ubuntu或可安裝Docker的機器一台


概念:
利用MongoDB作為Wekan的data base,連結至Wekan的docker image,啟動Wekan docker image,即可開始使用。


詳細步驟:(以下以使用Docker UI安裝為主,command line當作參考)
1.從套件中心安裝Docker app

2.啟動Docker

3.從倉庫伺服器(Registry)搜尋MongoDB,安裝的版本是mogo:latest
建立新資料夾(如mongodb),用來放db資料,通常建在docker資料夾底下
設定以下參數:
container名稱:Wekan-db
設定儲存空間:掛載路徑 --> docker/mongodb:/data/db

command line:
    docker run -d --name Wekan-db -v /docker/mongodb:/data/db mongo

4.從倉庫伺服器搜尋Wekan,安裝的版本為mquandalle/wekan:latest
設定以下參數:
container名稱:Wekan
連接埠:本機連接埠:容器連接埠 --> 8888:8080:TCP
容器間連結:容器名稱:別名 --> Wekan-db:db
網路:bridge:bridge
環境設定:增加與修改下列參數:
MONGO_URL:mongodb://別名/db掛載路徑 --> mongodb://db/db
ROOT_URL:網站名稱:本機連接埠 --> http://yoursite.com:8888
PORT:更改成容器連接埠 --> 8080

command line:
    docker run -d --name Wekan --link "Wekan-db:db" -e "MONGO_URL=mongodb://db" -e "ROOT_URL=http://yoursite.com:8888" -p 8888:8080 mquandalle/wekan

5.等一到兩分鐘,連線到http://yoursite.com:8888。
開始註冊使用者,第一個新增的使用者為管理員。
記得要開通port 8888或設定的本機連接埠,不然無法從外面連進來。

可以寄E-mail來驗證使用者,但可能需要設定mail server?這部分目前還沒試驗。

6. Have fun !!!


參考資料:
(1) https://pastebin.com/Sx80JSNj
(2) https://medium.com/@jiajunxu/%E7%94%A8-docker-%E8%87%AA%E6%9E%B6%E7%9C%8B%E6%9D%BF%E7%AE%A1%E7%90%86%E5%B7%A5%E5%85%B7-wekan-87ba3108ed4



2019年6月23日 星期日

如何在Windows 10 Update後繼續使用舊注音 (ㄅ半) (2004更新可用)

舊注音只是不顯示,不是消失
舊注音只是不顯示,不是消失
舊注音只是不顯示,不是消失

很重要,說三次

即使之前已設定成功,但是只要經過大版本更新(ex: 1709->1803, 1803->1903)
舊注音就會變回成新注音(很不方便)

以下為重新設置法 (新設定舊注音請從第3步開始):

1. 進到"語言喜好設定" -> "中文" -> "選項"

2. 在"鍵盤"處確認是否有兩個"微軟注音",分別點開確認,其中有一個有選項,另一個沒有選項,把沒有選項的"微軟注音"刪除。
Note: 點開之後有選項的"微軟注音"是新注音,版本更新後預設出現
          點開之後沒有選項的是原先設定的舊注音,請先刪除

3. 下載以下登錄檔,並按右鍵 -> 合併 -> 登錄機器碼
微軟ㄅ半注音


4. 再進到"語言喜好設定" -> "中文" -> "選項" -> "鍵盤" -> "新增鍵盤"
會出現第二個"微軟注音",新增。
再把原先的"微軟注音"刪除,刪除點開之後有選項的那一個。
完成。
Note: 舊注音的圖示為左上角有缺角的ㄅ符號。
         如果刪錯了,再"新增鍵盤"回來,重新刪除一次,即可完成。

更新測試:1803, 1903可成功繼續使用舊注音

!!!注意!!!
從2004開始,必須要再打開相容性,把舊注音輸入法整合找回來(微軟真是ooxx)
在上述的步驟4前
(1)不需要再把沒有選項的"微軟注音"刪除
(2)開啟相容性,步驟如下:
a.點開有選項的"微軟注音" -> "選項" -> "一般"
b.拉到最底下,看到"相容性","使用舊版的微軟注音",請打開它
會輸入有的沒的問卷調查,隨你高興填寫(可以大力的寫還我舊注音)
c.有缺角的ㄅ符號就回來了(熟悉的ㄅ半最對味?)
   至於有選項的"微軟注音"就看施主高興要不要刪除它

更新:確定Windows 11 可使用此方法繼續使用舊注音

2018年4月14日 星期六

邪惡的春假

是春假不是過年,根本是增肥行程。
話不多說,上圖:
04/04
海棉蛋糕佐乳酪加新鮮草莓

04/05
奶油海棉蛋糕雙莓派對(草莓+藍莓)

04/06
現烤手作起士芋頭對話麵包
04/07
手作土鳳梨酥
04/08
香鬆戚風蛋糕佐新鮮青蔥

手工食物吃飽飽 XD



2016年7月18日 星期一

讓Windows 10 ~ 7變成NTP server

在搜尋程式中打regedit,開啟編輯器
使用RegEdit修改機器碼下列參數:

1. HKLM\SYSTEM\CurrentControlSet\services\W32Time\Parameters
參數 Type,類別 REG_SZ,資料 NTP

2. HKLM\SYSTEM\CurrentControlSet\Services\W32Time\Config\AnnounceFlags
數值設成5

3. HKLM\SYSTEM\CurrentControlSet\services\W32Time\TimeProviders\NtpServer
參數 Enable,類別 REG_DWORD,數值 1 (啟用NTPserver)


回到command line,cmd.exe中輸入:
1. 開機時自動啟動w32time程序
sc config w32time start= auto

2. 更新修改後的機器碼
w32tm /config /update

3. 檢查目前機器碼設定
w32tm /query /configuration


在工作管理員->服務->w32time 啟動

Ref: http://jamyy.us.to/blog/2015/10/7752.html

P.S.: Remember to turn off the firewall to let clients connecting to NTP server. (20190116 updated)

2015年4月18日 星期六

Install Git server on Synology NAS Note / 在Synology NAS上安裝Git Server筆記

文字筆記

1. 使用有管理員權限的帳號登入DSM
2. 控制台 -> 終端機&SNMP -> 終端機 -> 啟動SSH功能 -> 更改連接埠, ex: 5566
3. 套件中心 -> Git Server安裝啟用 -> 選擇可使用的使用者
4. NAS重新啟動
5. 新建Git Repository
    (1)  開新的共用資料夾, e.g.: GitRepo(在儲存空間1下)
    (2)  開在GitRepo中開新資料夾, e.g.: Gittest
    (3)  Git init : 用SSH
           用SSH登入(putty),切換至資料夾位置, e.g.: /volume1/GitRepo/Gittest
           鍵入"git init",產生".git"資料夾。
    (4)  Git init : 用TortoiseGit
           使用區域網路連至NAS中,找到"GitRepo/Gittest"後 ,按右鍵選"Git Create repository here"
           產生".git" 資料夾。
6. Clone資料夾
    (1)  在本機端選取資料夾按右鍵後,在url欄位中輸入:
 ssh :// {帳號} @ {NAS網址或IP} : {SSH port number} / {資料夾位置}
           資料夾位置e.g.: /volume1/GitRepo/Gittest
    (2) 輸入帳號密碼,Clone完成。


-----還未成功-----
7. Push資料夾 (完成1-6後,只能clone T_T)
    (1)  用SSH登入
    (2)  改資料夾權限讓group可以讀寫, e.g.:
              chmod -R 775 Gittest
              chgrp -R users Gittest
    (3)  應該可以Push了,位置同Clone的位置。
    (4)  因為每個資料夾要用SSH設定,且沒有GUI,故關閉Git Server... XD



Ref:
http://moonlightjuice.blogspot.tw/2013/09/git-synology-git-server.html
http://programingman.blogspot.tw/2015/03/synology-nas-git-server.html
http://forum.synology.com/enu/index.php



2015年4月17日 星期五

Git GUI Local Settings Note / Git本機端圖形介面安裝設定筆記

懶得截圖,文字筆記

For Windows (Win 7)

1. 先下載"msysGit"和"TortoiseGit"
    msysGit (主程式)
    http://msysgit.github.com/
    TortoiseGit (GUI,有語言包可下載)
    http://code.google.com/p/tortoisegit/
2. 先安裝"TortoiseGit",一直下一步就對了
3. 注意在選要使用的SSH客戶端(Choose SSH Client)要選擇TortoisePLink

    O TortoisePLink, coming from Putty, integrates with Windows better.
    X OpenSSH, Git default SSH Client

4. 安裝msysGit,一直下一步
5. 注意:
    (1)  Adjusting your PATH environment
         O Use Git Bash only
    (2)  Select Components
         O Simple context menu (Registry based)
             O Git Bash Here
             O Git GUI Here
    (3)  Choosing the SSH executable
         O Use (Tortoise)Plink
                C:\... directory of TortoisePlink
    (4)  Configuring the line ending conversions
         O Checkout Windows-style, commit Unix-style line endings
6. 試用
    (1)  新建資料夾, ex: GitTest
    (2)  進入後按右鍵,或不進入選取後按右鍵,選"Git Create repository here"
    (3)  跳出視窗直接選OK,並初始化
    (4)  產生".git"隱藏資料夾
    (5) 開始生產檔案和code ^_^

Ref:
http://shaocian.blogspot.tw/2013/01/windows-git-msysgit-tortoisegit.html
http://www.coder.com.tw/blog/system/windows_git_tortoisegit_msysgit/


For Linux (Ubuntu)

1. 進到Ubuntu Software Center中
2. 搜尋git
3. 安裝git主系統, 包含:git, git-receive-pack, git-shell, git-upload-archive, git-upload-pack
4. 搜尋Cola Git GUI
5. 安裝Cola Git GUI
6. 或是使用終端機指令
     sudo apt-get install git-core git-cola
7. 試用
    (1)  開新資料夾, ex: GitTest
    (2)  用終端機指令移到"GitTest"中,輸入
           git init
           產生".git"資料夾
    (3)  開啟Cola Git,可用open來開剛才產生完的"GitTest"或是遠端Clone
    (4)  開始生產檔案和code ^_^

Ref:
http://graphicalgit.blogspot.tw/2012/07/git-cola-git-gui-1.html

P.S.: 在VM裡面建的GitTest可在host中用Git管理

Dropbox/Cloud Station(Synology DSM)同步

1. Dropbox直接把資料夾丟上去就對了,Easy
2. 使用Cloud Station記得在
     設定 -> 同步規則 -> 選擇性同步資料夾下面勾選同步"."開頭的檔案與資料夾。
3. 丟資料夾上去,收工




2013年8月20日 星期二

透過xrdp讓Linux可被Windows遠端

1. 設定桌面分享
開始→桌面分享→勾選選項
(1)分享:允許使用者觀看與控制桌面
(2)安全性輸入密碼,取消確認每次連線
(3)通知區顯示:只在有人連線時

2.安裝XRDP
$ sudo apt-get install xrdp
更改port
$ sudo vim /etc/xrdp/xrdp.ini
[globals]
xxx
port=3389→修改
xxx

有用iptable記得把port打開
xrdp重新啟動
$ sudo /etc/init.d/xrdp restart

3.用Windows內建遠端桌面進行連線,完成

4.如果是空白畫面
安裝gnome-session-fallback,如下:
$ sudo apt-get install gnome-session-fallback
$ echo "gnome-session --session=ubuntu-2d" > ~/.xsession
$ sudo vim /etec/xrdp/startwm.sh  (
#. /etc/X11/Xsession
if [ -e $HOME/.xsession ]; then
. $HOME/.xsession
else
. /etc/X11/Xsession
fi
$ sudo /etc/init.d/xrdp restart

以上

2009年10月24日 星期六

Alternative English online broadcast....

oh!zone
http://www.ohzone.org/index.php

sounds like no more ads.... checking now.... XD

2009年10月21日 星期三

OpenCV scale image in member function

1. release old image pointer

2.create a new space using the image pointer

3. it should be work!!!

-------------
cvResize and cvReshape is not work for this purpose, I don't know why....XD

and create a pointer in the member function will be release after finished the member function....

2009年7月10日 星期五

FireFox 3.5

Nightly Tester Tools

http://briian.com/?p=139

好用 直接強制裝舊版的PCman plug-in

然後也可以強制裝一堆舊版的add-on

All-in-one gesture換成Firegesture了

感覺比較好用的樣子 不過要改設定 不然會卡卡的

2009年5月9日 星期六

五月

唔 時間為什麼要走這麼快...

要提高效率和同調率才行

之前看到一種睡眠法 不知道有沒有幫助

達文西睡眠

http://zh.wikipedia.org/wiki/%E9%81%94%E6%96%87%E8%A5%BF%E7%9D%A1%E7%9C%A0

不過可能先試著中間午睡然後睡少一點吧...

效率效率

2009年4月29日 星期三

跑步

嗚 太久沒跑了

體力變好差 一圈就被殺爆了

不行 下次要把它殺回來

Casey和維均大大好厲害 都跑好快喔 努力向他們學習

話說不知道是練拳的關係還怎樣 大腿從上星期因為招式蹲著

然後就一直酸到現在了>"< 而且可能換新鞋的關係 走路好像要比平常用力一點

今天跑了一小段而已 下次要多跑一點 而且要想辦法跟上

2009年4月24日 星期五

每日例行公事

睡覺前要帶著微笑入睡

希望可以打一趟拳

研究上要有新想法或是新動作

把這三項做到就好了 不多求

2009年4月22日 星期三

滿和卡

well 最近被一堆東西塞滿了

很多事情做起來都有點卡卡的

想辦法把每件事做好真的不容易

最近不是被改作業追殺 就是被寫作業趕著跑

雖然知道自己要趕快做研究 但是通常這時都又會有其他的東西interrupt >"<

唔....好想趕快把研究進度趕上來 覺得自己落後太多了>"<

要趕快加速加速 然後要面對挑戰 很多事情不做過一次會對不起自己

GoGoGo

2009年4月1日 星期三

恐怖的兩週

呼 暫時過完恐怖的兩週了 從一個要一直報告的星期一

一直到現在考完NM 這兩週一整個都在雜事和亂七八糟中渡過>"<

但是忙碌中也學到不少東西

像是第一次用英文上了三小時的課 雖然老師有幫忙

不過感覺不太一樣 和自己坐在下面聽差很多

也發現一些自己要注意的東西 如何把東西講清楚

如何帶大家討論問題(尤其是open question) 如何把上課的氣氛帶起來

不過上到最後發現自己在講什麼都不知道XD 這頗糟>"<

另外還有出了一次期中考考題

雖然英文還是破破爛爛

不過感覺出了一些有水準的題目還蠻開心的 當然更開心是有人可以寫出來^_^

忙碌的兩週 有點忙碌 但是收獲也不少 嗯 這種感覺不錯^_^

2009年3月27日 星期五

六日電視劇時間表

三立都會台

六 晚上9:00 敗犬女王
晚上10:30 比賽開始 ^_^ 好看

日 晚上8:00 老王同學會 (不是我認識的那個老王就是了)
晚上10:00 超級偶像??

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

上次的芭娜娜上路蠻好看的 探討的主題也很不錯

最近喜歡上看電視劇了 尤其是有題材的^_^

2009年3月17日 星期二

芭娜娜上路

http://www.youtube.com/watch?v=bbwqGQQPV9Y&feature=related

公視的人間劇場

過年有看過一部跟狐狸有關的 還不錯的系列

這部是郁君學姐大大推薦的 先暫記 希望有時間看