• CentOS Kickstart with local CDROM media and a “http config file”

    At our NYC office, I have a PXE/Kickstart system setup. All I need to do is boot to PXE, and I can install CentOS with very little intervention. I have to choose Server vs Desktop (each choice points to a different http hosted kickstart cfg file.) and I have to setup my partitons how I want them.

    Recently I was tasked to setup a new office in LA. I had taken a CentOS iso with me, but I wanted to use the standard config file (hosted over http) at the central office. Basically I wanted to use the local bits with a remote config file. I learned a couple fo things going through this exercise.

    1. It is not easy to serach for KickStart config file examples becasue KickStart is the name of the process and the name of the config file.
    2. When booting from an ISO, if you want use local bits with a remote KickStart config file, the command is
      • linux ks=http://url.server.com/
      • The kickstart file must have the directive: cdrom
      • you can not have both “url” and “cdrom” in the same file. It will use the first one it finds (or last, I do not remember which)
    3. You can not combine both command line parameters and a kickstart file – the KickStart file overrides. For example I used:
      • linux ks=http://url.server.com/ks.cfg method=cdrom and I did not have “cdrom” in the config file. The installer prompted me for media type.

    The only way I could use local bits with a KickStart file, was to specify “cdrom” in the config file. Which means I had to have yet another option/config file= dekstop,server, server-cdrom.


  • VMware ESX and vmdks larger than 256gb

    News to me! if you want to create a vmdk larger than 256 gb, you need to blow away the datastore and re-create it with a larger block size!

    1. Move everything off the datastore.
    2. Under the configuration tab, Right click and delete the store
    3. Click add storage and it will find the unused disk
    4. and when Creating the new datastore, change the block size to accommodate the largest vmdk you want to create:
      • 1M =256gb, 2M=512gb, 4M=1T,8M=2T

  • Install Windows MovieMaker silently

    Not that you would want to, but here it is.

    wlsetup-all.exe /q /AppSelect:MovieMaker /NOTOOLBARCEIP /NOSEARCH /NOHOMEPAGE /NOCEIP /NOMU /NOLAUNCH


  • Using a MacBook to connect to a Cisco router

    We have a “USBG-232MINI” USB to Serial adapter and I needed to connect to a Cisco router. GNU screen to the rescue!!

    The command is

    screen /dev/tty.usbserial-A9005yuF 9600 (Where A9005yuF is probably unique)

    And to exit hit Control+A then K.


  • PowerShell to list all users and when their password expires

    I wanted to dump a list of accounts and their password expiration dates – accounts that were not disabled, that had a certain description, and were not set with “Password never expires”

    (Get-ADUser -filter {(Description -notlike "Service*") -and (Enabled -eq "True") -and (PasswordNeverExpires -eq "False")} -properties *) |
    select samaccountname,description,
    @{N="LastChanged";E={(Get-Date([System.DateTime]::FromFileTimeUtc($_.pwdLastSet))).ToShortDateString()}},
    @{N="Expires";E={(Get-Date([System.DateTime]::FromFileTimeUtc($_.pwdLastSet))).AddDays((Get-ADDefaultDomainPasswordPolicy).MaxPasswordAge.TotalDays).ToShortDateString()}}

  • 1000 visitors in a month!

    I have been using this Analytics Widget on my dashboard and I  just hit 1000 visits in a month! I know that is nothing in compared to a real site, but it is a milestone (in my mind)!


  • My PowerShell cheat sheet

    I am trying to  be a better PowerSheller. I thought I would create a post with queries I have figured out. I hope to keep adding more.

    • We needed to change a whole bunch of distribution groups – append them with “-NewName”. This query created our origianl list, the last 50 distribution groups created, with columns representing the old and new names:
    Get-ADGroup -filter {GroupCategory -eq "Distribution"} -Properties *|
    Select-Object -Property Name,whenCreated,mail,
    @{N="NewMail";E={$_.mail.replace("@","-NewName@")}} -last 50
    
    • Similar to the query above, but adds a column indicating if we had changed the name or not – a status column. I used a conditional inside of an Expression field. And I looped through an array retuned by “proxyAddresses”
    Get-ADGroup -filter {GroupCategory -eq "Distribution"} -Properties * |
    sort created |
    select Name,
    @{N="NewName";E={if($_.Name -like "*-NewName"){$_.Name}else{$_.Name+"-NewName"}}},
    @{N="NewMail";E={if($_.Mail -like "*[email protected]"){$_.Name}else{$_.Mail.replace("@","-NewName@")}}},
    @{Name="proxyAddresses";Expression={foreach ($SMTP in $_.proxyAddresses){if ($SMTP.ToLower().StartsWith("smtp:")){$SMTP}}}},
    @{N="Completed";E={if($_.Name -like "*-NewName"){"Completed"}else{"ToDo"}}} |
    convertto-csv > MasterList.csv
    
    • Another variation with a conditional inside of  the filter
    Get-ADGroup -filter {GroupCategory -eq "Distribution" -and Name -like "*-NewName"} -Properties * |
    sort created | select Name,Samaccountname,Displayname,Mailnickname,Mail,
    @{Name="proxyAddresses";Expression={foreach ($SMTP in $_.proxyAddresses){if ($SMTP.ToLower().StartsWith("smtp:")){$SMTP}}}} |
    convertto-csv > Completed.csv
    
    • More to come. Maybe these will be helpful to some searchers out there.

  • Support for .vcf files in WordPress

    Our developers created a website that had vCard files for each staff member. The problem was that when people clicked on them, rather than downloading them, some web browsers displayed the content of the file.

    Ended up that apache did not know how to handle “.vcf” files. The change below is now part of my standard setup script:

    sed -i.ORIG “/text\/xml-external-parsed-entity/a\text\/x-vcard\t\t\tvcf” /etc/mime.types