One of my favorite things to do every year is head to Gothenburg to see Tycho, Patrik, and the rest of the wonderful country of Sweden (and city of Gothenburg). It’s a great city and Tycho does a great job to curate MacSysAdmin into an informative conference. And, the site is now live to buy your tickets for the 2016 event! It’s one of those conferences that sells out, so don’t wait too long to pick up your ticket! 🙂
-
-
Gist to fully reset Profile Manager
-
List of Safe Complex Characters for Passwords
A number of systems require you to use complex characters in passwords and passcodes. Here is a list of characters that can be used, along with the name and the associated unicode: (Space) U+0020 ! (Exclamation) U+0021 ” (Double quotes) U+0022 # (Number sign) U+0023 $ (Dollar sign) U+0024 % (Percent) U+0025 & (Ampersand) U+0026 ‘ (Single quotes) U+0027 ( (Left parenthesis) U+0028 ) (Right parenthesis) U+0029 * (Asterisk) U+002A + (Plus) U+002B , (Comma) U+002C – (Minus sign) U+002D . (Period) U+002E / (Slash) U+002F : (Colon) U+003A ; (Semicolon) U+003B < (Less than sign) U+003C (not allowed in all systems) = (Equal sign) U+003D > (Greater than sign) U+003E (not allowed in all systems)…
-
25 Time Saving Bash Tips
Use the following keys to do fun things when typing a command in bash (mostly keybindings): Use the up arrow to run the previous command Continue using the arrow to scroll to commands further in the history Use Control-r to search through your command history Control-w deletes the last word Control-u deletes the line you were typing Control-a moves the cursor to the beginning of the line Control-e moves the cursor to the end of the line Control-l clears the screen Control-b moves the cursor backward by a character Control-u moves the cursor forward by a character Control-_ is an undo “man readline” shows the bash keybindings (ymmv per OS)…
-
Manage Recent Places In OS X
There are two defaults keys that can be used to manage the recent places options in the OS X Finder. Both are in the .GlobalPreferences. The first is NSNavRecentPlaces and the second is NSNavRecentPlacesLimit. The NSNavRecentPlacesLimit key limits the number of items that are stored in the list. To increase the default to, let’s say, 20, use the defaults command to set the NSNavRecentPlacesLimit key to an integer of 20: defaults write .GlobalPreferences NSNavRecentPlacesLimit -int 20 Then use defaults to read the setting: defaults read NSNavRecentPlacesLimit You’ll need to “killall Finder” in order to see this in a Finder Save dialog. You can also inject items into the RecentPlaces array, called NSNavRecentPlaces, or delete…
-
Export AD Objects Into LDIF On Windows Server
The LDIFDE utility exports and imports objects from and to Active Directory using the ldif format, which is kinda’ like csv when it gets really drunk and can’t stay on one line. Luckily, ldif can’t drive. Actually, each attribute/field is on a line (which allows for arrays) and an empty line starts the next record. Which can make for a pretty messy looking file the first time you look at one. The csvde command can be used to export data into the csv format instead. In it’s simplest form the ldifde command can be used to export AD objects just using a -f option to specify the location (the working…
-
Create A SQL Database
So you’re ready to write some software? Or test some cool stuff. Or build something awesome. You can use the CREATE DATABASE statement to get started, by creating a database. To do so is pretty easy, simply run that statement followed by a name for the database (called Customers): CREATE DATABASE Customers; Once you’ve created a database, it’s time to create tables, which can be done using the CREATE TABLE statement. The Syntax of that statement looks something like this, defining a set of columns, their data type and the size of the column (in the form of a maximum length), all wrapped in parenthesis with each column separated by…
-
Create Crypt Password Hashes
Linux and OS X come with the makekey command installed, usually in /usr/libexec/makekey. You can use this binary to create /etc/passwd file entries of hashed passwords. To use the command, simply pipe some text into the command. Here, we’ll echo testpassword into makekey: echo testpassword | /usr/libexec/makekey And we’ll get a simple output, such as: woNH11o4mqvAc There are certainly other ways to do something like this, but when writing a script you may use in either a Linux or OS X environment, this is one place where you should have a modicum of success crossing platforms.
-
Disable .dsstore Files On USB Drives
Long ago, I did an article on disabling those pesky files that show up for Windows computers but not Macs on network volumes when you browse folders. These are metadata files and have a number of uses. But if you have a lot of files in a folder on a USB drive or if you move the USB drive to a Windows computer, you might not want .dsstore or metadata files on USB drives either. To disable, use the following command, which writes a DSDontWriteUSBStores boolean key into com.apple.desktopservices: defaults write com.apple.desktopservices DSDontWriteUSBStores -bool true
-
Bash: Check That A Script Is Running As Root
Pretty much every script I’m working on these days must be run as root. Checking what user is running something is pretty straight forward, as there’s a built-in shell variable for $USER that contains the user running a script. To see this real quick, simply run the following: echo $USER You can then put this into your scripts. I’ve been using the same block of code for decades, which can be run in a script by itself if you’d like to paste this into one. if [[ $USER != "root" ]]; then echo "This script must be run as root" else echo "You are root" exit 1 fi Note: Keep in mind…