Skip to content

Instantly share code, notes, and snippets.

View angelcosta's full-sized avatar
🌐
Working from home

Angel Costa angelcosta

🌐
Working from home
View GitHub Profile
@S4tyendra
S4tyendra / Complete VPS Setup Guide - Ubuntu Server.md
Created January 25, 2025 05:24
A comprehensive guide for setting up and optimizing an Ubuntu VPS server with essential services and security configurations.

Features:

  • 🔒 Secure SSH configuration
  • 🐍 Python environment with deadsnakes PPA
  • 🚀 Nginx with UI management
  • 🐳 Docker and Docker Compose
  • 🔑 SSL/TLS with Let's Encrypt
  • 📊 MongoDB Atlas integration
  • 💾 Swap and system optimization
  • 🔄 Auto-renewal and maintenance scripts
  • ⏰ Custom MOTD with system stats
@AidasK
AidasK / HowToDeleteAllCloudflareRecors.md
Last active November 5, 2024 17:22
Cloudflare delete all DNS records. Just go to cloudflare dns zones, open your browers developer console and paste this javascript code.

image

Real developers are not used to clicking, it's allways easier to write a script to do it for you.
@FreshLondon
FreshLondon / backup-s3.sh
Last active June 21, 2024 18:50
Custom backup script for CWP > Amazon S3 bucket
#!/usr/bin/bash
# CWP - Custom backup script
# Modified for external Amazon S3 buckets
# based on a backup script by ejsolutions/Teo/cynique
#
# Set the following 3 items to suit
tmp_dir=/home/backups_tmp/
s3_bucket=YOUR-BUCKET-NAME-HERE
retention=1
# -------------------
@rachids
rachids / settings.json
Last active August 13, 2024 16:16
Integrate Laragon's terminal (CMDer) to Visual Studio Code
{
"terminal.integrated.profiles.windows": {
"PowerShell": {
"source": "PowerShell",
"icon": "terminal-powershell"
},
"Command Prompt": {
"path": [
"${env:windir}\\Sysnative\\cmd.exe",
"${env:windir}\\System32\\cmd.exe"
// (1) function to get KV variables
const _ENV = () => [replace-with-namespace-name].get('_ENV');
let ENV={};
// (2) listen for a request
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
// (3) function to log to LOGDNA
@cabrerahector
cabrerahector / wordpress-sort-posts-by-views.md
Last active April 15, 2023 17:57
[WordPress Popular Posts] Adding Views column to the Posts Manage page

Adding Views column to the Posts Manage page

This Gist shows how to add a sortable Views column to the post/page/custom-post-type edit screen.

Out of the box, the script will display the Views column on both the Posts and Pages screens. You can change that by editing the $post_types_with_views_column array at the beginning of the script.

How do I add this to my site?

  1. Using the text editor of your preference, create a file called wpp-sortable-columns.php and add the contents of this script to it.
  2. Place the wpp-sortable-columns.php file in wp-content\plugins.
@JoelEadeDesign
JoelEadeDesign / elementor-custom-fonts.php
Created January 7, 2019 00:41
Add Custom Font Names to Elementor & GeneratePress Font Family drop-down
/* ------------------------------------
/* CUSTOM FONTS
/* ------------------------------------ */
/* ELEMENTOR */
function modify_controls( $controls_registry ) {
// First we get the fonts setting of the font control
$fonts = $controls_registry->get_control( 'font' )->get_settings( 'options' );
// Then we append the custom font family in the list of the fonts we retrieved in the previous step
$new_fonts = array_merge( [ 'Biotif' => 'system' ], $fonts );
@amanjuman
amanjuman / Sendy Nginx Config
Last active May 1, 2025 20:40
Sendy Nginx Config for PHP8.1 FPM
sudo su
//Setup Hostname
hostnamectl set-hostname subdomain.domain.tld
## Basic
sudo apt-get update && sudo apt-get -y upgrade && sudo apt-get autoremove -y && sudo apt-get install software-properties-common
//Setup SWAP
sudo fallocate -l 1G /swapfile;
ls -lh /swapfile;
@jclarke
jclarke / no_admin_confirm.php
Last active November 27, 2021 13:03
Disables the confirm password feature in the WHMCS admin area. Place in includes/hooks
<?php
add_hook('AdminLogin', 1, function($vars) {
$_SESSION["AuthConfirmationTimestamp"] = \Carbon\Carbon::now()->timestamp;
});
add_hook('AdminAreaHeadOutput', 1, function($vars) {
$_SESSION["AuthConfirmationTimestamp"] = \Carbon\Carbon::now()->timestamp;
return '
<script type="text/javascript">
$(document).ready(function(){
@Nilpo
Nilpo / allow
Created September 16, 2016 01:40 — forked from Mteigers/allow
CSF Allow AND Ignore Cloudflare IPv4 IP's.
for i in `curl https://www.cloudflare.com/ips-v4`; do csf -a $i; done