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" />
# 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 / 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()
@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 / 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 / install-ubuntu.sh
Last active March 25, 2020 21:46
Set up dev environment in Ubuntu
#!/bin/sh
rm -f ~/Downloads/*
# Adapt Firefox settings
def_Pfile=`cat "$HOME/.mozilla/firefox/profiles.ini" | sed -n -e 's/^.*Path=//p' | head -n 1`
# Enable FIDO U2F in Firefox
echo "user_pref(\"security.webauth.u2f\", \"true\");" >> $HOME/.mozilla/firefox/$def_Pfile/prefs.js
sudo apt update
@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