Skip to content

Instantly share code, notes, and snippets.

View rojenzaman's full-sized avatar
🏴
Why?

Rojen Zaman rojenzaman

🏴
Why?
  • localhost
  • Istanbul, Turkey
  • 02:53 (UTC +03:00)
View GitHub Profile
@rojenzaman
rojenzaman / README.md
Last active November 8, 2024 10:54
WordPress Dynamic Data Table Shortcode

WordPress Dynamic Data Table Shortcode

This shortcode generates a paginated, searchable, and sortable data table in WordPress with customizable role-based access control. Ideal for displaying data to specific users with an interactive and secure interface.

Features

  • Search: Supports both global and column-specific searches.
  • Sort: Allows sorting by any column by clicking on headers.
  • Pagination: Includes pagination controls for easy navigation.
  • Access Control: Specify user roles or capabilities with an auth parameter, e.g., [show_data auth="administrator, editor"].
@rojenzaman
rojenzaman / multiple-push-urls.md
Created February 4, 2024 15:37 — forked from bjmiller121/multiple-push-urls.md
Add multiple push URLs to a single git remote

Sometimes you need to keep two upstreams in sync with eachother. For example, you might need to both push to your testing environment and your GitHub repo at the same time. In order to do this simultaneously in one git command, here's a little trick to add multiple push URLs to a single remote.

Once you have a remote set up for one of your upstreams, run these commands with:

git remote set-url --add --push [remote] [original repo URL]
git remote set-url --add --push [remote] [second repo URL]

Once set up, git remote -v should show two (push) URLs and one (fetch) URL. Something like this:

@rojenzaman
rojenzaman / temp.txt
Created January 18, 2024 21:44
Delete this
wget https://github.com/linuxhw/hw-probe/releases/download/1.6/hw-probe-1.6.5-189-x86_64.AppImage
chmod +x ./hw-probe-1.6.5-189-x86_64.AppImage
sudo -E ./hw-probe-1.6.5-189-x86_64.AppImage -all -upload
@rojenzaman
rojenzaman / jammy-static-ip.netplan.yaml
Created August 1, 2023 07:13
Ubuntu 22.04 (Server Edition) Static IP Configuration (Netplan)
network:
renderer: networkd
ethernets:
eth0:
addresses:
- 192.168.1.2/24
nameservers:
addresses: [192.168.1.1,1.1.1.1,1.0.0.1]
routes:
- to: default
@rojenzaman
rojenzaman / stack.yml
Last active October 17, 2022 14:27
Amusewiki Play With Docker
# docker swarm-based
version: '3.8'
services:
app:
# texlive-base and texlive-full not supported due to size
image: rojen/amusewiki:package
environment:
#- PWD_HOST_FQDN=${PWD_HOST_FQDN}
- PWD_HOST_FQDN=labs.play-with-docker.com
- SESSION_ID=${SESSION_ID}
@rojenzaman
rojenzaman / dekstop-file-find.sh
Created July 31, 2022 15:56
Desktop file finder
#!/bin/bash
if [ "$#" -lt 1 ]; then
echo "$(basename "${0}") <name>"
exit 1
fi
find / -type f -name "*.desktop" -exec grep -Hn "${1}" "{}" \;
@rojenzaman
rojenzaman / icons.tar.gz
Last active June 29, 2022 09:51
Telegram icon and desktop file
@rojenzaman
rojenzaman / myweechat.md
Created April 22, 2022 09:46 — forked from pascalpoitras/config.md
My always up-to-date WeeChat configuration (weechat-dev)

WeeChat Screenshot

The squares in the chanmon buffer at the top of weechat in the gif above are there only to hide the nicknames and the messages in the gif to respect users privacies

You need at least WeeChat 3.5-dev

Enable mouse

/mouse enable
@rojenzaman
rojenzaman / emerg_open_error.sh
Created February 5, 2022 09:29
Solve: nginx: [emerg] open() error
mkdir -vp $(dirname "$(nginx -t |& grep '\[emerg\]' | awk '{print $4}' | sed 's/"//g')")