Marc Blase

Use .htaccess to remove any query string and redirect to site root

RewriteEngine on
RewriteCond %{QUERY_STRING} .
RewriteRule ^$ /? [R,L]
Published on December 19, 2019

Negative value for margin using calc() in SCSS

Using SCSS and need to set a negative margin with calc on an interpolated variable. Here’s the solution:

.container {
  margin-top: calc((#{$VAR_NAME} + 0px)/-1); // divide by -1 to get a negative result
}
Published on November 18, 2019

Pretty List Item Disc Coloring with SCSS

Since I seem to be asked for these frequently, I am putting this here for quick reference, as well as posterity.

ul {
  list-style: none;
  margin: 0 0 25px;
  padding: 0;
  
  li {
    margin: 0;
    padding: 0 0 0 30px;
    text-indent: -15px;

    &::before {
      content: "• ";
      color: gold; // it's a pretty color
    }
  }
}
Published on November 6, 2019

Get list of installed programs with PowerShell in Windows

In PowerShell run:

To get a list of installed programs:

Get-ItemProperty HKLM:\Software\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall\*  | Select-Object DisplayName, DisplayVersion, Publisher, InstallDate | Format-Table -AutoSize > c:\Users\YOUR_USER\Documents\list-installed-programs.txt

To get a list of app store installed programs:

Get-AppxPackage | Select Name, PackageFullName |Format-Table -AutoSize > c:\Users\YOUR_USER\Documents\list-installed-programs.txt

NOTE: Yes, this is all over the internet, but I wanted it here so I could find it faster next time.

Published on October 15, 2019

Pool/Spa Cooling Formula

As I’ve had use of this in the past I am putting it here for future reference.

PI = (V/1000) * DCD * 43.75

Where:
PI = Pounds of ice required
V = Volume of water in gallons
DCD = Degrees Cooling Desired; Current – Desired temp in °F

Note: Not sure where the 43.75 constant comes from. Will update if/when I find a source.

Note 2: This is of interest and could be used to rework the above formula: http://www.hk-phy.org/contextual/heat/cha/la_he07_e.html

Published on September 3, 2019

Random Character Formula for Calc

=CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))&CHAR(RANDBETWEEN(97;122))
Published on April 25, 2019

Me on a bike (2018/19 Season)

Zombie Goat Enduro

Dino Enduro

Hill Country Eagle Enduro

O’Rock Epic Enduro

Shiner GASP 2019


Wife


Bro

Published on March 29, 2019

2018 Top Listens

  1. Yo La Tengo
    422
  2. Iron Chic
    247
  3. Nancy Pants
    223
  4. Hot Snakes
    154
  5. Sturgill Simpson
    125
  6. Built to Spill
    122
  7. Galaxie 500
    120
  8. The Magnetic Fields
    115
  9. Jawbreaker
    113
  10. Superchunk
    106
  11. Leon Bridges
    100
  12. Blended Babies
    92
  13. The Menzingers
    91
  14. Miles Davis
    79
  15. The Velvet Underground
    77
  16. PUP
    76
  17. The Dead Milkmen
    76
  18. teklife
    75
  19. Ultramarine
    75
  20. Big Star
    73
  21. Diarrhea Planet
    72
  22. Ol’ Burger Beats
    71
  23. Guided by Voices
    69
  24. Pavement
    65
  25. Courtney Barnett
    64
  26. Michael Bublé
    64
  27. Thin Lips
    64
  28. Melvins
    62
  29. Pkew Pkew Pkew
    61
  30. Pile
    58
  31. Thee Oh Sees
    57
  32. BROCKHAMPTON
    56
  33. Waxahatchee
    55
  34. The Modern Lovers
    54
  35. Hop Along
    53
  36. Keys N Krates
    53
  37. The Joy Formidable
    51
  38. Jlin
    49
  39. Nice As Fuck
    49
  40. Twin Peaks
    48
  41. Big Thief
    47
  42. Nick Drake
    47
  43. The Aquabats!
    46
  44. J Dilla
    45
  45. The Beatles
    45
  46. The Breeders
    45
  47. Wilco
    45
  48. Boys Noize
    44
  49. Cass McCombs
    44
  50. The Midnight Hour
    44
Published on January 5, 2019

Jailed SFTP only share with chroot using mount –bind to share directory

1) Setup SSH jail in /etc/ssh/sshd_config
Match User JAILED_USER_NAME
  ForceCommand internal-sftp
  ChrootDirectory /jailed/directory
  AllowTcpForwarding no
  X11Forwarding no

2) Restart SSHD
systemctl restart sshd

3) Test

4) Setup dir share from somewhere else in filesystem using:
mount --bind /jailed/directory /somewhere/else

Remember that path to jailed dir must be owned by root and the share dir must be in a group that is writable by the jailed user. This will also only stick around till the next reboot, if you need something more permanent look into using fstab.

Published on June 1, 2018

Force word wrap on long strings

Sometimes web content requires having a long URL which can extend or break the container which encloses it. Chris Coyier saves the day again. Thanks!

.dont-break-out {

  /* These are technically the same, but use both */
  overflow-wrap: break-word;
  word-wrap: break-word;

  -ms-word-break: break-all;
  /* This is the dangerous one in WebKit, as it breaks things wherever */
  word-break: break-all;
  /* Instead use this non-standard one: */
  word-break: break-word;

  /* Adds a hyphen where the word breaks, if supported (No Blink) */
  -ms-hyphens: auto;
  -moz-hyphens: auto;
  -webkit-hyphens: auto;
  hyphens: auto;

}
Published on February 28, 2018