Skip to content

Instantly share code, notes, and snippets.

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

Roger Cruz RogerBCA

🏠
Working from home
View GitHub Profile
@RogerBCA
RogerBCA / README.md
Created December 11, 2017 08:36 — forked from mayorova/README.md
Mutual SSL in NGINX

Securing traffic to upstream servers with client certificates

Info: https://www.nginx.com/resources/admin-guide/nginx-https-upstreams/

Creating and Signing Your Certs

Source: http://nategood.com/client-side-certificate-authentication-in-ngi

This is SSL, so you'll need an cert-key pair for you/the server, the api users/the client and a CA pair. You will be the CA in this case (usually a role played by VeriSign, thawte, GoDaddy, etc.), signing your client's certs. There are plenty of tutorials out there on creating and signing certificates, so I'll leave the details on this to someone else and just quickly show a sample here to give a complete tutorial. NOTE: This is just a quick sample of creating certs and not intended for production.

@RogerBCA
RogerBCA / general.stylus
Created May 29, 2017 20:55
Content default CKEditor
.content-text
strong
font-weight bold
ul
list-style-type disc
list-style-position inside
ol
list-style-type decimal
list-style-position inside
ul > ul, ol > ul
@RogerBCA
RogerBCA / bash
Created May 29, 2016 05:22
Historico al crear app de android
2088 ionic start corezero blank
2089 ionic run android
2090 ionic serve
2091 cd corezero
2092 ionic serve
2093 ionic run android
2094 ionic run ios
2095 ionic run android
2096 npm install -g cordova-android
2097 ionic run android
@RogerBCA
RogerBCA / AdminComtroller.php
Last active August 29, 2015 14:21
easyadminbundle modificación home
<?php
namespace WebBundle\Controller;
use Symfony\Component\HttpFoundation\Request;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
use JavierEguiluz\Bundle\EasyAdminBundle\Controller\AdminController as EasyAdminController;
class AdminController extends EasyAdminController
{
<?php
$busca="";
$cod="";
$busca=$_POST['busca'];
if($busca!=""){
$DBServer = 'localhost'; // e.g 'localhost' or '127.0.0.1'
$DBUser = 'root';
$DBPass = '';
<?
if ($palabra == '' && $palabra2== ''){
echo 'Seleeciones Opciones...';
}else{
if(isset($palabra) and isset($palabra2)){
$query = "SELECT DATE_FORMAT(fecha, '%d-%m-%Y') as fecha,descripcion,archivo,id_expediente,ano,id_tipo_expediente,numero FROM expediente WHERE id_tipo_expediente = '$palabra' AND ano = '$palabra2' LIMIT $RegistrosAEmpezar, $RegistrosAMostrar";
}else {
if (isset($palabra) and isset($palabra2) and isset($palabra3)) {
$query = " SELECT DATE_FORMAT(fecha, '%d-%m-%Y') as fecha,descripcion,archivo,id_expediente,ano,id_tipo_expediente,numero FROM expediente WHERE id_tipo_expediente = '$palabra' AND ano = '$palabra2' and numero = '$palabra3'";
}
@csrf_exempt
def departamentojson(request, lang='es', error=None):
log.info('VIEW: DEPA JSON')
translation.activate(lang)
request.session['django_language'] = lang
if request.method == 'POST':
import json
from django.core import serializers
<?php
require_once('../conexion.php');
if (isset($_POST['id']))
{
$IdProveed = $_POST['id'];
$ruta="../imagenes";
$archivo=$_FILES['imagen']['tmp_name'];
$nombreArchivo=$_FILES['imagen']['name'];
move_uploaded_file($archivo,$ruta."/".$nombreArchivo);