Skip to content

Instantly share code, notes, and snippets.

@lunitrixx
lunitrixx / link_post_translation.php
Created September 5, 2023 12:15 — forked from djoo/link_post_translation.php
WPML Custom end point link 2 existing translation
<?php
/**
* Link the FR translation and the EN translation
* Called by API https://domain.com/wp-json/link_translation/post/
*/
function custom_rest_link_translation($data) {
//Source https://wpml.org/wpml-hook/wpml_set_element_language_details/
@lunitrixx
lunitrixx / install.sh
Created August 16, 2023 10:58 — forked from ikr4-m/install.sh
Hyper-V Enhanced Session for Debian
#!/bin/sh
# This script based on linux-vm-tools for Ubuntu 22.02.
# Thanks to https://github.com/Hinara/linux-vm-tools/ to script
# This script is for Ubuntu 22.04 Jammy Jellyfish to download and install XRDP+XORGXRDP via
# source.
#
# Major thanks to: http://c-nergy.be/blog/?p=11336 for the tips.
#
@lunitrixx
lunitrixx / cdn-jquery.php
Created April 6, 2023 10:52 — forked from Shelob9/cdn-jquery.php
Replace WordPress' jQuery with CDN jQuery of the right version
add_action( 'init', function(){
if ( ! is_admin()) {
if( is_ssl() ){
$protocol = 'https';
}else {
$protocol = 'http';
}
/** @var WP_Scripts $wp_scripts */
global $wp_scripts;
@lunitrixx
lunitrixx / move-storage.sh
Created April 1, 2023 14:51 — forked from mrl22/move-storage.sh
Bash script to move storage of all Proxmox Virtual Machines to different storage
#!/bin/sh
movefrom='micronssd'
moveto='wdredpro'
for vm in $(qm list | awk '{print $1}' | grep -Eo '[0-9]{1,3}');
do
for storage in $(qm config $vm | grep $movefrom: | awk '{print $1}' | grep -Eo '[a-z0-9]+');
do
echo Moving VM$vm Storage $storage
@lunitrixx
lunitrixx / docker-compose.yaml
Created March 29, 2023 08:12 — forked from natcl/docker-compose.yaml
docker-compose static IP example
version: '3'
networks:
mynetwork:
ipam:
config:
- subnet: 172.20.0.0/24
services:
nodered1:
image: nodered/node-red-docker
ports:
@lunitrixx
lunitrixx / Ubuntu_on_Hyper-V.md
Created January 26, 2023 05:43 — forked from deoren/Ubuntu_on_Hyper-V.md
Ubuntu on Hyper-V

Enabling full Hyper-V support for Ubuntu

Install packages

Short version: See docs.microsoft.com link below.

Ubuntu 17.04 and later

  1. sudo apt-get update
  2. sudo apt-get install linux-image-virtual linux-tools-virtual linux-cloud-tools-virtual
@lunitrixx
lunitrixx / debian-fullscreen-in-hyperv.md
Created January 25, 2023 18:55 — forked from robert-claypool/debian-fullscreen-in-hyperv.md
How To Make Debian Linux Fullscreen in Hyper-V
@lunitrixx
lunitrixx / README.md
Created January 17, 2023 15:25 — forked from kabili207/Rclone systemd service.md
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@lunitrixx
lunitrixx / upload-a-file.MD
Created January 16, 2023 22:06 — forked from ahmadawais/upload-a-file.MD
Upload a file using the WordPress REST API

Upload files

Using the REST API to upload a file to WordPress is quite simple. All you need is to send the file in a POST-Request to the wp/v2/media route.

There are two ways of sending a file. The first method simply sends the file in the body of the request. The following PHP script shows the basic principle:

@lunitrixx
lunitrixx / setup.md
Created January 12, 2023 20:10 — forked from ibqn/setup.md
Setup VSCode with Live Server and a Docker container

Setup VSCode with Live Server and a Docker container

In this I will shortly describe how to setup

I used a docker-compose.yml file although I only created one container with no other dependencies. This works with a regular Dockerfile as well.