• bash,  Mac OS X,  Mac OS X Server

    This New Years Day, Learn The Jot Command

    This New Years Day, Learn The Jot Command The jot command is one I haven’t used in awhile. But it’s still useful. Let’s take a look at a few of the things you can do with it. First, let’s just print lines into a new file called “century.txt” which we can do by running with the number of increments followed by the starting number, and then redirecting the output into the file name: jot 100 1 > ~/Desktop/century.txt Or to do integers instead, simply put the decimals: jot 100 1.00 > ~/Desktop/century.txt Or in descending order, jot – 100 1 > ~/Desktop/century.txt Now we could change the output to be…

  • Mac OS X,  Mac OS X Server,  Mac Security,  Ubuntu,  Unix

    Run a script directly from github

    There are a lot of scripts stored on github. And you can run them directly by curling them into bash. To do so, you’ll need a link to the raw script (using the github page with the URL of the script brings in all the cruft, so you’ll need to find the raw text). To grab that, click on the page with the script and then right-click  on Raw, as seen here: Then, throw out a bash command followed by < and then the URL you just copied into your clipboard in parenthesis: bash <(curl -Ls https://github.com/krypted/resetsoftwareupdate/raw/master/resetsoftwareupdate.sh)

  • Mac OS X,  Mac OS X Server,  Mac Security

    Caffeinate Your Commands

    The caffeinate command is pretty cool. It keeps your computer from going to sleep. It can run in a couple of different ways. There’s a timer that prevents sleep for a little while. You can also run another command from within caffeinate that keeps the system awake until the other command is finished. Here, we’ll scp a file called source file to a host called servername and keep the system from going to sleep until the process is finished: caffeinate -s scp sourcefile me:servername/targetfile Here, we’ll just use the boring command to tell the computer not to go to sleep for an hour: caffeinate -t 3600 &

  • Mac OS X,  Mac OS X Server,  Mac Security,  Mass Deployment

    Running A Web Server On OS X Yosemite Server

    Web Services in Mac OS X, Mac OS X Server, Linux and most versions of Unix are provided by Apache, an Open Source project that much of the Internet owes its origins to. Apache owes its name to the fact that it’s “a patchy” service. These patches are often mods, or modules. Configuring web services is as easy in OS X Mavericks Server (10.9) as it has ever been. To set up the default web portal, simply open the Server app, click on the Websites service and click on the ON button. After a time, the service will start. Once running, click on the View Server Website link at the bottom…

  • Windows Server

    Resize Hyper-V .vhdx To Minimum Size

    A really neat new feature in 2012R2 is that Hyper-V can resize a running virtual machine (.vhdx) to the smallest possible size, while the virtual machine is running. To do so, use Get-VM in PowerShell. Here, we’ll use the -Path option to define the location of our vhdx, the -ToMinimumSize option to indicate that we’d like to shrink it down as low as we can go and -AsJob so it runs in the background: Resize-VHD –Path D:\myVM.vhdx –ToMinimumSize -AsJob

  • Mac OS X Server

    Use Server Admin Web Modules In Mavericks Server

    Since the early days, OS X Server has supported performing the serveradmin commands through a web interface. This interface was accessible at the address of the server followed by a colon and then 311 in a web browser. This feature was disabled by default in Mountain Lion. But fear causes hesitation, and hesitation will cause your worst fears to come true, so we’re going to turn it back on here in Server 3. To enable, use the following command: sudo defaults write /Library/Preferences/com.apple.servermgrd requireUserAgent -bool false Once done, open https://127.0.0.1:311 in a web browser, or replace 127.0.0.1 with the address of the server if accessing from another location. This is…

  • Mac OS X,  Ubuntu,  Unix,  VMware

    Using the arp Command

    You can delete an IP address from the arp table using the arp command along with the -d option followed by an address.  For example, to delete IP 10.10.10.1: arp -d 10.10.10.1 If you’re not sure which IP address you’re looking for then you can look at the arp table to check the IP against the MAC address by using the -a option along with arp.  For example: arp -a To delete all of the entries in an arp table (they do regenerate after all) you can use the -d option in conjunction with the -a option: arp -d -a If you then want to manually add an entry into…