Weil Jimmer's BlogWeil Jimmer's Blog


Category:Bash

Found 2 records. Now is Page 1 / 1.

Grub 加入 VeraCrypt 開機選單 多系統
No Comments

Published:
Updated:2017-08-14 21:08:02

好久沒發文了,今天寫篇沒有程度的文章做個小筆記。

最近和同學聊天,正好扯到了加密硬碟,突然想到我自己的電腦 Win10 也是屬於未加密的一類,所以乾脆就用 VeraCrypt加密掉好了,可惜卻出現一個問題就是開機選單只能選單一系統,其他硬碟的系統好像偵測不到一樣,變成灰色的選項不給選。所以只好事後補修這個問題啦。

先開機進入BIOS重新選擇開機選單,開到特定Linux,安裝Grub,

apt-get install grub-efi

網路上似乎很少人講這個東西。即使有 issue 被提交了,但下面也沒啥人回應。

首先,打開目標文件:/boot/grub/grub.cfg,搜尋 menuentry 'Windows Boot Manager (on /dev/sdb1)'

然後複製整個 menuentry,在這邊直接修改是沒什麼效果的,到時候Update掉又被OverWritten,打開:/etc/grub.d/40_custom,

在下面直接加入整個 menuentry。以下是示範:

#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries.  Simply type the
# menu entries you want to add after this comment.  Be careful not to change
# the 'exec tail' line above.

menuentry 'Windows 10 VeraCrypt (on /dev/sdb1)' --class windows --class os $menuentry_id_option 'osprober-efi-B673-5372' {
	insmod part_gpt
	insmod fat
	set root='hd1,gpt1'
	if [ x$feature_platform_search_hint = xy ]; then
	  search --no-floppy --fs-uuid --set=root --hint-bios=hd1,gpt1 --hint-efi=hd1,gpt1 --hint-baremetal=ahci1,gpt1  B673-5372
	else
	  search --no-floppy --fs-uuid --set=root B673-5372
	fi
	chainloader /EFI/VeraCrypt/DcsBoot.efi
}

直接改掉 chainloader 的資訊,對應到 /EFI/VeraCrypt/DcsBoot.efi 即可。最後直接輸入指令:

update-grub

這樣就大功告成了。

By Weil Jimmer


This entry was posted in Bash, General, Experience, Note By Weil Jimmer.

Bash 自動備份網站與異地備份
No Comments

Published:
Updated:2016-07-25 17:48:02

這是我現在所用的方法,直接分享出來,備份壓縮網站資料與資料庫十日,自動刪除近十日之外的檔案。

建立一個 backup.sh 檔案,內容如下:(FTP地址帳密、網站路徑、資料庫密碼…要自己修改一下)

#!/bin/sh

THESITE="example.com"
THEDATE=$(date +%Y-%m-%d_%H_%M_%S)

mysqldump --defaults-file=/home/user/secret.cnf --user=root --host=localhost --all-databases | gzip > /var/www/$THESITE/backup/db_$THEDATE.sql.gz

tar czf /var/www/$THESITE/backup/site_${THEDATE}.tar /var/www/$THESITE/public_html/
gzip /var/www/$THESITE/backup/site_${THEDATE}.tar

find /var/www/$THESITE/backup/site* -mtime +10 -exec rm {} \;
find /var/www/$THESITE/backup/db* -mtime +10 -exec rm {} \;

echo "OK"

ftp -n 31.170.xxx.xxx <<End-Of-Session
user USERNAME "PASSWORD"
binary
cd /public_html/backup/secret_path
put "/var/www/$THESITE/backup/db_$THEDATE.sql.gz" "db_backup.sql.gz"
put "/var/www/$THESITE/backup/site_${THEDATE}.tar.gz" "site_backup.tar.gz"
bye
End-Of-Session

wget http://backupsite.com/ -O /tmp/keep_online
rm /tmp/keep_online

創一個文檔在 /home/user/secret.cnf (或你喜歡的地方),然後設定權限 400 或 600 內容填入如下。

[client]
password="MYSQL_PASSWORD"

最後 在終端機 打指令

crontab -e

在最下面加入:(設定定時任務,零時零分自動備份網站並透過FTP外寄出去)

0 0 * * * sh /the_path_you_want/backup.sh

這樣就可以完成幾乎全自動的備份。


This entry was posted in Bash, General, Experience, Functions, Note, WebHosting By Weil Jimmer.

 1 /1 頁)

Visitor Count

pop
nonenonenone

Note

WPA2 已被 KRACK 攻擊破解!請更新 WiFi 軟體。

歡迎前來本站。

Search

Republic Of China
Privacy is your right and ability to be yourself and express yourself without the fear that someone is looking over your shoulder and that you might be punished for being yourself, whatever that may be.

It is quality rather than quantity that matters.

I WANT Internet Freedom.

Reality made most of people lost their childishness.

Justice,Freedom,Knowledge.

Support/Donate

This site also need a little money to maintain operations, not entirely without any cost in the Internet. Your donations will be the best support and power of the site.
MethodBitcoin Address
bitcoin1NRMVGGpm2T1pmeejisLSEhCXfCefEW9V4
paypal

The Lie We Live

youtube

The Questions We Never Ask

youtube

Support The Zeitgeist Movement

The Zeitgeist Movement

Man

youtube

In The Fall

youtube

Facebook is EATING the Internet

Facebook

Recent Comments

sickcatail on STEAM免費序號

包包 on STEAM免費序號

問問題 on 最棒的手機通訊軟體 Telegram

unocme on STEAM免費序號

窩仔 on STEAM免費序號

Categories

Announcement (4)

Bash (2)

C (1)

C# (4)

C++ (1)

Experience (38)

Flash (2)

Free (10)

Functions (35)

Games (13)

General (44)

HTML (7)

Java (12)

JS (7)

Mood (23)

Note (24)

Office (1)

PHP (9)

Privacy (3)

Product (9)

Python (4)

Software (8)

The Internet (15)

Tools (12)

VB.NET (8)

WebHosting (7)

Wi-Fi (5)

XML (4)