Skip to content

Instantly share code, notes, and snippets.

View paulocoghi's full-sized avatar
🎯
Focusing

Paulo Coghi paulocoghi

🎯
Focusing
View GitHub Profile
@bradwright
bradwright / websockets-server.js
Created June 11, 2011 23:29
Pure Node.js WebSockets server
/*
* node-ws - pure Javascript WebSockets server
* Copyright Bradley Wright <brad@intranation.com>
*/
// Use strict compilation rules - we're not animals
'use strict';
var net = require('net'),
crypto = require('crypto');
@jbinto
jbinto / howto-recover-google-authenticator-keys.txt
Created February 8, 2014 04:20
Recovering Google Authenticator keys from Android device for backup
### Last tested February 7 2014 on a Galaxy S3 (d2att) running Cyanogenmod 11 nightly, with Google Authenticator 2.49.
### Device with Google Authenticator must have root.
### Computer requires Android Developer Tools and SQLite 3.
### Connect your device in USB debugging mode.
$ cd /tmp
$ adb root
$ adb pull /data/data/com.google.android.apps.authenticator2/databases/databases
@magnetikonline
magnetikonline / README.md
Last active April 30, 2024 00:45
Setting Nginx FastCGI response buffer sizes.
@Richzendy
Richzendy / check-availability.php
Last active May 6, 2019 09:08
Script to check SoYouStart availability
<?php
/*
* Script to check SoYouStart availability based on http://www.tienle.com/2014/09-03/script-check-soyoustart-availability.html
* to help see http://www.richzendy.org/2014/10/05/script-php-para-chequear-y-notificar-disponibilidad-de-servidores-en-soyoustart.html
*/
define('CHECK_URL', 'http://ws.ovh.com/dedicated/r2/ws.dispatcher/getAvailability2');
define('NOTIFICATION_EMAILS', 'YOUR_EMAIL@DOMAIN.COM');
define('SYSTEM_EMAIL', '1'); // 1 = enabled local smtp system
define('MANDRILL', '0'); // 1 = enable email trought mandrill api, require an account on https://mandrillapp.com/
@BrianGilbert
BrianGilbert / nginx_ojs_include.conf
Last active January 8, 2021 07:04
nginx configuration for OJS on an aegir box
#######################################################
### nginx compact ojs configuration start
#######################################################
location ~ /\.ht {
deny all;
}
location ~ ^/cache(.*)$ {
deny all;
@tomazzaman
tomazzaman / hhvm.conf
Last active September 22, 2016 08:23
Restart HHVM with Monit
# This file should be in /etc/monit/conf.d
check process hhvm with pidfile /var/run/hhvm/pid
group hhvm
# Start program calls our custom script from above
start program = "/usr/local/sbin/start_hhvm.sh"
stop program = "/usr/sbin/service hhvm stop"
if failed unixsocket /var/run/hhvm/hhvm.sock then restart
if mem > 400.0 MB for 1 cycles then restart
if 5 restarts with 5 cycles then timeout
@pelmered
pelmered / wpfcwc.conf
Created March 27, 2015 08:56
EasyEngine WooCommerce config with FastCGI Cache
#
set $skip_cache 0;
# POST requests and URL with a query string should always go to php
if ($request_method = POST) {
set $skip_cache 1;
}
if ($query_string != "") {
@that0n3guy
that0n3guy / gist:905c812c0f65e7ffb5ec
Last active December 20, 2023 11:13
Mautic nginx config
server {
# see: http://wiki.nginx.org/Pitfalls
# see: http://wiki.nginx.org/IfIsEvil
listen 80;
root /app;
index index.html index.htm index.php;
error_page 404 /index.php;
# Make site accessible from http://set-ip-address.xip.io
@maop
maop / soyoustart.py
Created December 10, 2015 02:11
Python Script for watching SoYouStart.com server availability, it can watch many servers at many datacenters and notify by email
#!/usr/bin/env python
# I was in a hurry for a SYS server so i make this quick script,
# notice that you have to use codes from the "us" version, since server's id
# are different in the Europe versions of ovh sites
# You'll receive notification mails like this:
#
# 141cabk1 | BK-8T: Intel i3 2130 2c/4t 3.4 GHz+ 8 GB 2x4 TB SATA
# AVAILABLE (1H-low) in gra
# AVAILABLE (1H-low) in sbg
@mitchellkrogza
mitchellkrogza / fail2ban-reset-log-db.sh
Last active June 25, 2022 13:36
Bash script to reset Fail2Ban - clears / truncates log file and deletes the sqlite database - stops and restarts service during this process.
#!/bin/bash
# Bash Script by https://gist.github.com/mitchellkrogza
# ************************************************************
# This script clears the log file and database of Fail2Ban
# This resets Fail2Ban to a completely clean state
# Useful to use after you have finished testing all your jails
# and completed your initial setup of Fail2Ban and are now
# putting the server into LIVE mode
# ************************************************************