Skip to content

Instantly share code, notes, and snippets.

View devasia2112's full-sized avatar

devasia devasia2112

  • Asia
View GitHub Profile
<?php
require "app/config.php";
require "templates.php";
$tablename = '';
$tabledisplay = '';
$columnname = '' ;
$columndisplay = '';
$columnvisible = '';
$index_table_rows = '';
@devasia2112
devasia2112 / rsync_bkp_prod2local
Created March 22, 2020 11:00
backup production files to your local computer
#!/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 November 24, 2019 06:34
steps to get your dnscrypt working with .ovpn files.
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 October 17, 2019 16:45 — 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
@devasia2112
devasia2112 / gist:d2110f22ec0ae0740fbffe1e7798bb18
Last active September 8, 2019 08:41
gerador de PDF em massa, usar com o script: `Layout/Layout-Servico-Comunicacao-Multimidia.php`
/***
* 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).
<?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';
<?php
// quick and dirty argument parsing
foreach ($argv as $arg) {
if ($arg == '-f') {
define('FOLLOW', true);
}
if ($arg == '-h') {
define('HISTOGRAM', true);
}
<?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