Skip to content

Instantly share code, notes, and snippets.

View Pablohn26's full-sized avatar
🏠
Changing the world while working at (your company)

Pablo Hinojosa Pablohn26

🏠
Changing the world while working at (your company)
View GitHub Profile
@Pablohn26
Pablohn26 / README.md
Created August 26, 2022 17:11
How to get ssh public key for a given Gitlab or Github user
version: "3"
services:
pacs:
image: jodogne/dcm4chee
ports:
- 8080:8080
- 11112:11112
ohif_viewer:
image: ohif/viewer
@Pablohn26
Pablohn26 / README.md
Created February 27, 2022 03:00
Optimize wordpress images on Linux

Optimize wordpress images on Linux

Install packages (debian):

sudo apt-get install -y jpegoptim optipng

Then get wordpress wp-content path, for example /var/www/website-example.com/wp-content/ and run the following commands:

find /var/www/website-example.com/wp-content/ -name "*.png" -exec optipng '{}' \;
FROM maven:3.3.3
WORKDIR /
COPY ./tlsh/src src
COPY ./pom.xml ./
RUN mkdir -p /src/com/idealista/tlsh/
RUN mvn -f pom.xml clean package install
WORKDIR /target
COPY ./SimpleTest.java ./
RUN javac -cp tlsh-1.0.0.jar SimpleTest.java
RUN jar cvf SimpleTest.jar SimpleTest.class
@Pablohn26
Pablohn26 / docker-compose.yml
Created November 22, 2021 22:50
Graphite + grafana + ElasticSearch
version: '3'
services:
graphite:
# Not working due to a configuration error :(
image: graphiteapp/graphite-statsd:latest
container_name: graphite
hostname: graphite
volumes:
@Pablohn26
Pablohn26 / README.md
Created March 5, 2021 14:16
Migrate from Home Assistant container (docker-compose) to Home Assistant Supervised

We want to migrate from Home Assistant Container (docker-compose.yml) to Home Assistant Supervised.

The main idea is to copy the /config file from docker container to main Home Assistant Supervised config folder (/usr/share/hassio/homeassistant by default)

To do so, first we need the path to the source /config folder, in my case /root/compose/ha/config

Then we need to know the path to the destination /config folder, /usr/share/hassio/homeassistant using Home Assistant Supervised default installation

The steps are:

  1. Install Home Assistant Supervised
@Pablohn26
Pablohn26 / rsync.mc
Created February 14, 2021 01:50
Fancy rsync progress
# rsync with progress percentage
> rsync -ah --no-inc-recursive --info=progress2 source destination
@Pablohn26
Pablohn26 / quick-kafka.md
Created February 14, 2021 01:35
Quick Kafka
@Pablohn26
Pablohn26 / gist:063e0a36947861ea89fdf896156b6aa6
Created June 18, 2018 16:51 — forked from bkilshaw/gist:3624901
MACVendors.com API :: PHP GET Example
<?php
$mac_address = "FC:FB:FB:01:FA:21";
$url = "https://api.macvendors.com/" . urlencode($mac_address);
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, $url);
curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
$response = curl_exec($ch);
if($response) {
echo "Vendor: $response";
@Pablohn26
Pablohn26 / install.md
Created March 15, 2017 16:11
Install tor on Ubuntu 14.04

Import public gpg key

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys 74A941BA219EC810

edit /etc/apt/sources.list and add:

deb http://deb.torproject.org/torproject.org trusty main

Install tor