# Tips & Misc

Short tips, references and device notes.

# MarkDown - Guide .md

<div id="bkmrk-%23-markdown-cheat-she"><div>\# Markdown Cheat Sheet</div>  
<div>Thanks for visiting [The Home Stack](https://www.sflservicesllc.com)!</div>  
<div>This Markdown cheat sheet provides a quick overview of all the Markdown syntax elements. It can’t cover every edge case, so if you need more information about any of these elements, refer to the reference guides for [basic syntax](https://www.markdownguide.org/basic-syntax/) and [extended syntax](https://www.markdownguide.org/extended-syntax/).</div>  
<div>\## Basic Syntax</div>  
<div>These are the elements outlined in John Gruber’s original design document. All Markdown applications support these elements.</div>  
<div>\### Heading</div>  
<div>\# H1</div><div>\## H2</div><div>\### H3</div>  
<div>\### Bold</div>  
<div>**bold text**</div>  
<div>\### Italic</div>  
<div>*italicized text*</div>  
<div>\### Blockquote</div>  
<div>&gt; blockquote</div>  
<div>\### Ordered List</div>  
<div>1. First item</div><div>2. Second item</div><div>3. Third item</div>  
<div>\### Unordered List</div>  
<div>- First item</div><div>- Second item</div><div>- Third item</div>  
<div>\### Code</div>  
<div>`code`</div>  
<div>\### Horizontal Rule</div>  
<div>---</div>  
<div>\### Link</div>  
<div>[Markdown Guide](https://www.markdownguide.org)</div>  
<div>\### Image</div>  
<div>![alt text](https://www.markdownguide.org/assets/images/tux.png)</div>  
<div>\## Extended Syntax</div>  
<div>These elements extend the basic syntax by adding additional features. Not all Markdown applications support these elements.</div>  
<div>\### Table</div>  
<div>| Syntax | Description |</div><div>| ----------- | ----------- |</div><div>| Header | Title |</div><div>| Paragraph | Text |</div>  
<div>\### Fenced Code Block</div>  
<div>```</div><div>{</div><div> "firstName": "John",</div><div> "lastName": "Smith",</div><div> "age": 25</div><div>}</div><div>```</div>  
<div>\### Footnote</div>  
<div>Here's a sentence with a footnote. [^1]</div>  
<div>[^1]: This is the footnote.</div>  
<div>\### Heading ID</div>  
<div>\### My Great Heading {#custom-id}</div>  
<div>\### Definition List</div>  
<div>term</div><div>: definition</div>  
<div>\### Strikethrough</div>  
<div>~~The world is flat.~~</div>  
<div>\### Task List</div>  
<div>- [x] Write the press release</div><div>- [ ] Update the website</div><div>- [ ] Contact the media</div>  
<div>\### Emoji</div>  
<div>That is so funny! :joy:</div>  
<div>(See also [Copying and Pasting Emoji](https://www.markdownguide.org/extended-syntax/#copying-and-pasting-emoji))</div>  
<div>\### Highlight</div>  
<div>I need to highlight these ==very important words==.</div>  
<div>\### Subscript</div>  
<div>H~2~O</div>  
<div>\### Superscript</div>  
<div>X^2^</div></div>

# Caffeine Hack - Got caught with Caffeine installed

### Hack

Click Start, then type `Powershell` and it should show up.

Type `notepad $profile` to open your default profile.

This will likely be blank if this is the first time doing this.

Paste the following code:

```powershell
function idle {
	$wshell = New-Object -ComObject wscript.shell;
	"Press CTRL+C to cancel."
	while ($true) {
		$wshell.SendKeys('+')
		Sleep 60
	}
}
```

Close PowerShell, then re-open it (see step one).

Type `idle` and hit enter.

Optional: autorun you can add idle to line 9, and when opening PowerShell it will auto run

This function just presses the shift key every minute. It's less intrusive than mouse wigglers..

### Updated Version

Save this to your profile, and then you can run it indefinitely using `idle` or set a duration in minutes by adding it at the end `idle 28800`.

You can even have it do the math for you. So 60 mins \* 8 hours would be `idle (60*8)`.

You can get even fancier if you know what time you need to clock out.

```powershell
# If you stop working at 5pm (17:00) then you could use this:
$peaceout = (get-date 17:00)

idle ($peaceout - (get-date)).TotalMinutes
```

This part goes in your profile. Remember, if you make changes to your profile you will need to close and reopen any PowerShell terminals for them to pick up the changes.

```powershell
function idle {
    param(
    	[int]$Duration = -1 # Duration in Minutes
    )
    $wshell = New-Object -ComObject wscript.shell;
    
    'Press CTRL+C to cancel.'
    $idle = $true
    
    while ($idle) {
    	$wshell.SendKeys('+')
    	if ($Duration -eq 0) {
    		$idle = $false
    		'Time Expired.'
    		break
    	}
    	elseif ($Duration -gt 0) {
    		write-host -NoNewline "`r$Duration min(s) remaining."
    		$Duration--
    	}
    
    	Start-Sleep 60
    }
}
```

<p class="callout info">For both you have to save the file under my documents in the following folder and name the file the following:</p>

<p class="callout info">\\Documents\\WindowsPowerShell\\Microsoft.PowerShell\_profile.ps1</p>

### Script Hack

```powershell
param(
    [switch]$Indefinite,
    [int]$Minutes = 0
)

if ($Indefinite) {
    Write-Host "Keeping system awake indefinitely. Press Ctrl+C to stop."
    while ($true) {
        [System.Windows.Forms.Cursor]::Position
        Start-Sleep -Seconds 60
    }
} elseif ($Minutes -gt 0) {
    Write-Host "Keeping system awake for $Minutes minutes. This window will close automatically when done."
    $endTime = (Get-Date).AddMinutes($Minutes)
    while ((Get-Date) -lt $endTime) {
        [System.Windows.Forms.Cursor]::Position
        Start-Sleep -Seconds 60
    }
    Write-Host "Time's up!"
} else {
    Write-Host "Please specify either -Indefinite or -Minutes <number of minutes>."
}
```

To Use the Script:

<span data-huuid="474416176301448810">To keep the system awake indefinitely, run:</span>

```powershell
.\keep-awake.ps1 -Indefinite
```

<span data-huuid="474416176301448575">To keep the system awake for a specific number of minutes (e.g., 30 minutes), run:</span>

```powershell
.\keep-awake.ps1 -Minutes 30
```

# PiHole - Configuration

This is a great link for pi-installation

[https://www.crosstalksolutions.com/the-worlds-greatest-pi-hole-and-unbound-tutorial-2023/](https://www.crosstalksolutions.com/the-worlds-greatest-pi-hole-and-unbound-tutorial-2023/)

# IPCamera - Different Configs

CAMERA LIST

<table border="1" id="bkmrk-model-connection-ash" style="border-collapse: collapse; width: 100%; height: 119.188px;"><colgroup><col style="width: 22.4076%;"></col><col style="width: 77.5924%;"></col></colgroup><tbody><tr style="height: 29.7969px;"><td style="height: 29.7969px;">MODEL</td><td style="height: 29.7969px;">CONNECTION</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">ASH43-W</td><td style="height: 29.7969px;">rtsp://admin:YOUR\_CAMERA\_PASSWORD@YOUR\_CAMERA\_IP:554/cam/realmonitor?channel=1&amp;subtype=0</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">DAHAUA</td><td style="height: 29.7969px;">HTTP:85</td></tr><tr style="height: 29.7969px;"><td style="height: 29.7969px;">IP5M-T1179EW-AI-V3</td><td style="height: 29.7969px;">HTTP:80</td></tr></tbody></table>