Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
I may be slow to respond.

devasia devasia2112

💭
I may be slow to respond.
View GitHub Profile
View generate.php
<?php
require "app/config.php";
require "templates.php";
$tablename = '';
$tabledisplay = '';
$columnname = '' ;
$columndisplay = '';
$columnvisible = '';
$index_table_rows = '';
@devasia2112
devasia2112 / rsync_bkp_prod2local
Created Mar 22, 2020
backup production files to your local computer
View rsync_bkp_prod2local
#!/bin/sh
# HowTo: before use the script be sure to run the 2 step below.
# 1 - Create your ssh key pair issuing this command `ssh-keygen -t rsa`
# 2 - Copy the pub key to your remote server issuing this command `ssh-copy-id -i ~/.ssh/id_rsa.pub user@server_ip`
#current datetime
CURDATEX=`date +%d%m%y`
DIRCHK1=~/Downloads/BACKUPS-PROD/www_${CURDATEX}/
DIRCHK2=~/Downloads/BACKUPS-PROD/www_${CURDATEX}/DB_FILES/
@devasia2112
devasia2112 / dnscrypt-proxy
Created Nov 24, 2019
steps to get your dnscrypt working with .ovpn files.
View dnscrypt-proxy
SETUP DNSCRYPT - Arch Linux
---
STEP 1
Install DNSCRYPT using your package manager or compiling from source.
STEP 2
Configure the file `/etc/dnscrypt-proxy/dnscrypt-proxy.toml`, add your own public/private DNS,
enable logs, etc..
@devasia2112
devasia2112 / nginx.conf
Created Oct 17, 2019 — 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/
View nginx.conf
# to generate your dhparam.pem file, run in the terminal
openssl dhparam -out /etc/nginx/ssl/dhparam.pem 2048
@devasia2112
devasia2112 / gist:d2110f22ec0ae0740fbffe1e7798bb18
Last active Sep 8, 2019
gerador de PDF em massa, usar com o script: `Layout/Layout-Servico-Comunicacao-Multimidia.php`
View gist:d2110f22ec0ae0740fbffe1e7798bb18
/***
* Imprimir URI usando o binario phantomjs.
* execute o comando `phantomjs` e o PDF vai ser gerado no seu disco,
* execute `pkill -9 phantomjs` para matar o processo que as vezes
* persiste e faz uso extensivo dos recursos do servidor.
* Obs.: phantomjs requer o uso de `libfontconfig`, instalacao para ubuntu
* `apt-get install libfontconfig`
*
* O script foi testado com servidor Debian (Jessie).
View query
<?php
/*
* @Title: Nfsc_21 queries.
* @Description: o script faz a consulta dos dados para alimentar os arquivos da Nfsc_21.
* @Date: 2017-05-16
* @Class: Nfsc_21
* @Observation: Use medoo PDO para abstracao dos dados. Site: medoo.in
*
*/
require 'nfsc.21.class.php';
View parse-tcpdump-udp-port-53.php
<?php
// quick and dirty argument parsing
foreach ($argv as $arg) {
if ($arg == '-f') {
define('FOLLOW', true);
}
if ($arg == '-h') {
define('HISTOGRAM', true);
}
View strong-passwords.php
<?PHP
// Generates a strong password of N length containing at least one lower case letter,
// one uppercase letter, one digit, and one special character. The remaining characters
// in the password are chosen at random from those four sets.
//
// The available characters in each set are user friendly - there are no ambiguous
// characters such as i, l, 1, o, 0, etc. This, coupled with the $add_dashes option,
// makes it much easier for users to manually type or speak their passwords.
//
// Note: the $add_dashes option will increase the length of the password by