Skip to content

Instantly share code, notes, and snippets.

@devomman
devomman / office-activation.md
Created May 30, 2023 11:01
Office Activation Command by Omman

Office 2021

Method 1: Using my command line

Step 1.1: Open cmd program with administrator rights.

  • First, you need to open cmd in the admin mode, then run all commands below one by one.

Step 1.2: Get into the Office directory in cmd.

  • For x86 and x64
cd /d %ProgramFiles(x86)%\Microsoft Office\Office16
cd /d %ProgramFiles%\Microsoft Office\Office16
@devomman
devomman / Create_mac_OS_iso_Command.MD
Last active February 16, 2024 14:39
macOS Command for ISO file
  • Sonoma.iso
hdiutil create -o /tmp/Sonoma -size 16384m -volname Sonoma -layout SPUD -fs HFS+J
hdiutil attach /tmp/Sonoma.dmg -noverify -mountpoint /Volumes/Sonoma
sudo /Applications/Install\ macOS\ Sonoma.app/Contents/Resources/createinstallmedia --volume /Volumes/Sonoma --nointeraction
hdiutil eject -force /Volumes/Install\ macOS\ Sonoma
hdiutil convert /tmp/Sonoma.dmg -format UDTO -o ~/Desktop/Sonoma
mv -v ~/Desktop/Sonoma.cdr ~/Desktop/Sonoma.iso
rm -fv /tmp/Sonoma.dmg
@rstolpe
rstolpe / Remove-PrintersFromComputers.ps1
Last active February 16, 2024 14:43
Helping with deleting printers
Function Remove-PrintersFromComputers {
<#
Remove-PrintersFromComputers -PrinterToExclude "Printer1, Printer2, *Printer4*" -ComputerName "Computer1"
#>
[CmdletBinding()]
Param(
[String]$ComputerName = "localhost",
[String]$PrinterToExclude
@sebastian13
sebastian13 / AdminPrinterDeploy.ps1
Last active February 16, 2024 14:44
How to install printers post PrintNightmare patch
# Deploy this via PDQ Deploy or run once as admin
# Delete all Network Printers
Get-WmiObject -Class Win32_Printer | where{$_.Network -eq 'true'} | ForEach-Object {$_.Delete()}
# Add Driver to the Store
# ... example for Sharp 1910a - 9.1.18.47
pnputil.exe /a "\\nas01\tools\drivers\_Printers\MX_D54_PCL6_PS_1910a_German_64bit\German\PCL6\64bit\su0emdeu.inf"
# Install the Driver
'------------------------------------------------------------------------------------
' Over Complicated Printer Logon script
' By Christopher Goluch aka Rusketh (2019)
'
' USAGE:
' Set this as a user login script by group policy.
' Change the settings section to match your sites set up.
' For every printer that you have on the print server, create a new security group with the same name as the printer.
' Add users & computers to the printer groups on active directory.
' After login, network printers will be deleted and all relevant printers will be mapped.
@pydevops
pydevops / cloud_kms.md
Last active February 16, 2024 14:40
cloud kms

Use case

Secrets such as aws key and secret, google service account json, database id and password etc. can be easily encrypted and decrypted with https://cloud.google.com/kms/. Cloud KMS does not directly store secrets. It can encrypt secrets that you store elsewhere, i.e. the key itself is stored within KMS.

Let's illustrate with a real world example step by step. We can encrypt and decrypt a service account json file for compute instances. These instances are a part of an elasticsearch cluster. The google cloud admin creates the service account. The service account is used by the Terraform to provision the compute instances as shown in https://www.terraform.io/docs/providers/google/r/compute_instance.html. The developers want a copy of the service account 's json file so that they can develop & test with the elasticsearch cluster. The google cloud admin creates the plain text service json file, where and how to store it safely and securely? Storing on admin's laptop is not 100% safe and secur

@giordanocardillo
giordanocardillo / README.MD
Last active March 31, 2024 09:48
Remove Office 2016 Product Key
  1. Open a command prompt as Administrator
  2. In the command prompt, type the following:
  • Office 2016 (32-bit) on a 32-bit version of Windows

    cscript "C:\Program Files\Microsoft Office\Office16\OSPP.VBS" /dstatus

  • Office 2016 (32-bit) on a 64-bit version of Windows

    cscript "C:\Program Files (x86)\Microsoft Office\Office16\OSPP.VBS" /dstatus

  • Office 2016 (64-bit) on a 64-bit version of Windows

@alecthegeek
alecthegeek / server-command
Created June 28, 2013 22:26
Start and Stop commands for PaperCut
#! /usr/bin/env bash
if [[ -x /Applications/PaperCut\ MF/server/bin/mac/server-command &&
-x /Applications/PaperCut\ NG/server/bin/mac/server-command ]] ; then
echo copies of both NG and MF installed!
exit 1
elif [[ -x /Applications/PaperCut\ MF/server/bin/mac/server-command ]]; then
app_root='/Applications/PaperCut MF'
elif [[ -x /Applications/PaperCut\ NG/server/bin/mac/server-command ]]; then
app_root='/Applications/PaperCut NG'
@onecooltaco
onecooltaco / delete printers
Created November 8, 2011 19:42
delete all printers
#!/bin/bash
## from http://groups.google.com/group/macenterprise/browse_thread/thread/25647cbd9e346d16
# remove exiting printers
curPrinterList=`lpstat -p | grep printer | awk '{ print $2 }'`
for p in $curPrinterList; do
echo "Removing $p..."
if lpadmin -x $p; then
echo "Done"
else
echo "\n*******Error removing $p********\n$result\n\n"