Skip to content

Instantly share code, notes, and snippets.

@NathanTheGr8
NathanTheGr8 / .bash_profile
Created January 29, 2016 20:59 — forked from stephenll/.bash_profile
.bash_profile file on Mac OS X
# ---------------------------------------------------------------------------
#
# Description: This file holds all my BASH configurations and aliases.
# Much of this was originally copied from:
# http://natelandau.com/my-mac-osx-bash_profile/
#
# Sections:
# 1. Environment Configuration
# 2. Make Terminal Better (remapping defaults and adding functionality)
# 3. File and Folder Management
# sysDig Test Cases
# Test Case 1
# A grabs a lock
# B opens same file, tries to grab a lock
# Contention
# 0 = succesfull, 1 or more = number of contentions
test1_result=1
test1(){
exec 3>foo.bar
@NathanTheGr8
NathanTheGr8 / wp_install.sh
Last active April 14, 2016 18:01
A wordpress install script for installing wordpress on a freshly image raspberry pi
#!/bin/bash -e
dir="/var/www/html"
dbname="wordpress"
dbuser="root"
dbpass="sshs"
clear
echo "============================================"
echo "WordPress Install Script"
echo "============================================"
@NathanTheGr8
NathanTheGr8 / docker-compose.yml
Last active December 29, 2016 20:58
Docker Compose File for Wordpress
version: '2'
services:
db:
image: mysql:5.7
volumes:
- "./data/db:/var/lib/mysql"
restart: always
environment:
MYSQL_ROOT_PASSWORD: wordpress
MYSQL_DATABASE: wordpress
@NathanTheGr8
NathanTheGr8 / docker-spigot.sh
Created September 26, 2016 22:58
docker command to start https://github.com/nimmis/docker-spigot with the flags I want
docker run -d -p 25565:25565 -e EULA=true --name spigot -v ./mc-srv:/minecraft nimmis/spigot
#archive_dir = "C:\Outlook Archives"
$network_share = "\\some\server"
<#
Gets a list of the last 20 logins/outs. Then counts the actions by each user. Returns the user with the highiest count.
Also purge domain\ from username and any spaces
#>
function get-freq-user
{
$newest = 20
##Add extension reg
$chromepath32 = "HKLM:\Software\Google\Chrome\Extensions"
$chromepath64 = "HKLM:\Software\Wow6432Node\Google\Chrome\Extensions"
$extension_id = "haiffjcadagjlijoggckpgfnoeiflnem"
if ($is64bit) {
if (-not(Test-Path "HKLM:\Software\Wow6432Node\Google")){
New-Item "HKLM:\Software\Wow6432Node" -Name "Google"
}
if (-not(Test-Path "HKLM:\Software\Wow6432Node\Google\Chrome")){
@NathanTheGr8
NathanTheGr8 / Get-Freq-User.ps1
Last active March 21, 2017 22:45
returns the most frequent , recent user of this computer
function get-freq-user
{
$newest = 20
$ComputerName = $env:computername
$UserProperty = @{ n = "User"; e = { ((New-Object System.Security.Principal.SecurityIdentifier $_.ReplacementStrings[1]).Translate([System.Security.Principal.NTAccount])).ToString() } }
$logs = Get-EventLog System -Source Microsoft-Windows-Winlogon -ComputerName $ComputerName -newest $newest | select $UserProperty
$logs = $logs | Group-Object user | Sort Count | Select -First 1 | Select-Object -Property Name | Out-String
$index = $logs.indexOf("\") + 1
@NathanTheGr8
NathanTheGr8 / boxstarter.txt
Created April 18, 2017 19:15
Just a Box Starter script
Set-WindowsExplorerOptions -EnableShowHiddenFilesFoldersDrives -EnableShowProtectedOSFiles -EnableShowFileExtensions
Enable-RemoteDesktop
cinst googlechrome
cinst jre8
cinst firefox
cinst flashplayerplugin
cinst tor-browser
cinst 7zip
cinst chocolatey-core.extension
@NathanTheGr8
NathanTheGr8 / ufw home media server app profile.md
Last active July 31, 2024 13:31 — forked from andrey-str/ufw plexmediaserver app profile.md
Plex Media Server, Sonarr, Radarr, Deluge, NzbGet UFW rule
[plexmediaserver]
title=Plex Media Server
description=The Plex Media Server is smart software that makes playing Movies, TV Shows and other media on your computer simple
ports=32400/tcp|1900/udp|32469/udp|5353/udp

[sonarr]
title=Sonarr
description=Sonarr is a PVR for Usenet and BitTorrent users
ports=8989/tcp|8989/udp