Skip to content

Instantly share code, notes, and snippets.

server {
root *;
index index.php index.html index.htm;
server_name *;
charset utf-8;
location / {
try_files $uri $uri/ /index.php?$query_string;
}
client_max_body_size 100M;
location ~ \.php$ {
@abrahamfast
abrahamfast / zgrep_ssh_authfails.sh
Created February 12, 2019 20:32
zgrep ssh auth fails
zgrep sshd /var/log/auth.log* | grep rhost | sed -re 's/.*rhost=([^ ]+).*/\1/' | sort -u
@abrahamfast
abrahamfast / android_instructions.md
Created January 6, 2019 00:16 — forked from patrickhammond/android_instructions.md
Easily setup an 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:

ruby -e "$(curl -fsSL https://raw.github.com/Homebrew/homebrew/go/install)"

@abrahamfast
abrahamfast / nginx.conf
Created December 2, 2018 00:49 — forked from plentz/nginx.conf
Best nginx configuration for improved security(and performance). Complete blog post here http://tautt.com/best-nginx-configuration-for-security/
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@abrahamfast
abrahamfast / my.cnf
Created September 23, 2018 17:22 — forked from peerax/my.cnf
mySQL config file for ram 8GB
# my.cnf for TAKIS Server
# BEGIN CONFIG INFO
# DESCR: 8 GB RAM, InnoDB only, ACID, few connections, heavy queries
# TYPE: SYSTEM
# END CONFIG INFO
[client]
port = 7000
socket = /var/lib/mysql/mysql.sock
@abrahamfast
abrahamfast / config_origam
Last active August 21, 2018 11:14
split tab and window in sublime
[
{ "keys": [":", "s", "p"], "command": "travel_to_pane", "args": {"direction": "up"} },
{ "keys": [":", "v", "s", "p"], "command": "travel_to_pane", "args": {"direction": "right"} },
{ "keys": [":", "b", "d"], "command": "destroy_pane", "args": {"direction": "self"} },
{ "keys": [":", "p", "z"], "command": "zoom_pane", "args": {"fraction": 1} },
{ "keys": [":", "p", "z", "d"], "command": "unzoom_pane", "args": {} },
{ "keys": [":", "p", "u"], "command": "travel_to_pane", "args": {"direction": "up"} },
{ "keys": [":", "p", "r"], "command": "travel_to_pane", "args": {"direction": "right"} },
{ "keys": [":", "p", "d"], "command": "travel_to_pane", "args": {"direction": "down"} },
{ "keys": [":", "p", "l"], "command": "travel_to_pane", "args": {"direction": "left"} }
@abrahamfast
abrahamfast / install_pagespeed_nginx.sh
Created July 6, 2018 14:04 — forked from jniltinho/install_pagespeed_nginx.sh
How to Install Nginx and Google PageSpeed on Debian/Ubuntu
#!/bin/bash
## Install PageSpeed on Debian 8/9 and Ubuntu 16.04 64Bits
## https://www.howtoforge.com/tutorial/how-to-install-nginx-and-google-pagespeed-on-ubuntu-16-04/
## http://nginx.org/en/linux_packages.html
## https://www.modpagespeed.com/doc/build_ngx_pagespeed_from_source
## https://developers.google.com/speed/pagespeed/module/
## Debian ISO: https://cdimage.debian.org/cdimage/archive/8.9.0/amd64/iso-cd/
## No Link abaixo tem o pacote do Nginx para o Debian 8 64Bits
## https://github.com/jniltinho/ispconfig/tree/master/packages/debian/jessie
## Run as root (sudo su)
@abrahamfast
abrahamfast / nginx.conf
Created February 28, 2018 06:30 — forked from mreschke/nginx.conf
Nginx config for multiple laravel sites based on /api/v1 url paths
# This config will host your main [Laravel] GUI application at /, and any additional [Lumen] webservices at /api/v1 and /api/v2...
# This also works perfectly for all static file content in all projects
# This is full of debug comments so you can see how to print debug output to browser! Took me hours to nail this perfect config.
# Example:
# http://example.com - Main Laravel site as usual
# http://example.com/about - Main Laravel site about page as usual
# http://example.com/robots.txt - Main Laravel site static content as usual
# http://example.com/api/v1 - Lumen v1 api default / route
# http://example.com/api/v1/ - Lumen v1 api default / route
<?php
define('BOT_TOKEN', 'XXXXXXXX:XXXXXXXXXXXXXXXXXXXXXXXX'); // place bot token of your bot here
function checkTelegramAuthorization($auth_data) {
$check_hash = $auth_data['hash'];
unset($auth_data['hash']);
$data_check_arr = [];
foreach ($auth_data as $key => $value) {
$data_check_arr[] = $key . '=' . $value;