Skip to content

Instantly share code, notes, and snippets.

Avatar
😎
Focus on FOSS Projects!

Ulises Gascón UlisesGascon

😎
Focus on FOSS Projects!
View GitHub Profile
@UlisesGascon
UlisesGascon / database_magic.md
Created Aug 20, 2020
Dump, compare and check db integrity
View database_magic.md

Database Backup and comparation

Dump Postgres DB

pg_dump --data-only --inserts -h <DB_URL> -U <DB_USER> -f <FILE_NAME_TO_CREATE.sql> <DB_NAME>

Notes:

  • --data-only will dump only data to be inserted (not tables strcuture and relations)
  • --inserts will force to use INSERT statements and not COPY to avoid driver issues later on
@UlisesGascon
UlisesGascon / hack.sh
Last active Mar 6, 2020
David hasselhoff wallpaper 2020
View hack.sh
#!/bin/sh
npm install --global wallpaper-cli
wallpaper https://octodex.github.com/images/privateinvestocat.jpg --scale=fit
npm uninstall --global wallpaper-cli
@UlisesGascon
UlisesGascon / important.md
Last active Feb 12, 2020
Nodejs February Security Release
View important.md
@UlisesGascon
UlisesGascon / deps.sh
Created Feb 5, 2020
just a simple script to simulate node v0.10 in Express for CI in local
View deps.sh
#!/usr/bin/env bash
nvm use v0.10
#find . -name "node_modules" -type d -prune -exec rm -rf '{}' +
npm install
npm config set shrinkwrap false
npm rm --silent --save-dev connect-redis
npm install --silent --save-dev mocha@3.5.3
npm install --silent --save-dev supertest@2.0.0
npm prune
View ocr.js
// npm install tesseract.js
const Tesseract = require('tesseract.js');
Tesseract.recognize(
'./img/2.png',
'spa',
{ logger: m => console.log(m) }
).then(({ data: { text } }) => {
console.log(text);
@UlisesGascon
UlisesGascon / README.md
Last active Jan 6, 2020
Madrid Traffic Cameras
View README.md

Madrid Traffic Cameras

Process

  • Get data from Open Data Madrid. Link
  • Download the kml file and upload it to mygeodata for conversion to geojson
  • Save the GeoJSON file as cameras.geojson.
  • Run the transformation script transformation.js
  • Check the output file: cameras.json
@UlisesGascon
UlisesGascon / build.md
Created Nov 5, 2019
Compile nodejs in MacOS
View build.md

Compile nodejs in MacOS

Code manage

  • Download: git clone https://github.com/nodejs/node.git
  • Update: git pull upstream master

Build Nodejs

  • Configure: ./configure
  • Compile: make -j4
@UlisesGascon
UlisesGascon / README.md
Created Aug 13, 2019
Identificar trafico de tor
View README.md

Identificar trafico de tor

Pasos

  1. Instalar got y lowdb
  2. Generar toda la información necesaria desde onionoo y guardalo como tor-data.js
  3. Utiliza la función isTor(req) para filtrar el trafico en tu servidor server.js.
  4. Instalar dependencias npm install got lowdb
  5. Arrancar el servidor node server

Recursos

@UlisesGascon
UlisesGascon / README.md
Last active Aug 13, 2019
Montar un generador de capturas de pantalla en Tor
View README.md

Montar un generador de capturas de pantalla en Tor

Importante

Necesitamos tener previamente corriendo Tor en la maquina:

Pasos

  1. Actualziamos la configuración de tor nano /etc/tor/torrc
SocksPort 9050
@UlisesGascon
UlisesGascon / README.md
Last active Aug 13, 2019
Montar un hidden service en Tor
View README.md
You can’t perform that action at this time.