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 / wget-download-site.sh
Last active April 20, 2024 04:42
Use wget to get a local copy of a site with all files and folders . This an ideal way to clone a (static html/css/javascript based ) site from the command line. #copy #clone #wget #download
#http://stackoverflow.com/questions/6348289/download-a-working-local-copy-of-a-webpage
#http://stackoverflow.com/questions/8755229/how-to-download-all-file-from-website-using-wget
#http://stackoverflow.com/questions/4272770/wget-with-authentication?rq=1
#add browser headers:
#--header="Accept: text/html" --user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10.8; rv:21.0) Gecko/20100101 Firefox/30.0"
#add .htaccess authentication details:
#--password=password --user=user
wget -m -p -E -k -K -np http://site/path/
wget -p -k http://ExampleSite.com
# and another via Quora https://www.quora.com/How-do-you-export-a-WordPress-site-to-a-static-HTML
@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 / lookforbadguys.php
Created July 28, 2012 00:47
Look for Bad Guys By Karen Chun, Steven Whitney #security #php
<?php
/* lookforbadguys.php 2011-09-27
Copyright (C)2011 Karen Chun, Steven Whitney.
Initially published by http://25yearsofprogramming.com.
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License (GPL)
Version 3 as published by the Free Software Foundation.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
@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