Automating Social Media Post Reactions and Page Invites with JavaScript

When marketing campaigns or organic posts achieve high engagement, many users interact with the content (likes, reactions) without following or liking the parent page. Facebook provides a manual interface to invite users who reacted to a post to like the page. However, manually clicking hundreds of individual invite buttons is tedious. Figure 1: Modal window listing users who reacted to the post. Browser Console Automation Script By executing a lightweight script in the browser’s Developer Tools Console, we can automate scrolling through pagination (See More) and dispatching invite clicks with controlled delays to respect client-side rate limits. ...

July 21, 2016 · 2 min · 356 words · Ahmad Mahfouz

Docker Persistent Storage for MySQL with SELinux Enforcement

Running stateful services like MySQL inside Docker containers requires mapping data volumes to host storage. On enterprise Linux distributions running SELinux in enforcing mode (such as Red Hat Enterprise Linux, CentOS, or Fedora), containerized processes are isolated using Type Enforcement and Multi-Category Security (MCS). If the host directory lacks the appropriate SELinux context and file permissions, the MySQL daemon will encounter Permission denied errors during database initialization. 1. Pull the Official MySQL Image Retrieve the official MySQL container image from Docker Hub: ...

July 16, 2016 · 3 min · 457 words · Ahmad Mahfouz

Advanced iptables: PREROUTING and POSTROUTING with DNAT and SNAT

When deploying jump hosts, transparent proxies, or network bridges across multi-homed Linux systems, standard routing tables are often insufficient. Using the Linux Netfilter framework via iptables, you can manipulate packets at both ingress (PREROUTING) and egress (POSTROUTING). Scenario 1: Basic Traffic Forwarding via DNAT and MASQUERADE In this setup, our Linux server acts as an intermediary bridge forwarding traffic from a client to a remote backend service: Client Source IP: 198.51.100.12 Intermediary Gateway (Our Server): 203.0.113.30 Final Backend Destination: 192.0.2.84 Client [198.51.100.12] ──► Gateway [203.0.113.30] ──► Backend [192.0.2.84] Step 1: Destination NAT in PREROUTING Intercept incoming packets destined for our gateway and rewrite the destination IP before routing lookup occurs: ...

July 14, 2016 · 2 min · 339 words · Ahmad Mahfouz

Fixing phpMyAdmin Error #1146: Table 'phpmyadmin.pma_tracking' Doesn't Exist

When navigating through phpMyAdmin, you may encounter the following error: #1146 - Table 'phpmyadmin.pma_tracking' doesn't exist Figure 1: Missing internal configuration storage tables in phpMyAdmin. This error indicates that phpMyAdmin’s internal metadata and configuration storage database (phpmyadmin) was either skipped during initial package installation or failed to execute its SQL initialization scripts. Solution 1: Reconfigure via dpkg-reconfigure (Recommended) On Debian and Ubuntu systems, the cleanest method to repair the metadata database is using dbconfig-common via dpkg-reconfigure: ...

June 26, 2016 · 1 min · 204 words · Ahmad Mahfouz

Enabling Passwordless Login in phpMyAdmin for Local Development

When configuring a local development environment (such as on a virtual machine or local development container) where MySQL root has an empty password, phpMyAdmin blocks authentication attempts by default with the following error: Login without a password is forbidden by configuration (see AllowNoPassword) This security safeguard prevents accidental deployment of passwordless database instances in publicly accessible environments. Enabling Empty Passwords in config.inc.php To enable passwordless authentication for local sandbox testing, modify the phpMyAdmin configuration file: ...

June 26, 2016 · 1 min · 153 words · Ahmad Mahfouz

Resolving PHP Mcrypt Extension Symlink Conflicts on Ubuntu Server

When configuring legacy PHP environments on Ubuntu Server and attempting to activate the mcrypt cryptographic module, administrators may encounter symlink collision warnings. The Error Condition After installing the extension packages: sudo apt-get install mcrypt php5-mcrypt Attempting to register the module via php5enmod produces the following error: root@ubuntu:~# php5enmod mcrypt WARNING: Not enabling the mcrypt module for apache2 SAPI since module symlink WARNING: already exists in /etc/php5/apache2/conf.d with different content. WARNING: Not enabling the mcrypt module for cli SAPI since module symlink WARNING: already exists in /etc/php5/cli/conf.d with different content. This error occurs when old or stale configuration symlinks pointing to prior configuration targets exist in the SAPI configuration directories (/etc/php5/apache2/conf.d/ and /etc/php5/cli/conf.d/), preventing the package manager from linking the canonical /etc/php5/mods-available/mcrypt.ini. ...

June 26, 2016 · 1 min · 178 words · Ahmad Mahfouz

Docker Architecture and Container Operations Crash Course

Unlike traditional Type-1 and Type-2 hypervisors that virtualize complete hardware stacks and boot independent operating system kernels, containers share the host Linux kernel while isolating processes using kernel Namespaces (PID, NET, IPC, MNT, UTS) and Control Groups (cgroups). Docker packages application dependencies, libraries, and runtime binaries into lightweight, immutable container images. Core Architecture Docker operates under a client-server model: Docker Client (docker): The CLI tool you execute to issue commands. Docker Daemon (dockerd): The background daemon listening for API requests to manage images, containers, networks, and storage volumes. Docker Registry: Public (Docker Hub) or private image repositories. A container lifecycle is tied directly to its primary foreground process (PID 1). When that process exits, the container stops. ...

May 30, 2016 · 2 min · 416 words · Ahmad Mahfouz

Auditing User Keystrokes with pam_tty_audit and Linux Auditd

Relying on standard shell history (~/.bash_history) for security auditing is fundamentally flawed: users can unset HISTFILE, launch sessions inside screen/tmux, prepend commands with spaces, or delete history files before logout. To reliably monitor user commands at the kernel level, Linux provides the pam_tty_audit PAM module. This module enables TTY input logging directly through the Linux Audit daemon (auditd), capturing keystrokes before the shell receives them. Module Parameters pam_tty_audit.so supports three key arguments: ...

October 7, 2015 · 2 min · 292 words · Ahmad Mahfouz

Hardening Linux Boot: Securing GRUB, Single-User Mode, and Console Hotkeys

Physical access to a Linux machine often guarantees total system compromise if boot configurations remain unhardened. By default, anyone with physical or KVM console access can interrupt the GRUB bootloader, append single, init=/bin/sh, or emergency to the kernel arguments, and bypass authentication into a root shell. Securing the boot process requires hardening three independent layers: Password-protecting the GRUB bootloader Requiring authentication for single-user/emergency mode Disabling interactive startup prompts and console reboot hotkeys 1. Password-Protecting Single-User Mode (sulogin) In legacy SysVinit/Upstart configurations (/etc/sysconfig/init): ...

August 17, 2015 · 2 min · 337 words · Ahmad Mahfouz

Mastering SSH Port Forwarding: Local, Remote, and Dynamic SOCKS Proxies

SSH is far more than an encrypted remote terminal—it is an extensible transport protocol capable of encapsulating arbitrary TCP traffic across segmented network boundaries, NAT gateways, and restrictive firewalls. Here is how to leverage Dynamic, Local, and Remote Reverse SSH tunnels. 1. Dynamic Port Forwarding (-D): SOCKS Proxy Dynamic port forwarding turns your SSH client into a local SOCKS5 proxy server. Any application configured to use this proxy routes its network requests through the remote SSH host. ...

August 12, 2015 · 2 min · 306 words · Ahmad Mahfouz