Skip to content

Instantly share code, notes, and snippets.

View aduzsardi's full-sized avatar
🛠️
d(0_0)b

Alexandru Duzsardi aduzsardi

🛠️
d(0_0)b
View GitHub Profile
@aduzsardi
aduzsardi / gist:2e9f12846fd914cf05226c491c1e623e
Created July 25, 2017 08:34
Run AD Users & Computers As Another User
On a elevated command prompt run this....
runas /u:<domainB>\<username> /netonly mmc
On prompt.. type your domainB password.
Click File --> Add/Remove Snap-in
Choose Active Directory Users and Computers (from left side pane)
Click Add >
Click Ok
@aduzsardi
aduzsardi / cisco_port_fwd
Created July 25, 2017 08:39
cisco ios port forwaring
ip nat inside source static tcp 10.51.2.13 443 88.88.8.88 443 extendable
@aduzsardi
aduzsardi / gist:83b711b961b8058256077d4bcb4cb73e
Created July 25, 2017 08:41
Licensing mode for the Remote Desktop Session Host is not configured
How to fix RDS 2012r2 error: “Licensing mode for the Remote Desktop Session Host is not configured.”
To fix the problem, run the following commands in powershell to set the licensing server properly on the rd session host using the WMI CIM provider:
$obj = gwmi -namespace "Root/CIMV2/TerminalServices" Win32_TerminalServiceSetting
$obj. SetSpecifiedLicenseServerList("licserver.domain.local")
Then, go into the registry and manually set the licensing mode:
HKLM\SYSTEM\CurrentControlSet\Control\Terminal Server\RCM\Licensing Core\LicensingMode
@aduzsardi
aduzsardi / gist:b793587252d4f67b71297bb0b3943b73
Created July 25, 2017 08:49
Fixing OpenLDAP Authentication on OS X
# You would want to do this only if you do 'simple bind' to your LDAP server , if you're using an SASL method for authentication
# it should work without doing this.
sudo su
/usr/libexec/PlistBuddy -c "add ':module options:ldap:Denied SASL Methods:' string CRAM-MD5" /Library/Preferences/OpenDirectory/Configurations/LDAPv3/yourldapserver.plist
/usr/libexec/PlistBuddy -c "add ':module options:ldap:Denied SASL Methods:' string NTLM" /Library/Preferences/OpenDirectory/Configurations/LDAPv3/yourldapserver.plist
/usr/libexec/PlistBuddy -c "add ':module options:ldap:Denied SASL Methods:' string GSSAPI" /Library/Preferences/OpenDirectory/Configurations/LDAPv3/yourldapserver.plist
@aduzsardi
aduzsardi / osx_system_info
Created August 4, 2017 06:42
Get Mac's system information from the command line
# get informations categories
system_profiler -listdatatypes
# get information about harddrives
system_profiler SPStorageDataType
# Export to XML
system_profiler -xml SPEthernetDataType SPFirewallDataType > ~/Documents/reports/system_profile-EthernetFirewall.xml
# get OSX version
@aduzsardi
aduzsardi / ubuntu_win_bash
Last active August 4, 2017 08:19
docker on bash on windows
# Enable CPU virtualization capabilities from Bios
# Install docker for windows
# Run windows executables from bash
PATH="$HOME/bin:$HOME/.local/bin:$PATH"
PATH="$PATH:/mnt/c/Program\ Files/Docker/Docker/resources/bin"
--------------------------------------------------
# Install packages to allow apt to use a repository over HTTPS
$ sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
@aduzsardi
aduzsardi / apple_kbd_shortcuts
Last active August 4, 2017 10:11
macOS - Apple devices keyboard shortcuts
https://support.apple.com/en-us/HT201236
Command ⌘ (windows key on PC)
Shift ⇧
Option ⌥ (Alt key on PC)
Control ⌃
Caps Lock ⇪
Fn
# Hold during startup
@aduzsardi
aduzsardi / osx_resetpw
Created August 4, 2017 10:15
reset password macOS
# Boot in recovery mode
# Open up the terminal app from the utilities menu , and type
resetpassword
@aduzsardi
aduzsardi / _verify-repair-permissions-disk.md
Created August 8, 2017 06:15 — forked from bzerangue/_verify-repair-permissions-disk.md
Mac OS X Utilities via Terminal: (Verify and Repair: Disk Permissions AND Disk / Software Update / TimeMachine)

Verify and Repair Disk Permissions via Terminal (Mac OS X)

Verify Permissions

diskutil verifyPermissions /

Repair Permissions

diskutil repairPermissions /

@aduzsardi
aduzsardi / mkhomes.sh
Last active August 13, 2017 07:07
create home folders for ldap users in NFS export
#!/bin/bash
# Se foloseste in felul urmator
# - trebuie sa ai o lista cu useri in LDAP unul cate unul pe linie separata
# - rulezi scriptul './mkhomes.sh lista_useri.txt'
# Scriptul trebuie rulat pe un server integrat cu LDAP , pe CDN 99.99% .
if [ $# -ne 1 ];then
echo
echo -e "\t\t Usage: $0 users_file.txt"
echo -e "\t\t user_file must contain the users one per line"