Skip to content

Instantly share code, notes, and snippets.

Avatar
💭
Changing the world while working at @KanteronSystems

Pablo Hinojosa Pablohn26

💭
Changing the world while working at @KanteronSystems
View GitHub Profile
@Pablohn26
Pablohn26 / README.md
Created Mar 5, 2021
Migrate from Home Assistant container (docker-compose) to Home Assistant Supervised
View README.md

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 Feb 14, 2021
Fancy rsync progress
View rsync.mc
# rsync with progress percentage
> rsync -ah --no-inc-recursive --info=progress2 source destination
View quick-kafka.md
@Pablohn26
Pablohn26 / gist:063e0a36947861ea89fdf896156b6aa6
Created Jun 18, 2018 — forked from bkilshaw/gist:3624901
MACVendors.com API :: PHP GET Example
View gist:063e0a36947861ea89fdf896156b6aa6
<?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 Mar 15, 2017
Install tor on Ubuntu 14.04
View install.md

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

@Pablohn26
Pablohn26 / urserver.service
Created Jan 19, 2017
Unified Remote Server systemd unit
View urserver.service
[Unit]
Description=Unified Remote Server
After=syslog.target network.target
[Service]
Type=forking
PIDFile=$HOME/.urserver/urserver.pid
ExecStart=/opt/urserver/urserver-start --no-manager --no-notify
ExecStop=/opt/urserver/urserver-stop
View Keybase.app.log
log: Thu Oct 06 2016 10:59:38 GMT+0200 (CEST) (1475744378498): Version: 1.0.17-20161003160026+ecdaf34
log: Thu Oct 06 2016 10:59:38 GMT+0200 (CEST) (1475744378499): Error: Error: No installer path
log: Thu Oct 06 2016 10:59:38 GMT+0200 (CEST) (1475744378610): RPC [I] localhost: connection established
log: Thu Oct 06 2016 10:59:38 GMT+0200 (CEST) (1475744378715): Check bounds: { x: 7, y: 378, width: 800, height: 625 } { x: 0, y: 0, width: 1920, height: 1080 } { x: 0, y: 0, width: 1920, height: 1080 }
log: Thu Oct 06 2016 10:59:38 GMT+0200 (CEST) (1475744378769): Opened at login: false
log: Thu Oct 06 2016 10:59:38 GMT+0200 (CEST) (1475744378769): Is restore: false
log: Thu Oct 06 2016 10:59:38 GMT+0200 (CEST) (1475744378769): Open hidden: false
log: Thu Oct 06 2016 10:59:38 GMT+0200 (CEST) (1475744378769): Hide main window: true
log: Thu Oct 06 2016 10:59:38 GMT+0200 (CEST) (1475744378769): Hide dock icon: false
From Keybase: log: Thu Oct 06 2016 10:59:40 GMT+0200 (CEST) (1475744380101): Transport using /run/
View docker info api
0 pablo:4@~$ sudo curl --unix-socket /var/run/docker.sock http:/info
[sudo] password for pablo:
{"ID":"TJFZ:2LQG:IURD:HYQM:PIJQ:2HJA:KWX6:WEBU:YPRQ:6KJX:OI6R:WPLS","Containers":14,"ContainersRunning":0,"ContainersPaused":0,"ContainersStopped":14,"Images":32,"Driver":"devicemapper","DriverStatus":[["Pool Name","docker-253:0-409604-pool"],["Pool Blocksize","65.54 kB"],["Base Device Size","10.74 GB"],["Backing Filesystem","ext4"],["Data file","/dev/loop0"],["Metadata file","/dev/loop1"],["Data Space Used","8.064 GB"],["Data Space Total","107.4 GB"],["Data Space Available","3.673 GB"],["Metadata Space Used","8.294 MB"],["Metadata Space Total","2.147 GB"],["Metadata Space Available","2.139 GB"],["Udev Sync Supported","true"],["Deferred Removal Enabled","false"],["Deferred Deletion Enabled","false"],["Deferred Deleted Device Count","0"],["Data loop file","/var/lib/docker/devicemapper/devicemapper/data"],["Metadata loop file","/var/lib/docker/devicemapper/devicemapper/metadata"],["Library Version","1.02.122 (2016-
View Fedora docker debug info
0 pablo:4@~$ sudo docker -D info
Containers: 14
Running: 0
Paused: 0
Stopped: 14
Images: 32
Server Version: 1.10.3
Storage Driver: devicemapper
Pool Name: docker-253:0-409604-pool
Pool Blocksize: 65.54 kB
View Keybase_20160822195138_000_KeybasePrograms.log
=== Verbose logging started: 22/08/2016 19:51:41 Build type: SHIP UNICODE 5.00.7601.00 Calling process: C:\Users\Pablo\AppData\Local\Temp\{2868C159-2987-4AAA-B58F-9084EA96B294}\.cr\keybase_setup_386(1).exe ===
MSI (c) (6C:1C) [19:51:41:090]: Resetting cached policy values
MSI (c) (6C:1C) [19:51:41:090]: Machine policy value 'Debug' is 0
MSI (c) (6C:1C) [19:51:41:090]: ******* RunEngine:
******* Product: C:\Users\Pablo\AppData\Local\Package Cache\{803E48B3-ECDB-4B7D-9795-63FAD60A2E26}v1.0.16.79\Keybase.msi
******* Action:
******* CommandLine: **********
MSI (c) (6C:1C) [19:51:41:090]: Client-side and UI is none or basic: Running entire install on the server.
MSI (c) (6C:1C) [19:51:41:090]: Grabbed execution mutex.
MSI (c) (6C:1C) [19:51:41:110]: Cloaking enabled.