iWIN 必須被解散!

Weil Jimmer's BlogWeil Jimmer's Blog


Category:Bash

Found 2 records. At Page 1 / 1.

Grub 加入 VeraCrypt 開機選單 多系統

No Comments
-
更新於 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
-
更新於 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

支持網路中立性.
Support Net Neutrality.

飽暖思淫欲,饑寒起盜心。

支持臺灣實施無條件基本收入

歡迎前來本站。

Words Quiz


Search

Music

Blogging Journey

4257days

since our first blog post.

Republic Of China
The strong do what they can and the weak suffer what they must.

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.

Without music life would be a mistake.

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
bitcoin1gtuwCjjVVrNUHPGvW6nsuWGxSwygUv4x
buymeacoffee
Register in linode via invitation link and stay active for three months.Linode

Support The Zeitgeist Movement

The Zeitgeist Movement

The Lie We Live

The Lie We Live

The Questions We Never Ask

The Questions We Never Ask

Man

Man

THE EMPLOYMENT

Man

In The Fall

In The Fall

Facebook is EATING the Internet

Facebook

Categories

Android (7)

Announcement (4)

Arduino (2)

Bash (2)

C (3)

C# (5)

C++ (1)

Experience (51)

Flash (2)

Free (13)

Functions (36)

Games (13)

General (58)

Git (1)

HTML (7)

Java (13)

JS (7)

Mood (24)

NAS (2)

Note (31)

Office (1)

OpenWrt (5)

PHP (9)

Privacy (4)

Product (12)

Python (4)

Software (11)

The Internet (24)

Tools (16)

VB.NET (8)

WebHosting (7)

Wi-Fi (5)

XML (4)