Skip to content

Instantly share code, notes, and snippets.

View mitchellkrogza's full-sized avatar
🤓
Busy ... Always busy

Mitchell Krog mitchellkrogza

🤓
Busy ... Always busy
View GitHub Profile
### Keybase proof
I hereby claim:
* I am mitchellkrogza on github.
* I am mitchellkrog (https://keybase.io/mitchellkrog) on keybase.
* I have a public key ASA1MsGmj-PFzfJI7htumKuWIAVDP6R8fDTXFwBeQqOMtwo
To claim this, I am signing this object:
@mitchellkrogza
mitchellkrogza / meta-tags.md
Created July 17, 2018 07:27 — forked from lancejpollard/meta-tags.md
Complete List of HTML Meta Tags

Copied from http://code.lancepollard.com/complete-list-of-html-meta-tags/

Basic HTML Meta Tags

<meta name="keywords" content="your, tags"/>
<meta name="description" content="150 words"/>
<meta name="subject" content="your website's subject">
<meta name="copyright"content="company name">
<meta name="language" content="ES">

These are only examples, for a few very common actions. You are expected to write your own rules for the rest. The syntax is regular JavaScript, but see the polkit(8) manpage for the object structure and available API. These examples are for polkit versions 106 and later, with the JS interpreter. They won't work with Debian's polkit v105.

  • If you don't know the action name, run pkaction:

    pkaction | grep cups
    
  • The possible results are YES, AUTH_SELF(_KEEP), AUTH_ADMIN(_KEEP), NO. Returning a result is final. Returning null will continue checking other rules.

  • Put your rules in /etc/polkit-1/rules.d/*.rules. (You can check everything in one giant addRule, or you can have a separate file and separate addRule for each program; it doesn't matter.)

@mitchellkrogza
mitchellkrogza / Cerbot Renewals with Mini(Conda) Python, Bash and Cron - Foolproof and Failproof Renewal Script
Last active October 1, 2019 09:10
Fool proof and fail proof Cerbot SSL certificate automated renewal script using a miniConda Python environment, bash and cron.
#!/bin/bash
# -----------------------------------------------------------
# Mini(Conda) Environment for Failproof Certbot Renewals
# Created by Mitchell Krog: https://github.com/mitchellkrogza
# Copyright Mitchell Krog: https://github.com/mitchellkrogza
# GIST: https://gist.github.com/mitchellkrogza/547a850a34d022009e5d80e896684eac
# Last Updated: 2019-10-01 11:11:00 SAST
# -----------------------------------------------------------
# Save as certbot-renewals.sh
@mitchellkrogza
mitchellkrogza / fb_post_photo.sh
Created September 10, 2019 16:13 — forked from fishkingsin/fb_post_photo.sh
post photo with curl and facebook graph
curl 'https://graph.facebook.com/me/photos' -F 'access_token=access_token' -F 'source=@'$1 -F 'message='$(date +"%Y-%m-%d-%S")

Raspberry Pi VPN Router

This is a quick-and-dirty guide to setting up a Raspberry Pi as a "router on a stick" to PrivateInternetAccess VPN.

Requirements

Install Raspbian Jessie (2016-05-27-raspbian-jessie.img) to your Pi's sdcard.

Use the Raspberry Pi Configuration tool or sudo raspi-config to:

Keybase proof

I hereby claim:

  • I am mitchellkrogza on github.
  • I am mitchellkrogza (https://keybase.io/mitchellkrogza) on keybase.
  • I have a public key ASDclc6D97oQyImXQ4qv4aNoymHIyJm0gdjEjor-plBm8go

To claim this, I am signing this object:

@mitchellkrogza
mitchellkrogza / woocommerce-update-prices.sql
Created November 2, 2020 05:48 — forked from yanknudtskov/woocommerce-update-prices.sql
Queries for updating all prices including variations in WooCommerceIn this instance all prices are subtracted 20% (0.8)#woocommerce #mysql
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_regular_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_sale_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_regular_price_tmp' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_sale_price_tmp' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_price_tmp' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_min_variation_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_max_variation_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHERE meta_key = '_min_variation_regular_price' AND meta_value != ''
UPDATE wp_postmeta SET meta_value = meta_value*0.8 WHE
add_action('wp_head', 'inject_flatsomeshop', 5);
function inject_flatsomeshop() {
ob_start();
include 'wp-content/themes/flatsome/assets/css/flatsome-shop.css';
$atf_css = ob_get_clean();
if ($atf_css != "" ) {
echo '<style id="inline-css" type="text/css">'. $atf_css . '</style>';
}
}
add_action('wp_head', 'inject_flatsomeiefallback', 5);
function inject_flatsomeiefallback() {
ob_start();
include 'wp-content/themes/flatsome/assets/css/ie-fallback.css';
$atf_css = ob_get_clean();
if ($atf_css != "" ) {
echo '<style id="inline-css" type="text/css">'. $atf_css . '</style>';
}
}