Skip to content

Instantly share code, notes, and snippets.

<?php
if (!function_exists('get_post_id_by_meta_key_and_value')) {
/**
* Get post id from meta key and value
* @param string $key
* @param mixed $value
* @return int|bool
* @author David M&aring;rtensson <david.martensson@gmail.com>
*/
function get_post_id_by_meta_key_and_value($key, $value) {
@janeczku
janeczku / dnsexit.sh
Last active September 24, 2023 20:17 — forked from briped/gratisdns.sh
A custom module to use DDNS provider "DNSexit.com" with Synology's DDNS update service
#!/bin/sh
# dnsexit.sh - A DnsExit.com DDNS custom module for Synology DSM
#
# Author:
# Brian Schmidt Pedersen (http://blog.briped.net)
#
# Version:
# 1.3.5
@janeczku
janeczku / ocp.php
Last active August 29, 2015 14:12 — forked from ck-on/ocp.php
timezone
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok)
Version: 0.1.6
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.1.8 2014-02-25 Added HTTP Basic Auth
0.1.7 2014-02-25 set timezone
@janeczku
janeczku / ocp.php
Last active August 29, 2015 14:12 — forked from kabel/ocp.php
<?php
/*
OCP - Opcache Control Panel (aka Zend Optimizer+ Control Panel for PHP)
Author: _ck_ (with contributions by GK, stasilok, n1xim, pennedav, kabel)
Version: 0.2.0
Free for any kind of use or modification, I am not responsible for anything, please share your improvements
* revision history
0.2.0 0000-00-00 Updated page layout/styles and restructure code to be more MVC-like (kabel)
implemented HTTP Basic authentication (pennedav)
@janeczku
janeczku / cloudfront-ip-ranges-updater.sh
Last active July 15, 2022 16:32
Cron script that updates CloudFront ip ranges for use with nginx real-ip module
#!/bin/bash
# (The MIT License)
#
# Copyright (c) 2015 Jan Broer
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
@janeczku
janeczku / vultr-coreos-bootstrap.sh
Last active August 13, 2021 15:14
Cloud-config for CoreOS IPXE deployment on Vultr. Provisioning etcd, fleet, private network and docker compatible firewall. #tags: foo, bar
#!/bin/bash
# Cloud-config for CoreOS IPXE deployment on Vultr
##################################################
# This cloud-config bootstraps CoreOS on /dev/vda and provisions:
# - private ip-address on eth1
# - etcd on private network
# - fleet on private network
# - basic firewall (docker compatible)
# - SSHd security hardening
##################################################
@janeczku
janeczku / gist:62198a2ef568bc63f8fe
Last active August 29, 2015 14:21
IPXE boot script for bootstrapping CoreOS on Vultr instances. Works in conjunction with the cloud-config script found here: https://gist.github.com/janeczku/899e96644d315ae0766c
#!ipxe
# This boots the current stable release of CoreOS to ramdisk and applies the cloud-config
# script located at $cloud-config-url.
# All configuration (ssh-key, hostname, etc...) should be done in the cloud-config script.
# See here https://gist.github.com/janeczku/899e96644d315ae0766c
set base-url http://stable.release.core-os.net/amd64-usr/current
kernel ${base-url}/coreos_production_pxe.vmlinuz cloud-config-url=https://gist.githubusercontent.com/janeczku/899e96644d315ae0766c/raw/207637bd78af37b00b072f42b4105cb761fa8018/vultr-coreos-bootstrap.sh
initrd ${base-url}/coreos_production_pxe_image.cpio.gz
@janeczku
janeczku / cloud-config.yaml
Last active June 7, 2018 13:57
RancherOS iPXE boot script and cloud-config. Ramdisk based deployment with persistent storage on disk. Configures private IP on eth1 from EC2 metadata.
#cloud-config
hostname: rancher-os
ssh_authorized_keys:
- ssh-rsa REPLACE_WITH_PUBLIC_SSH_KEY
rancher:
debug: false
cloud_init:
datasources:
- ec2
state:
@janeczku
janeczku / 10-disable-ipv6.conf
Last active October 14, 2022 01:00
BASIC SYSCTL CONFIG
## disable ipv6
#net.ipv6.conf.all.disable_ipv6=1
#net.ipv6.conf.default.disable_ipv6=1
#net.ipv6.conf.lo.disable_ipv6=1
@janeczku
janeczku / README.md
Last active April 21, 2020 03:49
Batch delete those unused stale forked repositories in your Github account

Cleaning up your Github account from those repositories you once forked and then forgot about is a tedious process when done manually.

Lets speed up this process with some automagic:

  1. Open all repositories that you want to delete in new browser tabs
  2. Use https://chrome.google.com/webstore/detail/onetab/chphlpgkkbolifaimnlloiipkdnihall?hl=en to shorten them to a list and export the URL's as a text file
  3. In a text editor shorten the URL's to just the last part (username/repositoryname)
  4. Create a new personal API token with capability to delete repositories and paste that token in the script
  5. Run ./clean-repos.sh