Skip to content

Instantly share code, notes, and snippets.

View shkpk's full-sized avatar

Shahbaz Khan shkpk

  • Self
  • Center of the Earth
View GitHub Profile
# Bind to user object in AD.
$User = [ADSI]"LDAP://cn=Jim Smith,ou=West,dc=MyDomain,dc=com"
# Expire password immediately.
$User.pwdLastSet = 0
# Save change in AD.
$User.SetInfo()
hdiutil create -o /tmp/Mojave.cdr -size 8000m -layout SPUD -fs HFS+J
hdiutil attach /tmp/Mojave.cdr.dmg -noverify -mountpoint /Volumes/install_build
sudo /Applications/Install\ macOS\ Mojave.app/Contents/Resources/createinstallmedia --volume /Volumes/install_build
mv /tmp/Mojave.cdr.dmg ~/Desktop/
hdiutil detach /Volumes/Install\ macOS\ Mojave/
hdiutil convert ~/Desktop/Mojave.cdr.dmg -format UDTO -o ~/Desktop/Mojave.iso
mv ~/Desktop/Mojave.iso.cdr ~/Desktop/Mojave.iso
#!/bin/bash
readonly VM_RES="1680x1050"
readonly NAME="Mac Catalina"
VBoxManage modifyvm "$NAME" --usbxhci on --firmware efi --chipset ich9 --mouse usbtablet --keyboard usb
VBoxManage setextradata "$NAME" "CustomVideoMode1" "${VM_RES}x32"
VBoxManage setextradata "$NAME" VBoxInternal2/EfiGraphicsResolution "$VM_RES"
VBoxManage modifyvm "$NAME" --cpuidset 00000001 000106e5 00100800 0098e3fd bfebfbff
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemProduct" "iMac11,3"
VBoxManage setextradata "$NAME" "VBoxInternal/Devices/efi/0/Config/DmiSystemVersion" "1.0"
# csv2xml.py
# FB - 201010107
# First row of the csv file must be header!
# example CSV file: myData.csv
# id,code name,value
# 36,abc,7.6
# 40,def,3.6
# 9,ghi,6.3
# 76,def,99
#
# options_good.py
#
import os, socket
# configuration
server = "10.5.6.131"
port = 1344
request = """REQMOD icap://10.5.6.131/fe-nx ICAP/1.0
Host: 10.5.6.131
Import-Module ActiveDirectory
$password = ConvertTo-SecureString -AsPlainText “Test1234” -Force
For ($i=11; $i -le 500; $i++) {
$samAccountName = "dev"+"."+$i
Get-ADUser $samAccountName | Set-ADAccountPassword -NewPassword $password -Reset
}
@shkpk
shkpk / flush pf rules
Created January 8, 2021 10:46 — forked from leveled/flush pf rules
Flush pf rules on mac os x command line
sudo pfctl -F all -f /etc/pf.conf
@shkpk
shkpk / nginx_with_vouch_ssl.conf
Created January 15, 2021 11:44
nginx with vouch and vouch proxy
user www-data;
worker_processes 1;
error_log /var/log/nginx/error.log debug;
pid /var/run/nginx.pid;
events {
worker_connections 1024;
}
  1. Open Automator.app
  2. Create new Quick Action
  3. Select Run AppleScript
  4. Add this:
set inputVolume to input volume of (get volume settings)
if inputVolume = 0 then
	set inputVolume to 100
	display notification "Volume set to 100" with title "✅ Microphone is on"