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
Conditional Formatting: | |
Highlight duplicates in row: | |
=countif(A:A,A1)>1 | |
Add colons to MAC address: | |
=CONCATENATE(MID(F2,1,2),":",MID(F2,3,2),":",MID(F2,5,2),":",MID(F2,7,2),":",MID(F2,9,2),":",MID(F2,11,2)) | |
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
Option/Alt + Left or Right | |
This shortcut allows you to move the cursor between separate words in a command line. Use Option and the left arrow to move back and use Option with the right arrow to move forward down the line. | |
Control + W | |
Using this keyboard combination will delete the word immediately before, or to the left of, the cursor. | |
Escape + T | |
This will swap the two words that appear immediately before the cursor. So, if "this is" sits before the cursor, using Escape and T will change that to "is this." | |
Control + R |
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
pkgutil --expand mypackage.pkg path/to/expand |
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
// This code block makes use of labeled statements, labeling the two loops as rowLoop and the columnLoop, respectively. When the row equals the column inside the inner columnLoop, the outer rowLoop will continue. You can use labeled statements like these with break to break out of a certain loop. Normally, break and continue work on the innermost loop, so you need to use labeled statements if you want to manipulate an outer loop. | |
var sum = 0 | |
rowLoop: for row in 0..<8 { | |
columnLoop: for column in 0..<8 { | |
if row == column { | |
continue rowLoop | |
} | |
sum += row * column |
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
$0 = "Script path" | |
$1 = "Package path" | |
$2 = "Default location" | |
$3 = "Target volume" | |
# Useful info: | |
# https://derflounder.wordpress.com/2013/11/03/re-packaging-installer-packages-with-packages/ |
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
# kickstart ARD | |
sudo /System/Library/CoreServices/RemoteManagement/ARDAgent.app/Contents/Resources/kickstart -activate -configure -allowAccessFor -allUsers -privs -all |
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
# Ping an IP range in Windows | |
FOR /L %i in (1,1,255) do @ping -n 1 192.168.1.%i | find "Reply" |
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
# List all VMs with their UUIDs | |
xe vm-list | awk '{if ( $0 ~ /uuid/) {uuid=$5} if ($0 ~ /name-label/) {$1=$2=$3="";vmname=$0; printf "%s - %s\n", vmname, uuid}}' | |
# List VMs and VDIs | |
xe vdi-list |
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
clients=`mysql -e'select Name from Client ORDER BY Name ASC;' bacula | tail -n+2` | |
for client in `echo $clients` | |
do | |
echo "prune files client=${client} yes" | bconsole | |
done |
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
tcpdump ether host aa:bb:cc:11:22:33 |