Skip to content

Instantly share code, notes, and snippets.

View mrl22's full-sized avatar
💭
Always coding

Richard Leishman mrl22

💭
Always coding
View GitHub Profile
@mrl22
mrl22 / imapsync.md
Created November 9, 2023 14:34 — forked from nosmall/imapsync.md
Imapsync on Ubuntu 20.04 (lazy guide)

Imapsync on Ubuntu 20.04 (lazy guide)

sudo apt install -y libauthen-ntlm-perl libclass-load-perl libcrypt-ssleay-perl libdata-uniqid-perl libdigest-hmac-perl libdist-checkconflicts-perl libencode-imaputf7-perl libfile-copy-recursive-perl libfile-tail-perl libio-compress-perl libio-socket-inet6-perl libio-socket-ssl-perl libio-tee-perl libmail-imapclient-perl libmodule-scandeps-perl libnet-dbus-perl libnet-ssleay-perl libpar-packer-perl libreadonly-perl libregexp-common-perl libsys-meminfo-perl libterm-readkey-perl libtest-fatal-perl libtest-mock-guard-perl libtest-mockobject-perl libtest-pod-perl libtest-requires-perl libtest-simple-perl libunicode-string-perl liburi-perl libtest-nowarnings-perl libtest-deep-perl libtest-warn-perl make cpanminus && \
cd ~/ && \
git clone https://github.com/imapsync/imapsync.git && \
cd ~/imapsync/ && \
sudo ln -s ~/imapsync/imapsync /usr/bin/imapsync && \
imapsync --testslive
Shopify objects that contain attributes that can be dynamically put on the page. For example, the product object contains an attribute called title that can be used to output the title of a product.
The handle is used to access the attributes of a Liquid object. By default, it is the object’s title in lowercase with any spaces and special characters replaced by hyphens (-). Every object in Liquid (product, collection, blog, menu) has a handle.
Collections & Products
Collection ►
all_types ►
Returns a list of all the product types for a collection
@mrl22
mrl22 / zabbix_agent_install.sh
Last active September 12, 2021 14:30 — forked from freeminder/zabbix_agent_install.sh
Zabbix Agent installation script
#!/bin/bash -e
if [ "$UID" -ne 0 ]; then
echo "Please run as root"
exit 1
fi
# Only run it if we can (ie. on Ubuntu/Debian)
if [ -x /usr/bin/apt-get ]; then
apt-get update
@mrl22
mrl22 / create-swapfile.md
Created September 9, 2021 17:36 — forked from dgoguerra/create-swapfile.md
create swapfile in ubuntu

Taken from a DigitalOcean tutorial.

Create and enable swapfile:

# create a 2GB file only accessible by root
sudo fallocate -l 2G /swapfile
sudo chmod 600 /swapfile

# mark the file as a swap space
@mrl22
mrl22 / ubuntu-hardening.md
Created August 25, 2021 13:55 — forked from lokhman/ubuntu-hardening.md
List of things for hardening Ubuntu

WARNING

May contain out of date information. Check the comments below!

The list of actions listed below was taken mostly from Book Of Zeus with minor modifications and did the job well for Ubuntu version, which was available at that moment (May 2016). This gist was created for internal use and was never meant to be discovered by the web, although Google managed to find and index this page, which was a great surprise for me. Please check the original source for the updated information (links are provided in most of the sections), and read the comments below: they provide more details about the usage experience.

System Updates

http://bookofzeus.com/harden-ubuntu/initial-setup/system-updates/

Keeping the system updated is vital before starting anything on your system. This will prevent people to use known vulnerabilities to enter in your system.

@mrl22
mrl22 / .htaccess
Created September 19, 2019 14:57 — forked from ibnuh/.htaccess
Laravel's cpanel htaccess
<IfModulemod_rewrite.c>
RewriteEngine On
RewriteRule ^(.*)$ public/$1 [L]
</IfModule>
@mrl22
mrl22 / function.php
Created November 20, 2018 12:19 — forked from brendonexus/function.php
Get WordPress Primary Category
// get primary category - must have Yoast SEO installed
function get_primary_category($post_id){
$term_list = wp_get_post_terms($post_id, 'category', ['fields' => 'all']);
foreach($term_list as $term) {
if( get_post_meta($post_id, '_yoast_wpseo_primary_category',true) == $term->term_id ) {
return $term;
}
}
}
@mrl22
mrl22 / style.scss
Created October 30, 2018 14:48 — forked from brendonexus/style.scss
Margin/Padding mixins with media queries
//This is for bootstrap 4 - given the media queries. Can easily be changed for Bootstrap 3
$xl-down: "max-width: 9999px";
$lg-down: "max-width: 1199px";
$md-down: "max-width: 991px";
$sm-down: "max-width: 767px";
$xs-down: "max-width: 575px";
$xl-up: "min-width: 1200px";
$lg-up: "min-width: 992px";
@mrl22
mrl22 / style.scss
Last active February 21, 2019 12:42 — forked from brendonexus/style.scss
Bootstrap 3 SCSS Media Queries
$lg: "min-width: 1200px";
$md: "max-width: 1199px";
$sm: "max-width: 991px";
$xs: "max-width: 767px";
$lg-up: "min-width: 1199px";
$md-up: "min-width: 991px";
$sm-up: "min-width: 767px";
$xs-up: "min-width: 0px";
@mrl22
mrl22 / tanzhen.php
Created April 12, 2018 12:42 — forked from ivmm/tanzhen.php
<?php
/* ---------------------------------------------------- */
/* 程序名称: PHP探针-Yahei
/* 程序功能: 探测系统的Web服务器运行环境
/* 程序开发: Yahei.Net
/* 联系方式: info@Yahei.net
/* Date: 1970-01-01 / 2012-07-08
/* ---------------------------------------------------- */
/* 使用条款:
/* 1.该软件免费使用.