Skip to content

Instantly share code, notes, and snippets.

View rolambert's full-sized avatar
🛴
@Home

Robert Lambert rolambert

🛴
@Home
  • Canada
View GitHub Profile
@rolambert
rolambert / Setup_php_webdev.ps1
Last active October 25, 2023 23:38
Create a php dev enviroment on windows using podman.
# Author: Robert Lambert
# OS: Windows
# Creation: 2023
# Configuration variable names.
$nginx_conf = "webdev_config.conf"
$nginx_conf_dir = "~\.podman_nginx_configs"
$website_src_files = "c:\Users\robertlambert\.webdevphp"
$website_name = "webdev"
@rolambert
rolambert / wol.ps1
Created March 10, 2022 21:50
Powershell Magic Packet Wake on Lan Snipit
$Mac = "00:11:8c:ee:80:aa"
$MacByteArray = $Mac -split "[:-]" | ForEach-Object { [Byte] "0x$_"}
[Byte[]] $MagicPacket = (,0xFF * 6) + ($MacByteArray * 16)
$UdpClient = New-Object System.Net.Sockets.UdpClient
$UdpClient.Connect(([System.Net.IPAddress]::Broadcast),7)
$UdpClient.Send($MagicPacket,$MagicPacket.Length)
$UdpClient.Close()
@rolambert
rolambert / CondaInstallScriptBlock.txt
Last active October 25, 2021 19:59
CondaPSInstallScriptBlock
[CmdletBinding()]
Param (
[Parameter(Mandatory=$false)]
[ValidateSet('Install','Uninstall','Repair')]
[string]$DeploymentType = 'Install',
[Parameter(Mandatory=$false)]
[ValidateSet('Interactive','Silent','NonInteractive')]
[string]$DeployMode = 'Interactive',
[Parameter(Mandatory=$false)]
[switch]$AllowRebootPassThru = $false,
@rolambert
rolambert / atlas_install.sh
Last active December 23, 2020 19:26 — forked from kparrish/atlas_install.sh
A bash script to install ATLAS on a Debian (Ubuntu) machine. To install run the script: sudo bash atlas_install.sh. Note on newer linux machines will have to 1. Edit /etc/default/grub 2. Find line with: GRUB_CMDLINE_LINUX_DEFAULT 3. Append the following to args: intel_pstate=disable 4. Update grub: update-grub 5. Reboot; from http://math-atlas.s…
#!/bin/bash
### ATLAS Ubuntu install
# Assign user name
read -p "Enter your user name: " UserName
# Update Grub file
cp /etc/default/grub /etc/default/grub_backup
sed -i 's/\(GRUB_CMDLINE_LINUX_DEFAULT=".*\).*\("\)/\1 intel_pstate=disable\2/' /etc/default/grub
@rolambert
rolambert / windows_hardening.cmd
Created December 1, 2020 22:33 — forked from mackwage/windows_hardening.cmd
Script to perform some hardening of Windows OS
:: Windows 10 Hardening Script
:: This is based mostly on my own personal research and testing. My objective is to secure/harden Windows 10 as much as possible while not impacting usability at all. (Think being able to run on this computer's of family members so secure them but not increase the chances of them having to call you to troubleshoot something related to it later on). References for virtually all settings can be found at the bottom. Just before the references section, you will always find several security settings commented out as they could lead to compatibility issues in common consumer setups but they're worth considering.
:: Obligatory 'views are my own'. :)
:: Thank you @jaredhaight for the Win Firewall config recommendations!
:: Thank you @ricardojba for the DLL Safe Order Search reg key!
:: Thank you @jessicaknotts for the help on testing Exploit Guard configs and checking privacy settings!
:: Best script I've found for Debloating Windows 10: https://github.com/Sycnex/Windows10Debloater
:
@rolambert
rolambert / sed_oneline.txt
Created December 1, 2020 20:05
useful sed oneliners
-------------------------------------------------------------------------
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5
Latest version of this file (in English) is usually at:
http://sed.sourceforge.net/sed1line.txt
http://www.pement.org/sed/sed1line.txt
This file will also available in other languages:
Chinese - http://sed.sourceforge.net/sed1line_zh-CN.html
@rolambert
rolambert / ml_setup_ubuntu.sh
Last active December 4, 2020 03:05
Ubuntu 20.04 LTS Machine Learning Setup and Security Hardening Script.
#!/bin/bash
# Author: Robert Lambert
# Version: 0.1.0
# Use this script to automate the set up of a Ubuntu 20.04 LTS for use as a machine learning workhorse
# ref: https://askubuntu.com/a/30157/8698
# Root user check
if [ $SUDO_USER || $(id -u) = 0 ]; then
echo "The script need to be run as user." >&2
exit 1
@rolambert
rolambert / Seaborn.ipynb
Created July 16, 2020 17:10
charts with seaborn
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@rolambert
rolambert / client_side_cache.ps1
Created July 15, 2020 15:15
the script takes ownership of client side cache content on windows 7
function takeownershipandmovecsc{
param(
[String]$username, #$env:username
[string]$homeshare,
[String]$homea, # $home
[string]$systemroot, # $env:systemroot
[String]$SysDrive #$env:SystemDrive
)
$a1 = @(1,2,3,4,5)
$b1 = "'This is string number'"
$Scriptblock = @"
`$Array = @(1,2,3,4,5)
`$String = $b1
foreach(`$f in `$Array){ write-host "`$String `$f"}
start-sleep 10
write-host pasta
start-sleep 10