Skip to content

Instantly share code, notes, and snippets.

@bakar-io
bakar-io / run multiple Redis instances on Ubuntu 20.04.md
Last active December 2, 2022 10:50 — forked from inecmc/notes.md
How to run multiple Redis instances on Ubuntu 20.04

Create the directory for the new instance

$ sudo install -o redis -g redis -d /var/lib/redis2

Create a new configuration file

$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
@caeb92
caeb92 / README.MD
Created February 22, 2020 21:24
PM2 fork and cluster mode configuration examples

Configure a new PM2 ecosytem

You must especificate the file JSON wich have the proper configuration for your app wich environment do you want to use (declared in your ecosystem file).

pm2 start ecosystem_cluster_mode.json --env production
pm2 save (Autostart your application when PM2 service is started/restarted)
pm2 ls (Shows PM2 runnings apps)
netstat -ntpl | grep pm2 (Filter running PM2 applications)

Flag --env

@hassanjamal
hassanjamal / php-code-inspection.md
Created October 3, 2017 10:23
How to install PHP code inspection tools using homebrew-php and how to integrate with JetBrain's IntelliJ or PhpStorm

#Inspection Tools with homebrew-php#

##Prerequisites##

  • Homebrew is installed

##Step 1: Installing homebrew-php##

  1. brew tap homebrew/dupes
  2. brew tap josegonzalez/homebrew-php
  3. brew install PHP53 (or other version of your choice)
@schilke
schilke / functions.php
Last active February 23, 2023 18:53
How to load CSS files asynchronously in WordPress (using Scott Jehl's "loadCSS")
<?php
// This is the cleaner code per request of a thread in the LinkedIn group "WordPress"
// ...
// register and enqueue loadCSS
function load_scripts_and_styles() {
// register loadCSS
wp_register_script( 'load-css-async', get_stylesheet_directory_uri() . '/path/to/js/loadCSS.js', array(), '', false );
@tleish
tleish / mysql_backup.sh
Last active October 30, 2024 16:05
Bash Script to backup all MySQL databases
#!/bin/bash
#==============================================================================
#TITLE: mysql_backup.sh
#DESCRIPTION: script for automating the daily mysql backups on development computer
#AUTHOR: tleish
#DATE: 2013-12-20
#VERSION: 0.4
#USAGE: ./mysql_backup.sh
#CRON:
# example cron for daily db backup @ 9:15 am
@rafaelfoster
rafaelfoster / rescan.sh
Last active October 8, 2024 12:20 — forked from skarllot/rescan.sh
Rescan the devices (can detect new space when disk is resized OR new devices that were attached)
# Reference: http://blog.gurudelleccelsopicco.org/2009/09/online-lun-expansion-and-partition-resizing-without-reboot-under-linux/
echo 1 > /sys/block/[DEVICE]/device/rescan
# DETECT IF NEW DISKS ARE ATTACHED TO THE HOST
# Reference: http://www.cyberciti.biz/tips/vmware-add-a-new-hard-disk-without-rebooting-guest.html
ls /sys/class/scsi_host