Skip to content

Instantly share code, notes, and snippets.

@steelcm
steelcm / tomd.hd-block.content.2019-10-02.xml
Created October 7, 2019 08:37
HD dummy block content for dev/design
<?xml version="1.0" encoding="UTF-8" ?>
<!-- This is a WordPress eXtended RSS file generated by WordPress as an export of your site. -->
<!-- It contains information about your site's posts, pages, comments, categories, and other content. -->
<!-- You may use this file to transfer that content from one site to another. -->
<!-- This file is not intended to serve as a complete backup of your site. -->
<!-- To import this information into a WordPress site follow these steps: -->
<!-- 1. Log in to that site as an administrator. -->
<!-- 2. Go to Tools: Import in the WordPress admin panel. -->
<!-- 3. Install the "WordPress" importer from the list. -->
@steelcm
steelcm / .htaccess
Created September 18, 2019 11:51
Enable expiration headers via .htaccess – Useful for WordPress and other sites
# Expiration Headers
<IfModule mod_expires.c>
FileETag MTime Size
AddOutputFilterByType DEFLATE text/plain text/html text/xml text/css application/xml application/xhtml+xml application/rss+xml application/javascript application/x-javascript
ExpiresActive On
ExpiresByType text/html "access 600 seconds"
ExpiresByType application/xhtml+xml "access 600 seconds"
ExpiresByType text/css "access 1 month"
ExpiresByType text/javascript "access 1 month"
ExpiresByType text/x-javascript "access 1 month"
@steelcm
steelcm / .htaccess
Created September 18, 2019 11:46
Enable gzip compression via .htaccess – Useful for WordPress and other sites
<IfModule mod_deflate.c>
# Compress HTML, CSS, JavaScript, Text, XML and fonts
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/vnd.ms-fontobject
AddOutputFilterByType DEFLATE application/x-font
AddOutputFilterByType DEFLATE application/x-font-opentype
AddOutputFilterByType DEFLATE application/x-font-otf
AddOutputFilterByType DEFLATE application/x-font-truetype
AddOutputFilterByType DEFLATE application/x-font-ttf
@steelcm
steelcm / gist:2895940
Created June 8, 2012 14:36
powershell command to retrieve users associated with an AD group
PS C:\> net group /domain APPL_PANDS_Test_Admin
The request will be processed at a domain controller for domain ###.###.com.
Group name APPL_PANDS_Test_Admin
Comment Administrator access to application PANDS in Test Environment
Members
-------------------------------------------------------------------------------
@steelcm
steelcm / gist:2836319
Created May 30, 2012 13:25
powershell command to retrieve AD groups associated with username
# add required snapin packages
PS C:\> Add-PSSnapin Quest.ActiveRoles.ADManagement
# print group information for each group user is assigned to
PS C:\> (get-qaduser 'TEST_User_2').memberOf | get-qadgroup
Name Type DN
---- ---- --
APPL_FDA_Test_Legal_RWX group CN=APPL_FDA_Test_Legal_RWX,OU...
GPO_Deny_Logon_Local group CN=GPO_Deny_Logon_Local,OU=Gl...
@steelcm
steelcm / gist:2660407
Created May 11, 2012 15:19
Update Ruby, RubyGem and Rails
# Get latest RubyGem
$ gem update --system
# Get latest Ruby
$ gem update ruby
# Get latest Rails
$ gem update rails
@steelcm
steelcm / gist:2660244
Created May 11, 2012 14:53
Check installation of Cygwin package and verify integrity
$ cygcheck -c cygwin gcc-core make tar
Cygwin Package Information
Package Version Status
cygwin 1.7.9-1 OK
gcc-core 3.4.4-999 OK
make 3.82.90-1 OK
tar 1.25-1 OK
@steelcm
steelcm / gist:2659900
Created May 11, 2012 14:08
Ruby on rails installation script for Cygwin
# install Ruby
$ wget ftp://ftp.ruby-lang.org/pub/ruby/1.9/ruby-1.9.3-p0.tar.gz
$ tar -zxvf ruby-1.9.3-p0.tar.gz
$ cd ruby-1.9.3-p0
$ ./configure
$ make
$ make install
# install RubyGems
$ wget http://production.cf.rubygems.org/rubygems/rubygems-1.8.24.tgz
@steelcm
steelcm / gist:2558512
Created April 30, 2012 13:50
Find open ports on windows server using PowerShell
PS C:\> netstat -an | select-string -pattern "listening"
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING
TCP 0.0.0.0:81 0.0.0.0:0 LISTENING
TCP 0.0.0.0:135 0.0.0.0:0 LISTENING
TCP 0.0.0.0:383 0.0.0.0:0 LISTENING
@steelcm
steelcm / gist:2499367
Created April 26, 2012 12:55
example cucumber feature file
Feature: Division
In order to avoid silly mistakes
Cashiers must be able to calculate a fraction
Scenario: Divide two regular numbers
Given I have entered 3 into the calculator
And I press divide
And I have entered 2 into the calculator
When I press equals
Then the result should be 1.5 on the screen