Skip to content

Instantly share code, notes, and snippets.

View pedropombeiro's full-sized avatar
🏠
Working from home

Pedro Pombeiro pedropombeiro

🏠
Working from home
View GitHub Profile
<?xml version="1.0" encoding="utf-8" standalone="no"?>
<opml version="1.0">
<head>
<title>Pocket Casts Feeds</title>
</head>
<body>
<outline text="feeds">
<outline text="REWORK" type="rss" xmlUrl="https://feeds.buzzsprout.com/2260539.rss" />
<outline type="rss" text="Fail Better with David Duchovny" xmlUrl="https://www.omnycontent.com/d/playlist/796469f9-ea34-46a2-8776-ad0f015d6beb/89cff1ac-62ad-4005-b66f-b1540162fcb4/f26c966a-c6b5-49d4-91cd-b154016527e5/podcast.rss" />
<outline text="No Stupid Questions" xmlUrl="https://feeds.simplecast.com/dfh_verV" type="rss" />
@pedropombeiro
pedropombeiro / purifier.py
Created July 27, 2021 08:38
Control the Levoit Air Purifier with Python script
#!/usr/bin/env python3
import os, sys
from pyvesync import VeSync # https://github.com/webdjoe/pyvesync#
manager = VeSync(os.environ['LEVOIT_ACCOUNT'], os.environ['LEVOIT_PASSWORD'], os.environ['LEVOIT_TIMEZONE'])
manager.login()
# Get/Update Devices from server - populate device lists
manager.update()
# Adlist from https://www.bonasavoir.ch/offres-douteuses-internet
0.0.0.0 cool.fragschnell.de
0.0.0.0 num.to
0.0.0.0 www.1000gratisproben.com
0.0.0.0 www.120gratissms.de
0.0.0.0 www.123simsen.com
0.0.0.0 www.150freesms.de
0.0.0.0 www.1sms.at
0.0.0.0 www.1sms.de
@pedropombeiro
pedropombeiro / brightness.rb
Last active November 10, 2019 11:48
Smooth external monitor brightness control (assignable to keyboard shortcuts)
#!/usr/bin/env ruby
# frozen_string_literal: true
mon = 'DP-1' # Discover monitor name with: xrandr | grep " connected"
total_inc = 0.20 # Step Up/Down brightness by inc
steps = 10 # Total number of steps (for gradient)
# Avoid reentrance which would cause jerky behavior
exit 0 if Integer(`ps aux | grep "ruby #{__FILE__}" | wc -l`) > 3
@pedropombeiro
pedropombeiro / useful-commands.md
Last active April 3, 2019 13:03
Useful commands in Linux

Useful commands in Linux

Networking

Watch WiFi signal strength:

watch -c "nmcli -c yes -f "SIGNAL,BARS,CHAN,RATE,SSID,IN-USE" d wifi list | sort -hrs -k1.6"
@pedropombeiro
pedropombeiro / sign-vbox-modules.sh
Last active March 23, 2019 23:42
Sign vbox modules (/root/module-signing/)
#!/bin/bash
function signModule() {
modfile=$1
signScript="/usr/src/linux-headers-$(uname -r)/scripts/sign-file"
echo "Signing $modfile"
if [ ! -f $signScript ]; then
echo "Could not find $signScript, exiting"
exit 1
@pedropombeiro
pedropombeiro / 99-carbonx1clickpad.conf
Created September 9, 2018 22:17
Make middle click act as left click on ThinkPad X1C6 - /usr/share/X11/xorg.conf.d/99-carbonx1clickpad.conf
Section "InputClass"
Identifier "TPPS/2 Elan TrackPoint"
Option "ButtonMapping" "1 1 3 4 5 6 7"
EndSection
Section "InputClass"
Identifier "Synaptics TM3288-011"
Option "ButtonMapping" "1 1 3 4 5 6 7"
EndSection
@pedropombeiro
pedropombeiro / bluetooth-suspend
Last active April 25, 2020 19:40
/lib/systemd/system-sleep/resume-x1-fix.sh
#!/bin/bash
# Makes sure bluetooth service is not running while suspended.
if [ "${1}" == "pre" ]; then
service bluetooth stop
elif [ "${1}" == "post" ]; then
service bluetooth start
fi
@pedropombeiro
pedropombeiro / setup-ubuntu-devpc.yml
Last active December 30, 2020 19:15
Ansible script to set up Ubuntu Dev PC
- hosts: DEV-PC
remote_user: pedro
vars:
usr_path: /usr/local
bin_path: '{{ usr_path }}/bin'
profile_path: '{{ ansible_env.HOME }}/.profile'
downloads_path: '{{ ansible_env.HOME }}/Downloads'
docker_compose_url: https://github.com/docker/compose/releases/download/1.18.0/docker-compose-{{ ansible_system }}-{{ ansible_userspace_architecture }}
ngrok_url: https://bin.equinox.io/c/4VmDzA7iaHb/ngrok-stable-linux-amd64.zip
bc4_url: https://www.scootersoftware.com/bcompare-4.2.4.22795_amd64.deb
@pedropombeiro
pedropombeiro / id_rsa.pub
Created February 18, 2018 12:09
home.pedropombeiro.com
ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAACAQDn+8Nii9BYEqoPFBanH0A5yPBSa1QL43lMdhSQI8tDKbpqoec9syQTcgiFgs2r9++4m7Ni+fsxx7KCUEG5icoT0WLyokt+dazfzs/Y8D4Fsazk/lZVnk+wb3FFebV94tXPYY3w7pxnlWRHHDRzyFjeGVr4l28utvykFLMylBw7873RTjrMwiu+LdZxnoaEkUwVEEsrD23TWDG887OoqyDsUhL/Kj3kzaDxJBFOqakyblZbasIVyR/iVRvAArKgt5c70reWonlk06hhaLoDJdjAKNi4s0Ov4h0HCMj/SweQrLLfeAr1BKA+iH4N4JoDRCpSl8bWnnARkPdkzZRNcOJh6BeT0uQAJ9GO+/ey4P3f05nzAUe8Tfhvs6t9ymCQ/IRGzUaTqGSFVY8qsGe95OcTrKC6xVGaEroR3sFqAn3tLD0hC9Gwgf6qESIxX/DtEDC3GrNQetSJKwsxQc5VuwknW1e4z9GZgY8BwKmOF7T/qcnOG9lruSY2A6maeyEVcCAJYrcgofxefqKRH6im4n1TqCzlbQKuooOz3S51th34I0GN0u+mQW7jqKX0ZDBjjzNRoQPQ+Cmb8tLhoHcOmzn3NPu+Uxtv7pqCF2PpQnnWF3uuTdtIUBJGEIGTMMp+ptK37CnaYdR1M6T14UYro7J8QOMRjqfVVUDhgpTrwNeQ1Q== home.pedropombeiro.com