Skip to content

Instantly share code, notes, and snippets.

View felipebueno's full-sized avatar

Felipe Bueno felipebueno

View GitHub Profile
@felipebueno
felipebueno / 00-lenovo-x1-5th-gen-thinkfan-setup.md
Created June 12, 2020 02:02 — forked from abn/00-lenovo-x1-5th-gen-thinkfan-setup.md
Fedora thinkfan configuration for Lenovo X1 Carbon (5th Gen)

Thinkfan Configuration Notes

This are notes for configuration thinkfan for Fedora. This configuration procedure was followed on a Lenovo Thinkpad X1 Carbon (5th Gen) running Fedora 25.

Non standard (default) configuration was required for this machine as the default sensors are not available. Eg: /proc/acpi/ibm/thermal does not exist for this model.

An annoted configuration file has been included below. However, there is no guarentee that this will work as-is on every machine.

Installation

dnf -y install thinkfan
@felipebueno
felipebueno / php-oci8-debian.md
Created August 27, 2020 16:29 — forked from milo/php-oci8-debian.md
Oracle OCI8 extension on Linux Debian

Oracle Instant Client libraries installation

Download Oracle Instant Client libraries (URL may change, already happened few times). Be sure you download correct (x64 or x32) architecture. And correct version. I'm using Instant Client 10.1.0.5.0 with Oracle 10g, 11g and 12c and PHP 5.6, 7.1, 7.2, 7.3 and 7.4. Never hit any problem with such setup but my queries are quite simple.

Last time I used Instant Client 19.6.0.0.0 and compiled with PHP 7.4 fine. I had to download two files:

instantclient-basic-linux.x64-19.6.0.0.0dbru.zip
instantclient-sdk-linux.x64-19.6.0.0.0dbru.zip

and extacted them into single directory. I'm using /usr/local/lib/oracle. File tree follows:

@felipebueno
felipebueno / stacker-saloon.js
Last active March 12, 2024 22:06
TamperMonkey script to help DarthCoin find the Stacker Saloon on https://stacker.news
// ==UserScript==
// @name stacker saloon
// @namespace http://tampermonkey.net/
// @version 2024-03-12
// @description try to take over the world!
// @author You
// @match https://stacker.news/
// @icon https://www.google.com/s2/favicons?sz=64&domain=stacker.news
// @grant none
// ==/UserScript==
@felipebueno
felipebueno / web_utils.dart
Last active July 24, 2024 00:02
Flutter web update alert
// See https://x.com/whoisgraham/status/1815843202647089352
// for context
Future<void> maybeUpdate() async {
if (!kIsWeb) {
return;
}
try {
final response = await Dio().get( // We could use dart http instead of dio
'https://YOUR_BASE_URL/version.json?${Random().nextDouble()}', // Random double on each request to avoid cache
@felipebueno
felipebueno / compress_video
Created August 22, 2024 12:02 — forked from trvswgnr/compress_video
portable shell script to compress videos with ffmpeg
#!/bin/sh
print_usage() {
echo "usage: compress_video <input_file>"
echo "supported formats: mp4, webm, mkv, mov, avi, flv"
}
get_extension() {
f="${1##*/}"
case "$f" in