Skip to content

Instantly share code, notes, and snippets.

View ratacibernetica's full-sized avatar

Martín Roldán-Araujo ratacibernetica

View GitHub Profile
@ratacibernetica
ratacibernetica / gist:5655a87e9efd137cf832d51778d3911f
Created August 13, 2021 16:27
send message to Teams via incoming webhook in bash
#!/bin/bash
# source https://docs.microsoft.com/en-us/microsoftteams/platform/webhooks-and-connectors/how-to/connectors-using#post-a-message-to-the-webhook-using-curl
URL="https://yourllc.webhook.office.com/webhookb2/uuid@tenant/IncomingWebhook/uuid"
MSG="$@"
# on macOS or Linux
curl -H 'Content-Type: application/json' -d "{\"text\": \"$MSG\"}" $URL
@ratacibernetica
ratacibernetica / tor2ip.sh
Created July 1, 2021 23:12
socat tor to web
socat TCP4-LISTEN:9236,bind=0.0.0.0,fork SOCKS4A:localhost:your-onion.onion:80,socksport=9050
#then visit server:9236
@ratacibernetica
ratacibernetica / cambiar-ubicacion-docker.md
Created May 2, 2021 04:54
cambiar ubicacion de imagenes docker linux y raspberry pi
  1. Stop the docker daemon
sudo service docker stop
  1. Add a configuration file to tell the docker daemon what is the location of the data directory

Using your preferred text editor add a file named daemon.json under the directory /etc/docker. The file should have this content:

@ratacibernetica
ratacibernetica / mount-cifs.md
Created March 8, 2021 04:13
Mount network drive raspberry pi/ samba
sudo mount -t cifs -o username=myuser,password=mypasswd,rw,_netdev,vers=1.0 //host-ip-or-domain-name/share /mnt/share
@ratacibernetica
ratacibernetica / temps.sh
Created March 7, 2021 03:25
get the temperature of the CPU/GPU on raspberry pi
#!/bin/bash
# Script: my-pi-temp.sh
# Purpose: Display the ARM CPU and GPU temperature of Raspberry Pi 2/3
# Author: Vivek Gite <www.cyberciti.biz> under GPL v2.x+
# -------------------------------------------------------
cpu=$(</sys/class/thermal/thermal_zone0/temp)
echo "$(date) @ $(hostname)"
echo "-------------------------------------------"
echo "GPU => $(/opt/vc/bin/vcgencmd measure_temp)"
echo "CPU => $((cpu/1000))'C"
@ratacibernetica
ratacibernetica / espeak_mbrola.md
Last active February 11, 2021 05:54
Raspberry pi espeak mbrola español voice TTS
mkdir $HOME/espeak
cd ~/espeak
wget https://raspberry-pi.fr/download/espeak/mbrola3.0.1h_armhf.deb -O mbrola.deb
sudo dpkg -i mbrola.deb
sudo apt install mbrola-mx1 -y
espeak -a 200 -v mb-mx1 -s 150 "Pepe pecas pica papas" --stdout | aplay
@ratacibernetica
ratacibernetica / mail.sh
Created February 7, 2021 03:59
enviar email desde bash
mail -s "test emai hashmail" ninjutsu756@mroldan.mx <<< 'This is a message'
@ratacibernetica
ratacibernetica / ffmpeg-2-whatsapp
Created January 20, 2021 20:23
ffmpeg mp4 to WhatsApp
```
ffmpeg -i broken.mp4 -c:v libx264 -profile:v baseline -level 3.0 -pix_fmt yuv420p working.mp4
```
@ratacibernetica
ratacibernetica / gist:19c9ca88d77ad81d10012fe1830a341d
Last active January 10, 2021 03:42
raspberry pi boot from USB
  1. Boot from a standard microSD card with the latest Raspberry Pi OS on it.

  2. Update your OS and firmware by typing:

sudo apt update
sudo apt full-upgrade
sudo rpi-update
@ratacibernetica
ratacibernetica / sample.html
Created August 30, 2020 05:18
basic microdata
<!DOCTYPE html>
<html lang="es">
<head>
<title>Mazda Ekiden</title>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<meta name="description" content="A Meaningful and short description">
<meta property="og:title" content="Title" />
<meta property="og:url" content="https://www.page.mx" />
<meta property="og:description" content="Evento deportivo">