Full Screen Ubuntu/Fedora in Hyper-V

——————Fedora / CentOS————————-

grubby --update-kernel=ALL --args="video= hyperv_fb:1920x1080"

——————Ubuntu / Kali————————-


 sudo nano /etc/dafault/grub

change
 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash"
 to...
 GRUB_CMDLINE_LINUX_DEFAULT="quiet splash video=hyperv_fb:1920x1080" (in my case my screen resolution is 1920x1080)

sudo reboot

————-after reboot ——

sudo update-grub
sudo reboot

——————————————

[Scripts] Send-MailMessage with For loop

課堂上想起來老師曾經提到的Send-MailMessage,就自己用windows 2012 R2 架了一個SMTP Server,然後寫了這一個小script。

$bomb = 2

$From = 'demo@demogmail.com'
$To = 'demo@demogmail.com'
$Subject = 'Hello World!'
$Body = 'I <3<3<3<3<3 Powershell'
$SMTPServer = "localhost"
$SMTPPort = "25"




for($i=1; $i -le $bomb; $i++) {

Send-MailMessage -From $From `
                 -to $To `
                 -Subject $Subject `
                 -Body $Body `
                 -SmtpServer $SMTPServer `
                 -port $SMTPPort
}