Skip to content

Instantly share code, notes, and snippets.

@sen0rxol0
sen0rxol0 / nginx-tuning.md
Created June 30, 2020 10:51 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

NGINX Tuning For Best Performance

For this configuration you can use web server you like, i decided, because i work mostly with it to use nginx.

Generally, properly configured nginx can handle up to 400K to 500K requests per second (clustered), most what i saw is 50K to 80K (non-clustered) requests per second and 30% CPU load, course, this was 2 x Intel Xeon with HyperThreading enabled, but it can work without problem on slower machines.

You must understand that this config is used in testing environment and not in production so you will need to find a way to implement most of those features best possible for your servers.

@sen0rxol0
sen0rxol0 / ping.php
Created December 5, 2019 03:29 — forked from BramEsposito/ping.php
PHP Pinger
<?php
// from: http://stackoverflow.com/questions/7372780/creating-a-ping-uptime-service-with-php
// TODO: add string recognition to check specific pages
//Config information
$email = "[email protected]";
$server = "google.com"; //the address to test, without the "http://"
@sen0rxol0
sen0rxol0 / disable.sh
Created November 26, 2019 19:15
Disable bunch of #$!@ in Catalina
#!/bin/bash
# IMPORTANT: Don't forget to logout from your Apple ID in the settings before running it!
# IMPORTANT: You will need to run this script from Recovery. In fact, macOS Catalina brings read-only filesystem which prevent this script from working from the main OS.
# This script needs to be run from the volume you wish to use.
# E.g. run it like this: cd /Volumes/Macintosh\ HD && sh /Volumes/Macintosh\ HD/Users/sabri/Desktop/disable.sh
# WARNING: It might disable things that you may not like. Please double check the services in the TODISABLE vars.
# Get active services: launchctl list | grep -v "\-\t0"
# Find a service: grep -lR [service] /System/Library/Launch* /Library/Launch* ~/Library/LaunchAgents
#!/usr/bin/env bash
# ~/.macos — https://mths.be/macos
# https://github.com/mathiasbynens/dotfiles/blob/master/.macos
# Close any open System Preferences panes, to prevent them from overriding
# settings we’re about to change
osascript -e 'tell application "System Preferences" to quit'
# Ask for the administrator password upfront
@sen0rxol0
sen0rxol0 / pseudo_elements.md
Created October 16, 2019 16:12 — forked from p3t3r67x0/pseudo_elements.md
A CSS pseudo-element is used to style specified parts of an element. In some cases you can style native HTML controls with vendor specific pseudo-elements. Here you will find an list of cross browser specific pseudo-element selectors.

Styling native elements

Native HTML controls are a challenge to style. You can style any element in the web platform that uses Shadow DOM with a pseudo element ::pseudo-element or the /deep/ path selector.

video::webkit-media-controls-timeline {
  background-color: lime;
}

video /deep/ input[type=range] {
@sen0rxol0
sen0rxol0 / global.tpl
Last active July 11, 2019 14:21 — forked from caovillanueva/product.tpl
[SEO for PS VER.] #PS16 #SEO
<script type="application/ld+json">
{
"@context" : "http://schema.org",
"@type" : "Organization",
"name" : "{$shop_name|escape:'html':'UTF-8'}",
"url" : "{$link->getPageLink('index', true)|escape:'html':'UTF-8'}",
"logo" : {
"@type":"ImageObject",
"url":"{$logo_url|escape:'html':'UTF-8'}"
}
@sen0rxol0
sen0rxol0 / links.tpl
Created May 27, 2019 12:10 — forked from IsaiChristian/links.tpl
Link construction #Ps1.7 #Ps1.6
@sen0rxol0
sen0rxol0 / joomlaupdate
Created March 26, 2019 15:55 — forked from renekreijveld/joomlaupdate
This bash script will update your Joomla 2.5/3.1 website to the latest Joomla version. It does this by automatically downloading the correct update zipfile from Joomla.org. The script also executes the sql update commads (if needed). If specified joomlaupdate will make a backup of your website and database before updating. Joomlaupdate can also …
#!/bin/sh
# joomlaupdate
# Updates your Joomla 2.5/3.1 website to the latest version.
#
# Usage: joomlaupdate [-s] [-b] [-h] [-l]
#
# Default action is verbose on, no backup.
# -s Silent. Do not display any informational messages.
# -b Backup. Create a backup before updating.
@sen0rxol0
sen0rxol0 / cheatsheet-git.sh
Created February 13, 2019 09:05 — forked from raineorshine/cheatsheet-git.sh
Cheatsheet: git commands
# adding and committing
git add -A # stages All
git add . # stages new and modified, without deleted
git add -u # stages modified and deleted, without new
git commit --amend # Add staged changes to previous commit. Do not use if commit has been pushed.
git commit --amend --no-edit # Do so without having to edit the commit message.
# remotes - pushing, pulling, and tracking
git fetch # gets remote objects and refs. Needed if new branches were added on the remote.
git remote -v # Lists all remotes (verbose)
{* Structured Data Json - LD Microdata for Prestashop 1.6.X & 1.7
*
* Add this code in your smarty global.tpl/header.tpl file to show Organization, WebPage, Website and Product Microdata in ld+json format.
* Requires Prestashop 'productcomments' module for review stars ratings.
* by Ruben Divall @rubendivall http://www.rubendivall.com
* Module by @atomiksoft: https://addons.prestashop.com/en/seo-natural-search-engine-optimization/24511-microformats-in-ldjson.html
*}
<script type="application/ld+json">
{
"@context" : "http://schema.org",