• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar
  • Skip to footer
jeremydeanonline.com

jeremydeanonline.com

computer nerd and dad in the coastal bend

  • Home
  • Pay Me
  • Contact
  • Blog
  • Tech

tech

wooden box computer case

September 8, 2018 by jeremy Leave a Comment

Back in 2014 I decided to draw up some plans to have my “Peepaw” build a box I could stick a computer in. Once I sent him the plans, he put it together in under a day. I picked it up and rigged it out. I use it to host virtual servers via Proxmox these days…

The fans from the side provide adequate ventilation – it idles around 50°C. Not super cool but good enough for my needs.

Wooden Computer Box Case

Filed Under: tech

custom computer desk

September 8, 2018 by jeremy Leave a Comment

I ordered a custom aluminum box from Custom Aluminum Boxes LLC back in 2014 and rigged it out with an i5-3570K and an ASUS SABERTOOTH Z77 motherboard along with a lot of other gear to build a “tech workbench” PC that I could use for coding as well as hardware diagnostics and repair.

I had to use and angle-grinder to make the cuts for the fans and I/O panel and expansion cards. Not as clean as I hoped but it serves it’s purpose. Still running strong at the time of this posting and I’ll probably have this sucker forever.

Fun project.

View post on imgur.com

Filed Under: tech

powershell rebooter

February 4, 2017 by jeremy Leave a Comment

This is a quick and simple script I came up with to reboot a PC with a warning and a timer. I’ve always wanted to write something like this to force people to reboot their computers, but of course the problem is always “what if they’re in the middle of something when the rebooter kicks off?”. So I think this should work nicely. Although I’ve written batch files for years, I am a newbie to Powershell and certainly to the Powershell GUI interface. I plan to polish this up, but this works and serves its intended purpose (at least on the PCs I’ve tried it on). I cannot take credit for all of the code, as noted in the comments on the first lines. I found something similar and tweaked it to meet my needs – I think that’s a given this day and age, but I want to give credit where it is due. Here’s a screenshot:

And here is the code (thanks to hilite.me for making it so easy to highlight this properly in html):

#Displays a message warning user that PC will reboot in a specified number of seconds.
#Found original code at https://stackoverflow.com/questions/40575025/powershell-close-form-after-time-period 
#by esperento57 (https://stackoverflow.com/users/3735690/esperento57)
#I edited the code to suit my needs
#RUN set-executionpolicy unrestricted
Add-Type -AssemblyName System.Windows.Forms
Add-Type -AssemblyName System.Drawing

Function ClearAndClose() 
{
$Timer.Stop(); 
$Form.Close(); 
$Form.Dispose();
$Timer.Dispose();
$Label.Dispose();
$Button.Dispose();

}

Function Button_Click()
{
ClearAndClose
}

Function Timer_Tick()
{

$Label.Text = "PC will reboot automatically in $Script:CountDown seconds unless you press the big button below. This is an automated task set to run once every twenty-four hours. PCs in our environment need to be rebooted regularly to ensure optimal performance."
 --$Script:CountDown
 if ($Script:CountDown -lt 0)
 {
	ClearAndClose
 }
}


$Form = New-Object system.Windows.Forms.Form
$Form.Text = "Rebooter"
$Form.Size = New-Object System.Drawing.Size(530,330)
$Form.StartPosition = "CenterScreen"
$Form.Topmost = $True

$Label = New-Object System.Windows.Forms.Label
$Label.Size = New-Object System.Drawing.Size(510,100)
$Label.Location = New-Object System.Drawing.Size(100,500)
$Label.location = new-object system.drawing.point(6,6)


$Button = New-Object System.Windows.Forms.Button
$Button.Location = New-Object System.Drawing.Size(120,115)
$Button.Size = New-Object System.Drawing.Size(260,120)
$Button.Text = "Click Here To CANCEL REBOOT"
$Button.DialogResult=[System.Windows.Forms.DialogResult]::OK

$Timer = New-Object System.Windows.Forms.Timer
$Timer.Interval = 1000

$Form.Controls.Add($Label)
$Form.Controls.Add($Button)

$Script:CountDown = 10

$Button.Add_Click({Button_Click})
$Timer.Add_Tick({ Timer_Tick})


$Timer.Start()
$Form.ShowDialog()
#Write-Host Countdown: $Script:CountDown
if ($Script:CountDown -lt 0){Restart-Computer}

Filed Under: tech Tagged With: powershell, powershell scripting, rebooter, windows scripting

Primary Sidebar

posts

  • my life (10)
  • tech (3)

Copyright © 2021 · Powered by Genesis Framework · WordPress

  • Facebook
  • LinkedIn
  • Email