Skip to content

Instantly share code, notes, and snippets.

View ph33nx's full-sized avatar
♠️

ABHI ph33nx

♠️
  • New Delhi
  • 04:37 (UTC +05:30)
View GitHub Profile
@mtx-z
mtx-z / wp-bootstrap5.0-pagination.php
Last active November 15, 2023 00:47
Wordpress 5.7 Bootstrap 5.0 pagination (with custom WP_Query() and global $wp_query support)
<?php
/**
* @param WP_Query|null $wp_query
* @param bool $echo
* @param array $params
*
* @return string|null
*
* Using Bootstrap 4? see https://gist.github.com/mtx-z/f95af6cc6fb562eb1a1540ca715ed928
*
@dunderrrrrr
dunderrrrrr / GeoIP Block NGINX Ubuntu 20.04.md
Created April 19, 2021 08:28
Allow or block GeoIP in Nginx on Ubuntu 20.04

GeoIP Block NGINX Ubuntu 20.04

Block or filter IPs based on location in Nginx (tested on 1.18.0) on Ubuntu 20.04.

Install Nginx modules

To make use of the geographical filtering, we must first install the Nginx GeoIP module as well as the GeoIP database containing the mappings between visitors’ IP addresses and their respective countries. To do so, let’s execute:

$ sudo apt install libnginx-mod-http-geoip geoip-database
@naveenkrdy
naveenkrdy / AdobeAMDFix.md
Last active March 21, 2024 15:30
To fix adobe products crashes on AMD hackintosh

Adobe Crash Fix XLNC

Instructions

  1. Install needed adobe apps from adobe creative cloud.

  2. Open Terminal.

  3. Copy-paste the below command to your terminal and run it (enter password when asked).

@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active May 22, 2024 01:13
Harden wordpress security nginx
############ WordPress ####################
# Disable logging for favicon and robots.txt
location = /favicon.ico {
try_files /favicon.ico @empty;
access_log off;
log_not_found off;
expires max;
}
@simlei
simlei / bt-from-win
Last active April 11, 2020 23:46
copy bluetooth pairing keys from windows for dual boot -- bash script
#!/usr/bin/env bash
#credits \& original idea: https://unix.stackexchange.com/a/255510
if [[ "$1" == "--help" ]]; then
echo usage: $0 "<WindowsPartition>/Windows/System32/config"
echo if youre already in that directory, you will still have to provide that directory. However, you may then just use \$PWD in its stead.
echo this script will read out all your paired bluetooth device keys from the windows registry and show them to you. optionally, it will drop you into VIM at the approximate location at where you will want to edit stuff. This saves you the hassle of browsing the registry by hand with the chntpw command. However, it may be a good idea to read the original stackexchange post \(see below\). This script is written for ubuntu but may work for other distributions. Good luck!
echo
echo Pain points:
@mikepruett3
mikepruett3 / shell-setup.ps1
Last active May 25, 2024 10:29
Packages to install via scoop, winget, choco, and other tools...
<#
.SYNOPSIS
Script to Initialize my custom powershell setup.
.DESCRIPTION
Script uses scoop
.NOTES
**NOTE** Will configure the Execution Policy for the "CurrentUser" to Unrestricted.
Author: Mike Pruett
Date: October 18th, 2018
@diffficult
diffficult / installing_virt_manager.md
Last active May 21, 2024 18:42
Easy instructions to get virt-manager qemuv/kvm running on Arch

Easy instructions to get QEMU/KVM and virt-manager up and running on Arch

  1. Make sure your cpu support kvm with below command:

     grep -E "(vmx|svm)" --color=always /proc/cpuinfo
    
  2. Make sure BIOS have enable “Virtualization Technology”.

  3. User access to /dev/kvm so add your account into kvm(78) group:

@rohankhudedev
rohankhudedev / opcache.ini
Last active May 7, 2024 08:36
Best Zend OpCache Settings / Tuning / Configurations
[opcache]
; Determines if Zend OPCache is enabled
opcache.enable=1
; Determines if Zend OPCache is enabled for the CLI version of PHP
;opcache.enable_cli=1
; The OPcache shared memory storage size.
opcache.memory_consumption=512
@astamicu
astamicu / Remove videos from Youtube Watch Later playlist.md
Last active May 25, 2024 09:38
Script to remove all videos from Youtube Watch Later playlist

UPDATED 22.11.2022

It's been two years since the last update, so here's the updated working script as per the comments below.

Thanks to BryanHaley for this.

setInterval(function () {
    video = document.getElementsByTagName('ytd-playlist-video-renderer')[0];

 video.querySelector('#primary button[aria-label="Action menu"]').click();
@takeit
takeit / INSTALL.md
Last active March 23, 2024 19:03
Write to NTFS on macOS Sierra (osxfuse + ntfs-3g)
  1. Install osxfuse:
brew cask install osxfuse
  1. Reboot your Mac.

  2. Install ntfs-3g: