Skip to content

Instantly share code, notes, and snippets.

View Anasxrt's full-sized avatar
🤗
Casual coder, Full-time SysAdmin

Montri Udomariyah Anasxrt

🤗
Casual coder, Full-time SysAdmin
  • Anasx Limited
  • BKK, TH
  • Facebook anasxrt
View GitHub Profile
# Cloudways Shell Aliases for Real-World Productivity
#
# Cloudways SSH environments come with a bare-bones shell—no 'll', no 'la',
# and no aliases for tools like `git`, `wp`, or even basic navigation.
# For developers, sysadmins, and anyone managing WordPress or Laravel setups,
# this means extra keystrokes and slower workflows.
#
# The aliase is base from oh-my-zsh, but I have removed the comments and the aliases that are not useful for me.
#
# This file contains a curated set of bash aliases that cover:
@yorickdowne
yorickdowne / friday.md
Last active December 7, 2025 11:46
Debian 13 trixie upgrade

Debian 13

Caution Upgrading from Debian 12 to Debian 13 on machines with mdadm has intermittently failed for me; symptom is that grub EFI is not up to date and system boots into BIOS. Root cause under investigation; it might not be related to mdadm.

To start, read the official release notes.

If your install fits into "vanilla Debian plus maybe a handful of 3rd-party repos", then this guide for a simple upgrade to Debian 13 "trixie" from Debian 12 "bookworm" can be helpful. 3rd-party repos are handled with a find command.

Note upgrade is only supported from Debian 12 to Debian 13. If you are on Debian 11, upgrade to Debian 12 first. Then once on Debian 12, you can upgrade to Debian 13.

@davidjguru
davidjguru / bash_aliases
Last active August 2, 2025 18:27
BASH Aliases commands for a Linux (Debian / Ubuntu) environment
## Morning Opertures
alias whatsup='service --status-all'
alias hello='sudo /etc/init.d/apache2 stop && cd workspace/project && ddev start && ddev launch'
alias hi='sudo systemctl stop apache2'
alias iad='systemctl is-active docker'
alias ports='nmap localhost'
alias dns="sudo systemd-resolve --status | grep 'DNS Servers'"
alias bye='shutdown -r now'
## Usual Instructions
@nicksherron
nicksherron / disable-transparent-huge-pages.service
Last active January 22, 2024 21:32
systemd service for disabling Transparent Huge Pages (THP) for dbs like mongodb and redis
[Unit]
Description=Disable Transparent Huge Pages (THP)
DefaultDependencies=no
After=sysinit.target local-fs.target
Before=mongod.service
[Service]
Type=oneshot
ExecStart=/bin/sh -c 'echo never | tee /sys/kernel/mm/transparent_hugepage/enabled > /dev/null'
@nfsarmento
nfsarmento / nginx-wordpress.conf
Last active November 27, 2025 07:52
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;
}
@Friz-zy
Friz-zy / nginx_with_cache.conf
Last active July 1, 2025 14:52
Nginx cache example config
# Based on articles:
# https://ruhighload.com/%D0%9A%D1%8D%D1%88%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5+%D1%81+nginx
# https://wiki.enchtex.info/practice/nginx/cache
# https://gist.github.com/yanmhlv/5612256
# https://nginx.org/en/docs/http/ngx_http_fastcgi_module.html
# https://blog.runcloud.io/2017/10/28/nginx-caching-tutorial-wordpress.html
# https://www.digitalocean.com/community/tutorials/how-to-setup-fastcgi-caching-with-nginx-on-your-vps
# https://easyengine.io/wordpress-nginx/tutorials/single-site/fastcgi-cache-with-purging/
@ethanpil
ethanpil / wp-secure.conf
Created May 12, 2017 16:16
Wordpress Security for NginX
# wp-secure.conf
#
#
# This file includes common security considerations for wordpress using nginx.
#
# The goal is to block actions which are usually dangerous to wordpress.
# Additionally, we block direct access to PHP files and folders which should not
# be accessed directly from a browser.
#
# Also have included exceptions for plugins that are known to require this access.
@thomasjsn
thomasjsn / nginx-microcache.conf
Created August 4, 2016 18:35
Configuration for microcaching on nginx.
# Setup var defaults
set $no_cache "";
# If non GET/HEAD, don't cache & mark user as uncacheable for X second(s) via cookie
if ($request_method !~ ^(GET|HEAD)$) {
set $no_cache "1";
}
# Drop no cache cookie if need be (for some reason, add_header fails if included in prior if-block)
if ($no_cache = "1") {
; Enable APCu extension module
extension = apcu.so
; This can be set to 0 to disable APCu
apc.enabled=1
; Setting this enables APCu for the CLI version of PHP
; (Mostly for testing and debugging).
;apc.enable_cli=0
@fideloper
fideloper / update_curl.sh
Last active November 3, 2025 01:16
Update curl on Ubuntu 14.04
#! /usr/bin/env bash
# Install any build dependencies needed for curl
sudo apt-get build-dep curl
# Get latest (as of Feb 25, 2016) libcurl
mkdir ~/curl
cd ~/curl
wget http://curl.haxx.se/download/curl-7.50.2.tar.bz2
tar -xvjf curl-7.50.2.tar.bz2