Skip to content

Instantly share code, notes, and snippets.

View jasperf's full-sized avatar
🏠
Working from home

Jasper Frumau jasperf

🏠
Working from home
View GitHub Profile
@jasperf
jasperf / ffprobe-mp4.sh
Created April 20, 2024 09:25
ffprobe mp4 format that Apple iOS on iPhone 14 does not play. Could be AVC level issue that causes things to freeze on second chunk 206 status
ffprobe -loglevel error -show_streams ~/Desktop/img-3322-online-video-cuttercom-2.mp4
[STREAM]
index=0
codec_name=aac
codec_long_name=AAC (Advanced Audio Coding)
profile=LC
codec_type=audio
codec_tag_string=mp4a
codec_tag=0x6134706d
sample_fmt=fltp
@jasperf
jasperf / coding-done-per-month.sh
Last active April 16, 2024 02:20
Summary work February based on commit logs, merge requests
git log --since="February 1" --until="March 1" > ~/Documents/site.nl/february_commits.txt
git log --since="March 1" --until="April 1" > march_commits.txt
git log --since="April 1" --until="May 1" > april_commits.txt
git log --since="April 1" --until="April 10" > april_commits_apr1_to_apr9.txt
@jasperf
jasperf / external-user-access.sql
Created March 26, 2024 05:26
add user with remote ip address to allow access to database on secondary server from main server
CREATE USER 'user'@'10.0.0.3' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON database.* TO 'user'@'10.0.0.3' IDENTIFIED BY 'password';
FLUSH PRIVILEGES;
@jasperf
jasperf / wp-post-object-check.php
Created February 21, 2024 09:06
WP_Post Object checkj
if( is_a( $post, 'WP_Post' ) ) {
write_log( 'WP_Post' );
} else {
write_log( 'WP_Post is not a WP_Post' );
}
$category_filters = xx_get_category_filter( $post, $the_term->slug );
@jasperf
jasperf / site-import-and-acl.sh
Last active February 17, 2024 01:31
Download WordPress site to new server, import database , run set perm script and install acl
mkdir backups
ll
cd backups
wget https://domain.nl/domain.nl_root--2024.02.09.sql.gz
ll
mysql dbasename < domain.nl_root--2024.02.09.sql -u dbase_admin -p
mc
wget https://public_html.tar.gz/public_html.tar.gz
wget https://domain.nl/public_html.tar.gz
ll
@jasperf
jasperf / ssh-key.ssh
Last active February 6, 2024 11:55
Ssh Key Generation for server access via ssh
ssh-keygen -t rsa -C "jasper@doamin.com" -f ~/.ssh/name
ssh-keygen -t rsa -b 4096 -f ~/.ssh/name
@jasperf
jasperf / script-runner.php
Last active January 31, 2024 01:39
Basic WordPress Plugin to run scripts on server
<?php
/*
Plugin Name: Custom Script Runner
Description: Allows users to run a custom PHP script.
Version: 1.0
Author: Your Name
*/
// Define the page where the script can be run
function custom_script_runner_menu() {
@jasperf
jasperf / setfacl-deployment.hs
Created January 30, 2024 10:05
set acl for deployment user for Ubuntu set up site so it can access webroot run by other system user
sudo setfacl -Rm u:deployment:rwx /home/user/site.nl/public
@jasperf
jasperf / functions-v2.php
Last active January 4, 2024 03:53
Short description display count filter for Restaurant for WooCommerce Plugin (v2 is new version)
<?php
add_filter('wc_rms_change_short_desc_disp_count', 'wc_rms_change_short_desc_disp_count_updated', 100, 2);
/**
* Filter callback function for modifying the short description displayed count.
*
* This function is hooked to the 'wc_rms_change_short_desc_disp_count' filter
* and is designed to modify the short description of a WooCommerce product.
*
* @param string $desc The original short description of the product.
* @param object $prod The WooCommerce product object.
@jasperf
jasperf / rm-nm-from-git-versioning.sh
Created December 27, 2023 03:21
Remove node modules from GIt version control
# add node_modules line to .gitignore file
# run this command
git rm -r --cached node_modules
# Now you can commit your repository without node_modules:
git commit -m "Removed node_modules"
# And push your changes:
git push origin master