Skip to content

Instantly share code, notes, and snippets.

View AlexR1712's full-sized avatar
🏠
Working from home

Alexander J. Rodriguez D. AlexR1712

🏠
Working from home
View GitHub Profile
@dkmonaghan
dkmonaghan / sentry_mattermost_webhook.php
Created October 28, 2020 17:49
This script can act as a middleman between Sentry's webhook system and Mattermost's Incoming Webhooks
<?php
$json = json_decode(file_get_contents('php://input'), true);
if ($json['action'] !== 'created'){ die('Only create actions are alerted'); }
$error = $json['data']['issue'];
if ($error['project']['id'] == 1){ die('Ignore internal errors.'); }
if (empty($error['shortId'])){ die('No shortId passed'); }
// Set channel and username
@nathanctech
nathanctech / proxy-nginx-fxserver.md
Created May 1, 2020 14:23
FXServer Reverse Proxy

Proxying FiveM Connections using Nginx

As of server version 2377, support was added to FiveM to run a custom streaming proxy similar to cfx.re, but proxying the data connection (UDP) as well. This can be accomplished very easily with nginx acting as a proxy, and you can combine the caching proxy with it.

Requirements

  • Nginx 1.17+ (1.16 absolute minimum, guide tested on 1.17)
  • Server with reasonable network bandwidth (500mbps uplink strongly suggested)
  • FXserver version 2377 or later
  • SSL certificate for the domain you're using (highly recommended)
@pedrocarrico
pedrocarrico / install.sh
Created October 30, 2019 16:12
Install nano on heroku dyno
mkdir /app/nano
curl https://github.com/Ehryk/heroku-nano/raw/master/heroku-nano-2.5.1/nano.tar.gz --location --silent | tar xz -C /app/nano
export PATH=$PATH:/app/nano
echo off
start c:\Macros\LuaMacros.exe -r c:\Macros\TheNameYouSaved.lua
@nuga99
nuga99 / docker-install-parrot.sh
Last active April 17, 2024 09:15
Install Docker Engine on Parrot OS (2023)
#!/bin/sh
# From https://www.hiroom2.com/2017/09/24/parrotsec-3-8-docker-engine-en/
# Changelog:
# @DavoedM: Apr 3, 2020
# @C922A10971734: Jan 19, 2023
set -e
# Install dependencies.
@Gnzlt
Gnzlt / gourcevideo.sh
Created March 6, 2019 13:25
Gource video export command
#!/bin/bash
gource \
-s .03 \
-1280x720 \
--auto-skip-seconds .1 \
--multi-sampling \
--stop-at-end \
--key \
--highlight-users \
@mhrubel
mhrubel / mark_zero_invoices_paid.php
Created February 8, 2019 15:00 — forked from Pierowheelz/mark_zero_invoices_paid.php
A hook for WHMCS which marks invoices which have received payment as paid, where the WHMCS system doesn't automatically mark them paid. I found that if manually associating a transaction with an invoice number in WHMCS, the invoice is not marked as paid even when there is zero total remaining. This fixes that.
<?php
if (!defined("WHMCS"))
die("This file cannot be accessed directly");
use WHMCS\Database\Capsule;
function wb_mark_zero_invoices_paid(){
//get all unpaid invoices
$unpaid_invoices = Capsule::table('tblinvoices')->where('status', 'Unpaid')->get();
foreach( $unpaid_invoices as $inv ){
@thomasdarimont
thomasdarimont / docker-compose.yml
Created January 25, 2019 17:52
Docker OpenLDAP + phpldapadmin example
version: '2'
services:
openldap:
image: osixia/openldap:1.2.3
container_name: openldap
environment:
LDAP_LOG_LEVEL: "256"
LDAP_ORGANISATION: "Example Inc."
LDAP_DOMAIN: "example.org"
LDAP_BASE_DN: ""
@MrJmpl3
MrJmpl3 / ApiTrait.php
Last active July 18, 2019 13:35
ApiTrait - Trait helpers to Laravel API Resources
<?php
/**
* Copyright (c) 2018.
* Archivo desarrollado por Jose Manuel Casani Guerra bajo el pseudonimo de MrJmpl3
*
* Email: jmpl3.soporte@gmail.com
* Twitter: @MrJmpl3
* Pagina Web: https://mrjmpl3-official.es
*/
@xen
xen / check_hash.py
Last active August 22, 2023 07:48
telegram site auth
# implementation of Telegram site authorization checking algorithm
# for more information https://core.telegram.org/widgets/login#checking-authorization
import collections
import hmac
import hashlib
def check_string(d, token):
secret = hashlib.sha256()
secret.update(token.encode('utf-8'))