Skip to content

Instantly share code, notes, and snippets.

@wilxsv
wilxsv / Install-conky-xfce
Created April 26, 2019 03:23 — forked from NrI3/Install-conky-xfce
Conky theme debian xfce
# install conky
apt-get install conky-all
# Configure theme
# Save file as: .conkyrc
use_xft yes
xftfont 123:size=8
xftalpha 0.1
ssl_protocols TLSv1 TLSv1.1 TLSv1.2;
ssl_ciphers "-ALL:EECDH+AES256:EDH+AES256:AES256-SHA:EECDH+AES:EDH+AES:!ADH:!NULL:!aNULL:!eNULL:!EXPORT:!LOW:!MD5:!3DES:!PSK:!SRP:!DSS:!AESGCM:!RC4";
ssl_dhparam /etc/ssl/certs/dhparam.pem;
ssl_prefer_server_ciphers on;
keepalive_timeout 70;
ssl_stapling on;
ssl_stapling_verify on;
add_header X-Content-Type-Options nosniff;
add_header X-Frame-Options "SAMEORIGIN";
@wilxsv
wilxsv / damemibase
Last active September 5, 2018 18:06
script para creacion de bases de datos para las alumnas y alumnos de comercio electronico
#! /bin/bash
#Script recibe dos parametros, 1 el carnet del estudiante, 2 el password
UUID=$(cat /proc/sys/kernel/random/uuid)
#Creo el usuario
BASE0=$(mysql -u root -ppasswd -D mysql -e "CREATE USER $1@localhost IDENTIFIED BY '$2'; " 2> /tmp/$UUID.txt)
#Le doy permisos de consulta
BASE1=$(mysql -u root -D mysql -ppasswd -e "GRANT USAGE ON *.* TO $1@localhost IDENTIFIED BY '$2' WITH MAX_QUERIES_PER_HOUR 0 MAX_CONNECTIONS_PER_HOUR 0 MAX_UPDATES_PER_HOUR 0 MAX_USER_CONNECTIONS 0;" 2>> /tmp/$UUID.txt)
#Creo la base
BASE2=$(mysql -u root -D mysql -ppasswd -e "CREATE DATABASE IF NOT EXISTS $1;" 2>> /tmp/$UUID.txt)
@wilxsv
wilxsv / nginx-prestashop.conf
Created September 5, 2018 16:20
Snippet de servidor virtual para prestashop
server {
listen 80 ;
root /var/www/cet/;
index index.php index.html index.htm;
server_name cet115.wvides.info;
##
# Gzip Settings
##
@wilxsv
wilxsv / wp-nginx.conf
Created August 23, 2018 17:39
wp-nginx.conf
server {
listen 80 ;
listen [::]:80 ;
root /home/wilx/Documentos/seguimiento-desaparecidos/sources/nightly;
location = /favicon.ico {
log_not_found off;
access_log off;
}
location = /robots.txt {
allow all;
@wilxsv
wilxsv / -create_users_cet.sh
Last active August 22, 2018 15:25
Creacion de usuarios para materia de CET115
#!/bin/bash
while read line
do
echo -e "Creando usuarios son password y eliminando la interaccion"
adduser --disabled-password --gecos "" $line
echo -e "Definiendo el password de cada usuario para ejecutar comandos via BASH sin problemas"
echo -e "$PASS\n$PASS" | passwd $line
echo -e "Agregando la estructura de directorio y archivo para agregar a cada usuario su llave"
su -c "mkdir /home/$line/.ssh/ && touch /home/$line/.ssh/authorized_keys" $line
echo -e "Creando una llave ssh para cada usuario por si tiene problemas"
@wilxsv
wilxsv / change.sql
Created June 19, 2018 15:44
Reemplazar acentos y caracteres especiales en mysql
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Á','A');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'É','E');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Í','I');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ó','O');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ú','U');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'Ñ','N');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ã','a');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'ä','a');
UPDATE TABLA SET CAMPO = REPLACE(CAMPO,'å','a');
@wilxsv
wilxsv / crea_json.php
Last active March 31, 2018 20:18
bajar peso a geojson
<?php
$servername = "";
$username = "";
$password = "";
$dbname = "";
// Crea conexion
$conn = new mysqli($servername, $username, $password, $dbname);
if ($conn->connect_error) {
die("Connection failed: " . $conn->connect_error);
from locust import HttpLocust, TaskSet
def login(l):
l.client.post("/login", {"username":"ellen_key", "password":"education"})
def logout(l):
l.client.post("/logout", {"username":"ellen_key", "password":"education"})
def index(l):
l.client.get("/")
@wilxsv
wilxsv / _install_timeoverflow.sh
Last active March 13, 2018 05:31
Install and config timeoverflow
# 1. Introduction
# TimeOveflow is specially designed for and by Time Banks that physically exist
# 2. Overview
# This tutorial assumes that you are using a Debian Jessie as operating system, in this installation we are using digital ocean VPS
# 3. Prerequisites
# As root install all packages
# Add jessie-backports
echo "deb http://ftp.debian.org/debian jessie-backports main contrib non-free" | sudo tee -a /etc/apt/sources.list.d/jessie-backports.list
echo "deb https://oss-binaries.phusionpassenger.com/apt/passenger jessie main" | sudo tee -a /etc/apt/sources.list.d/passenger.list