Skip to content

Instantly share code, notes, and snippets.

View jjvillavicencio's full-sized avatar

John Villavicencio jjvillavicencio

View GitHub Profile
@jjvillavicencio
jjvillavicencio / mysql_backup_cron.sh
Created December 10, 2018 16:05 — forked from jabranr/mysql_backup_cron.sh
Automatic MySQL dump and backup to Git repo cron job
#!/bin/sh
#
# @author: Jabran Rafique <hello@jabran.me>
# @link: http://jabran.me/articles/automatic-database-backup-using-git-hosting/
# Set variables
FULLDATE = $(date +"%Y-%d-%m %H:%M")
NOW = $(date +"%Y-%m-%d-%H-%M")
MYSQL_DUMP = `which mysqldump`
GIT = `which git`
@jjvillavicencio
jjvillavicencio / setup.sh
Last active April 22, 2024 21:22
Install Android SDK on Windows Bash (WSL)
cd /home/<user>/
sudo apt-get install unzip
wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
unzip sdk-tools-linux-4333796.zip -d Android
rm sdk-tools-linux-4333796.zip
sudo apt-get install -y lib32z1 openjdk-8-jdk
export JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64
export PATH=$PATH:$JAVA_HOME/bin
printf "\n\nexport JAVA_HOME=/usr/lib/jvm/java-8-openjdk-amd64\nexport PATH=\$PATH:\$JAVA_HOME/bin" >> ~/.bashrc
cd Android/tools/bin
@jjvillavicencio
jjvillavicencio / starUml3.md
Last active January 19, 2024 07:29
StarUml 3.

Recientemente StarUML se actualizó de 2.0 a 3.0. El método de crack original, la forma de modificar la función de verificación de licencia no se puede usar. La ubicación de instalación ha cambiado y se ha encontrado el archivo LicenseManagerDomain.js. ¿Qué debería hacer? El viejo conductor les dijo a todos que resolvieran el problema.

StarUML está escrito en nodejs. Específicamente, está escrito en el marco frontal de Electron. Todo el código fuente de starUML en la nueva versión viene empaquetado por la herramienta asar.

Ingresar al directorio (Windows)

C:\Program Files\StarUML\resources

@jjvillavicencio
jjvillavicencio / formulario.component.ts
Created May 14, 2018 21:08
Crear formularios Angular 4
import { Component, OnInit } from '@angular/core';
import { FormGroup, FormControl } from '@angular/forms';
import { FileHolder } from 'angular2-image-upload';
@Component({
selector: 'app-add-conductor',
templateUrl: './add-conductor.component.html',
styleUrls: ['./add-conductor.component.css']
})
export class AddConductorComponent implements OnInit {
@jjvillavicencio
jjvillavicencio / login-background.sh
Last active May 23, 2018 02:10
Genome Login Background
WORKDIR=~/tmp/gdm-login-background
GST=/usr/share/gnome-shell/gnome-shell-theme.gresource
GSTRES=$(basename $GST)
mkdir -p $WORKDIR
cd $WORKDIR
mkdir theme
for r in `gresource list $GST`; do
gresource extract $GST $r >$WORKDIR$(echo $r | sed -e 's/^\/org\/gnome\/shell\//\//g')
@jjvillavicencio
jjvillavicencio / Firebae_plugin.rm
Last active March 26, 2018 22:58
Firebase_plugin
there is a temporary fix to this, force the services and firebase versions to 11.8.0.
how to:
put this inside the tag of config.xml with the content:
<hook src="fixFirebasePlugin.js" type="before_build" />
create the JS file on your project root:
module.exports = function(context) {
@jjvillavicencio
jjvillavicencio / open_learning.rdf
Created March 21, 2018 03:40
rdf datos open learning
<rdf:RDF
xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#"
xmlns:j.0="http://purl.org/dc/terms/"
xmlns:myData="http://mivocabulario.utpl/data/"
xmlns:dbo="http://dbpedia.org/ontology/"
xmlns:schema="http://schema.org/"
xmlns:myVocab="http://mivocabulario.utpl/ontology#"
xmlns:vivo="http://vivoweb.org/ontology/core#"
xmlns:j.1="http://xmlns.com/foaf/0.1/">
<myVocab:Estudiante rdf:about="http://mivocabulario.utpl/data/estudiante/135471">
Router(config)#license boot module C2900 technology-package securityk9
Router#copy running-config startup-config
Router#reload
=== SWITCH 1 ==
vlan database
vlan 10
vlan 20
vlan 30
@jjvillavicencio
jjvillavicencio / requeriments.txt
Created January 27, 2017 01:31
Django Projects
backports.shutil-get-terminal-size==1.0.0
decorator==4.0.11
Django==1.8
django-cors-headers==2.0.0
djangorestframework==3.5.3
enum34==1.1.6
httpie==0.9.9
ipython==5.1.0
ipython-genutils==0.1.0
pathlib2==2.2.0
#include <stdio.h>
#include <stdlib.h>
#include <mpi.h>
int main (int argc, char* argv[])
{
int rank, size, origen, destino, ndat, tag;
int n, i, j;
int suma = 0;
int cont = 0;