Skip to content

Instantly share code, notes, and snippets.

View diegodorado's full-sized avatar

Diego Dorado diegodorado

View GitHub Profile
@diegodorado
diegodorado / connect.sh
Last active February 22, 2024 02:42
Execute dictionary attack to Wi-Fi Network
# list wifi interfaces
iw dev
# set wlan up
ip link set wlan0 up
# scan ssids
iw wlan0 scan | grep -i ssid
# create a config file (type the ssid password)
//
// defino mis variables
let cc = Array(128).fill(0)
let notes = Array(128).fill(0)
let lastCc = 0
let lastNote = 0
let lastOctave = 0
let lastRelNote = 0
//
// declaro un handler de eventos midi
@diegodorado
diegodorado / ffmpeg_cheatsheet.sh
Last active May 18, 2021 12:52
ffmpeg, mogrify, montage and convert ( imagemagick tools)
#bulk convert with ffmpeg, cmd works, powershell doesnt
for %i in (*.*); do ffmpeg -i %i %~ni.mp4
#extract a video part
ffmpeg -i original.avi -an -ss 17 -t 5 cutted.avi
# -i, is the input file: original.avi
# -an, to not copy the audio (it was giving me troubles and i dont need it now)
# -ss, where to start: at 17 seconds
# -t, duration: 5 seconds
#for more precision
@diegodorado
diegodorado / convert-for-web.sh
Created April 28, 2021 12:01
Convert jpg images optimized for web
for f in IMG*; do convert $f -sampling-factor 4:2:0 -strip -quality 85 -interlace JPEG -colorspace RGB "s-$f";done;
CREATE USER 'newuser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON * . * TO 'newuser'@'localhost';
FLUSH PRIVILEGES;
@diegodorado
diegodorado / v4l2loopback.sh
Created April 7, 2021 14:32
Enable virtual cameras
sudo modprobe v4l2loopback video_nr=2 card_label="OBS Virtual Camera"
@diegodorado
diegodorado / stream_android_screen.md
Created April 7, 2021 14:31
How to get wirelessly your android screen on your desktop

Connect your device through usb and enable adb over TCP/IP: adb tcpip 5555

  1. Connect the device to the same Wi-Fi as your computer
  2. Get your device IP address (in Settings → About phone → Status)
  3. Connect to your device: adb connect DEVICE_IP:5555
  4. Run scrcpy

To switch back to USB mode: adb usb.

@diegodorado
diegodorado / WP_Dockerfile
Last active March 27, 2021 19:59
Wordpress Dockerfile for small sites
ARG WORDPRESS_DB_HOST
ARG WORDPRESS_DB_NAME
ARG WORDPRESS_TABLE_PREFIX
ARG WORDPRESS_DB_USER
ARG WORDPRESS_DB_PASSWORD
FROM wordpress:5.7
# Don't run mpm for small sites
RUN sed -i 's/Servers.*/Servers 1/' /etc/apache2/mods-available/mpm_prefork.conf
#ifdef _WIN32
// taken from https://stackoverflow.com/questions/28027937/cross-platform-sockets
/* See http://stackoverflow.com/questions/12765743/getaddrinfo-on-win32 */
#ifndef _WIN32_WINNT
#define _WIN32_WINNT 0x0501 /* Windows XP. */
#endif
#include <winsock2.h>
#include <ws2tcpip.h>
#pragma comment(lib,"ws2_32.lib") //Winsock Library
#else
Node:
position: (x,y,z)
G_cost = INFINITY // costo local
H_cost = INFINITY // distancia heuristica
F_cost = () => G_cost + H_cost
neighbors = [] // vecinos
is_walkable = true
is_closed = false