Skip to content

Instantly share code, notes, and snippets.

View jasonruyle's full-sized avatar

Jason Ruyle jasonruyle

View GitHub Profile
@jasonruyle
jasonruyle / card.php
Created April 9, 2024 17:00 — forked from Niq1982/card.php
Load more to WordPress blog archive using AlpineJS and Axios
<div class="card">
<?php if ($args['link']) : ?>
<a href="<?php echo esc_url($args['link']); ?>" class="global-link">
</a>
<?php endif; ?>
<div class="card-image">
<?php wp_get_attachment_image($args['image']); ?>
</div>
@jasonruyle
jasonruyle / OverEncrypt.md
Created February 15, 2018 19:10 — forked from mapmeld/OverEncrypt.md
OverEncrypt - paranoid HTTPS

OverEncrypt

This is a guide that I wrote to improve the default security of my website https://fortran.io , which has a certificate from LetsEncrypt. I'm choosing to improve HTTPS security and transparency without consideration for legacy browser support.

WARNING: if you mess up settings, lose your certificates, or decide to no longer maintain HTTPS certs, these steps can and will make your domain inaccessible.

I would recommend these steps only if you have a specific need for information security, privacy, and trust with your users, and/or maintain a separate secure.example.com domain which won't mess up your main site. If you've been thinking about hosting a site on Tor, then this might be a good option, too.

The best resources that I've found for explaining these steps are https://https.cio.gov , https://certificate-transparency.org , and https://twitter.com/konklone

@jasonruyle
jasonruyle / apply-price-rules.php
Created January 17, 2017 18:36 — forked from Sleavely/apply-price-rules.php
Programmatically apply catalog price rules in Magento
<?php
ini_set('display_errors', '1');
error_reporting(E_ALL);
// Bootstrap Magento
require '../magento/app/Mage.php';
Mage::app('admin', 'store');
try{
$catalogPriceRule = Mage::getModel('catalogrule/rule');
@jasonruyle
jasonruyle / tic-dashboard.json
Last active August 29, 2015 14:06
TIC Dashboard
{
"title": "TIC Dashboard",
"services": {
"query": {
"list": {
"0": {
"query": "severity=info",
"alias": "",
"color": "#7EB26D",
"id": 0,
@jasonruyle
jasonruyle / UFW_ban_country.md
Last active February 4, 2024 15:00
UFW to block countries
@jasonruyle
jasonruyle / commerce_rules_line_item_loop.php
Created January 14, 2014 18:03
Drupal Commerce Rules: Loop through Commerce Line Items
<?php
// Use the code inside rule conditions with a Custom PHP code
// FIELD_MACHINE_NAME example: field_product_free_shipping
global $user;
$commerce_order = commerce_cart_order_load($user->uid);
$line_items = $commerce_order->commerce_line_items['und'];
foreach ($line_items as $lid) {
$line_item = commerce_line_item_load($lid['line_item_id']);
if ( isset($line_item->commerce_product)) {
$pid = $line_item->commerce_product['und'][0]['product_id'];
/* Expect the hover class to be on the body
before doing any hover effects */
.hover .block:hover {
}
@jasonruyle
jasonruyle / iptables_redis_mongo
Created April 17, 2013 19:52
Securing mongodb and redis on ubuntu
# Run in a shell for each service
port="6379" # REDIS Port: 6379
#port="27017" # MONGO Port: 27017
server="servername.com"
iptables -A INPUT -s $servername.com -p tcp -m tcp --dport $port -j ACCEPT
iptables -A INPUT -s localhost -p tcp -m tcp --dport $port -j ACCEPT
iptables -A INPUT -p tcp -m tcp --dport $port -j DROP
# Control your Rules with iptables -L
config.json
reading-image.png
config.json
reading-image.png