Skip to content

Instantly share code, notes, and snippets.

View alainlankers's full-sized avatar

Alain Lankers alainlankers

View GitHub Profile
@alainlankers
alainlankers / style.css
Created October 29, 2023 17:39
add 3 dots after excerpt in Elementor
.elementor-post__excerpt p:after{
content: "...";
}
@alainlankers
alainlankers / 404.php
Created March 14, 2023 13:06
404 rickroll
<?php
header("HTTP/1.1 301 Moved Permanently");
header("Location: https://www.youtube.com/watch?v=dQw4w9WgXcQ");
exit();
?>
@alainlankers
alainlankers / userconf.txt
Last active July 13, 2022 10:46
default login for Raspberry Pi
// add empty file: ssh
// add userconf.txt with default credentials: pi:raspberry
// put in boot
pi:$6$/4.VdYgDm7RJ0qM1$FwXCeQgDKkqrOU3RIRuDSKpauAbBvP11msq9X58c8Que2l1Dwq3vdJMgiZlQSbEXGaY5esVHGBNbCxKLVNqZW1
@alainlankers
alainlankers / gist:60ee508cce08520bde172ed8f3d7c914
Last active June 19, 2022 11:05
Backup WordPress files in Docker
docker run --rm --volumes-from wordpress -v $(pwd):/backup wordpress:latest tar zcvf /backup/wordpress-files-backup.tar.gz /var/www/html
@alainlankers
alainlankers / gist:3e7ff13b8054d9c9c4a72ed1466bb8c2
Last active June 19, 2022 10:52
Backup WordPress MySQL in Docker
docker exec wp_db mysqldump -uwp_databaseuser -p'wp_databasepassword' wordpress > wordpress-database-backup.sql
@alainlankers
alainlankers / docker-compose.yml
Last active July 4, 2022 14:51
Docker WordPress install
# Create a local WordPress environment using Docker containers.
version: '3.8'
services: # Define each service.
wp_db: # Name of the service (MariaDB server to provide MySQL for a WordPress site).
container_name: wp_db # Give a name to the container.
image: mariadb:latest # The image that will be pulled and run as a container.
volumes: # Create storage on host machine for /var/lib/mysql.
- ./mysql:/var/lib/mysql # <host_filepath>:<container_filepath>
@alainlankers
alainlankers / gist:a9b524f7df95f4095674e3428e9ff62f
Last active June 18, 2022 13:31
SQL query to create WordPress database tables
DROP TABLE IF EXISTS wp_users;
CREATE TABLE wp_users (
ID bigint(20) unsigned NOT NULL auto_increment,
user_login varchar(60) NOT NULL default '',
user_pass varchar(64) NOT NULL default '',
user_nicename varchar(50) NOT NULL default '',
user_email varchar(100) NOT NULL default '',
user_url varchar(100) NOT NULL default '',
user_registered datetime NOT NULL default '0000-00-00 00:00:00',
user_activation_key varchar(60) NOT NULL default '',
@alainlankers
alainlankers / gist:0ef42def8d263e3155ced028ae5c1115
Last active June 17, 2022 14:13
Create MySQL database for WordPress install
$ sudo mysql -u root
mysql> CREATE DATABASE wordpressdb;
mysql> CREATE USER wordpress@localhost IDENTIFIED BY '<your-password>';
mysql> GRANT SELECT,INSERT,UPDATE,DELETE,CREATE,DROP,ALTER
-> ON wordpressdb.*
-> TO wordpress@localhost;
sudo a2enmod rewrite
sudo systemctl restart apache2
sudo nano /etc/apache2/sites-available/000-default.conf
add:
<VirtualHost *:80>
<Directory /var/www/html>
Options Indexes FollowSymLinks
AllowOverride All
@alainlankers
alainlankers / index.html
Created June 10, 2022 18:51
HTML option group
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Document</title>
</head>
<body>
<label for="framework">