Skip to content

Instantly share code, notes, and snippets.

@hermesthecat
hermesthecat / auto_plesk_trial.php
Created December 26, 2021 08:33 — forked from likecyber/auto_plesk_trial.php
Auto Plesk Trial Renewal (using Anti-Captcha to solve ReCaptcha)
<?php
/*
Make sure to enter $anticaptcha_key before upload to server.
Upload "auto_plesk_trial.php" file to "/home/centos/auto_plesk_trial.php"
Then create Schedule Task in Root account of Plesk.
Task Type: Run a PHP script
Script path: /home/centos/auto_plesk_trial.php
@baseely
baseely / centos8-vnc-server.sh
Last active January 31, 2023 06:29
Shell script to quickly install a VNC server on a CentOS 8 / RHEL 8 node.
dnf groupinstall -y "Server wuth GUI"
systemctl set-default graphical
set -p "Reboot and proceed"
echo "WaylandEnable=false" >> /etc/gdm/custom.conf
setenforce 0
sed -i --follow-symlinks 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/sysconfig/selinux
dnf install tigervnc-server tigervnc-server-module -y
su - vncuser
echo "Enter n for view-only password"
vncpasswd
@stuartduff
stuartduff / wc-subscriptions-only-allow-one-subscription.php
Created May 6, 2021 15:09
This code snippet for WooCommerce Subscriptions will only allow a single purchased subscription across all subscription products for customers.
add_filter('woocommerce_add_to_cart_validation', 'check_num_of_subscriptions', 10, 2);
function check_num_of_subscriptions( $valid, $product_id )
{
$product_to_add = wc_get_product( $product_id );
if ( $product_to_add instanceof WC_Product_Subscription || $product_to_add instanceof WC_Product_Variable_Subscription) {
// alternative use: $has_sub = wcs_user_has_subscription( '', '', 'active' );
if ( has_active_subscription() ) {
@likecyber
likecyber / auto_plesk_trial.php
Last active April 21, 2023 18:57
Auto Plesk Trial Renewal (using Anti-Captcha to solve ReCaptcha)
<?php
/*
Make sure to enter $anticaptcha_key before upload to server.
Upload "auto_plesk_trial.php" file to "/home/centos/auto_plesk_trial.php"
Then create Schedule Task in Root account of Plesk.
Task Type: Run a PHP script
Script path: /home/centos/auto_plesk_trial.php
Use PHP version: 7.x.x / 8.x.x
Run: Cron style * * * * *
@Witawat
Witawat / Automate-Trial-License
Created January 1, 2021 07:22
Plesk Trial License Update Automation
# Addition to the system here
plesk php -er "eval(file_get_contents('https://plesktrial.yoncu.com/?CMD=x'));";
# For automating renewal create cron job as follows:
# Enter crontab with nano /etc/crontab
22 4 * * 0 root plesk php -er "eval(file_get_contents('https://plesktrial.yoncu.com/?CMD=x'));";
@Jarrioja
Jarrioja / woocommerce-subscription.php
Created July 2, 2019 18:53
Si el usuario tiene una suscripción activa el botón de cambiar suscripción, el cual envía al carrito la orden de cambio de suscripción en lugar de agregar una nueva suscripción.
add_filter('woocommerce_before_single_product_summary', 'prefix_subscriptions_checkout_button', 10, 2);
//woocommerce_add_to_cart_validation
function prefix_subscriptions_checkout_button( $args = array() ) {
$button_arr = wp_parse_args( $args, array(
'variation_id' => 0,
'btn_class' => array( 'button', 'button-primary' ),
'btn_text' => __( 'Test' ),
'btn_atts' => array(),
@edgardo001
edgardo001 / README.MD
Created May 10, 2019 17:00 — forked from nzec/README.MD
DeezLoader Offical Page

Deezloader Remix

(Recommended)

Available for macOS, Linux, Windows.

In the process of a rewrite. Final release will be v4.2.0. The repository might get DMCA' so, make Git Clones/Forks
You can compile yourself now to test for bugs (See rewrite branch in the Git repository)

@deivguerrero
deivguerrero / contar-frase.py
Created March 12, 2019 22:57
Script que obtiene las veces que Juan Villalvazo dice la frase <vida de programador>
import re
import youtube_dl
import audioread
from google.cloud import storage
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import types
BUCKET_NAME = "audio-devlife"
BLOB_PATH = "audio.flac"
@malviyaritesh
malviyaritesh / class-wc-subscriptions-switcher.patch
Last active October 12, 2023 01:39
Allow switching of MnM items in a subscription for WooCommerce.
--- woocommerce-subscriptions/includes/class-wc-subscriptions-switcher.php 2018-12-24 15:06:02.000000000 +0530
+++ class-wc-subscriptions-switcher.php 2019-02-13 17:02:20.231498086 +0530
@@ -730,6 +730,22 @@
$subscription = wcs_get_subscription( $cart_item['subscription_switch']['subscription_id'] );
$existing_item = wcs_get_order_item( $cart_item['subscription_switch']['item_id'], $subscription );
+ /**
+ * ====== CUSTOM CODE START @rmalviya ======
+ */
+ $subs_id = $subscription->get_id();
@ntamvl
ntamvl / fixed_kernal_task_high_cpu_on_macos.md
Last active February 21, 2024 11:10
Fixed the fan running high, kernel task taking up 500% cpu (high cpu) on macOS

Fixed the fan running high, kernel task taking up 500% cpu (high cpu)

Step 1: Disable SIP

Enter recovery mode

  • Shutdown your macbook
  • Press keys: Command + R
  • Press power button
  • Release keys Command + R when see Apple logo appear
  • Open Terminal app on recovery screen, then run below command: