This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
dscl . -create /Users/myuser | |
dscl . -create /Users/myuser UserShell /bin/zsh | |
dscl . -create /Users/myuser RealName "myuser" | |
dscl . -create /Users/myuser UniqueID "510" | |
dscl . -create /Users/myuser PrimaryGroupID 20 | |
dscl . -create /Users/myuser NFSHomeDirectory /Users/myuser | |
dscl . -passwd /Users/myuser password | |
dscl . -append /Groups/admin GroupMembership myuser |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# kadmin: GSS-API (or Kerberos) error while initializing kadmin interface | |
install rng-tools | |
edit /etc/default/rng-tools | |
add line HRNGDEVICE=/dev/urandom , restart rng-tools service | |
edit /etc/init.d/krb5-admin-server , edit variable DAEMON_ARGS="-W /dev/urandom" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---- START Cisco IOS ---- | |
interface Port-channel2 | |
description LACP Channel for mk2 | |
switchport trunk encapsulation dot1q | |
switchport trunk allowed vlan 1,2 | |
switchport mode trunk | |
spanning-tree portfast trunk | |
! | |
interface GigabitEthernet1/0/23 | |
description mk2 eth0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# ---------------------------------------------------------------------------------------------------------- | |
# PURPOSE: Creates a byte array for use with DHCP Option 119 | |
# | |
# VERSION DATE USER DETAILS | |
# 1 07/03/2016 Craig Tolley First version | |
# 1.1 08/03/2016 Craig Tolley Fixed issue where if the whole domain matched the pointer was incorrect | |
# 1.2 08/03/2017 Craig Tolley Fixed further issues where the whole domain was matched the pointers are incorrect | |
# Modified outputs and tidied some formatting | |
# Convert-StringToOpt119Hex option fixed to not return values for null/empty strings | |
# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Column Width | |
PS > Get-CsAnalogDevice | ft Identity,RegistrarPool -> Get-CsAnalogDevice | ft Identity,RegistrarPool | out-string -Width 160 | |
# Collections / Arrays | |
# It might be that the object you’re looking at is an array (a “collection”), and PowerShell is only showing the first few entries in that array, rather than the lot. | |
# Here, the fix is to change the $FormatEnumerationLimit value. If you type it on its own into PowerShell the current value – probably 3 – will be returned. If you set a new value of -1, it’ll output ALL entries in your collection. | |
PS > $FormatEnumerationLimit | |
3 | |
PS > $FormatEnumerationLimit=-1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.rationallyparanoid.com/articles/hping.html | |
Hping usage examples | |
Often considered a complementary tool to Nmap, hping is used for network scanning, as well as crafting TCP/IP packets. Please note that given the packet crafting involved, if you are running as root yet you receive an error saying that the operation is not permitted it could be due to a host firewall. | |
Send TCP SYN packets to port 0 on host example.com (note that hping will increment the source port by 1 for each packet sent): | |
hping example.com -S -V | |
Send TCP SYN packets to port 443 on host example.com: | |
hping example.com -S -V -p 443 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.rationallyparanoid.com/articles/netcat.html | |
Netcat usage examples | |
The following commands were done on the Linux version of Netcat. | |
Connect to TCP port 80 on host example.com: | |
nc -vv example.com 80 | |
Port scan TCP ports 7 through 1023 on host example.com | |
nc -v -z example.com 7-1023 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://www.rationallyparanoid.com/articles/wget.html | |
Wget is a command-line tool for retrieving files using HTTP, HTTPS or FTP. | |
Retrieve /images/pic01.jpg from host example.com: | |
wget http://example.com/images/pic01.jpg | |
Retrieve /images/pic01.jpg from host example.com, specifying the user agent for IE7 on a Windows XP SP2 system instead of "Wget/1.xx": | |
wget --user-agent="Mozilla/4.0 (Windows; MSIE 7.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727)" http://example.com/images/pic01.jpg | |
Retrieve /images/pic01.jpg from host example.com, specifying "http://anothersite.example.com/search?hl=en&q=pictures" as the referer: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
http://brandon.penglase.net/index.php?title=Getting_*nix_to_Netboot_Macs | |
class "Apple-Intel-Netboot" { | |
2 # Limit this class to only Intel Apple machines | |
3 match if substring (option vendor-class-identifier, 0, 14) = "AAPLBSDPC/i386"; | |
4 option dhcp-parameter-request-list 1,3,17,43,60; # Send these options to the client (possibly forcing it, if the client didn't request it) | |
5 # From: http://www.iana.org/assignments/bootp-dhcp-parameters/bootp-dhcp-parameters.xml | |
6 # 1 - Subnet Mask | |
7 # 3 - Router | |
8 # 17 - Root Path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
https://askubuntu.com/questions/457016/how-to-change-gsettings-via-remote-shell | |
#!/bin/bash | |
# Remember to run this script using the command "source ./filename.sh" | |
# Search these processes for the session variable | |
# (they are run as the current user and have the DBUS session variable set) | |
compatiblePrograms=( nautilus kdeinit kded4 pulseaudio trackerd ) |