Skip to content

Instantly share code, notes, and snippets.

View cmilanf's full-sized avatar

Carlos Milán Figueredo cmilanf

View GitHub Profile
@cmilanf
cmilanf / dm1-linux-bt-firmware.bash
Last active September 9, 2023 23:03
HP Pavilion dm1 Linux feezing
#!/bin/bash
# Bluetooth firmware files for HP Pavilion dm1-4130ss
# https://wiki.debian.org/BCMHybridBTFirmware
set -xeuo pipefail
FILES=("BCM-0a5c-21e3.hcd" "BCM20702A1-0a5c-21e3.hcd")
GITHUB_URL="https://github.com/winterheart/broadcom-bt-firmware/raw/master/brcm"
SYSTEM_PATH="/lib/firmware/brcm"
for FILE in ${FILES[@]}
@cmilanf
cmilanf / gandi_script_mikrotik.rsc
Last active February 15, 2024 04:12
Mikrotik RouterOS GANDI dynamic DNS update script
# ----- Gandi.net LiveDNS dynamic DNS multi domain and subdomain write by Massimo Ciani ------
# Put the following script on "system script" as new script with policy "read, write, test" and name "LiveDNS_DDNS".
# If you use pppoe connection, go to ppp profile and click the profile that pppoe use. In the field "on up" put this
# line "/system script run LiveDNS_DDNS". without quotes.
#--------------- Change Values in this section to match your setup ------------------
# Your LiveDNS API KEY
:local apikey "your API KEY"
# Set the domain and subdomain to be updated.
@cmilanf
cmilanf / 0-NetBSD-amiga-postinstall.md
Last active November 19, 2023 02:09
NetBSD/amiga 9.2 post-installation steps

NetBSD/amiga 9.2 post-installation steps

Introduction

Even when you have finished installing NetBSD/amiga, there are several post-installation steps if you want to enjoy your new operating system. These are some small notes of information I gathered that makes the system way more friendly. Many thanks to Karl Jeacle for his post about NetBSD/amiga and the people at the NetBSD/amiga mail-list for all the help and question answering.

A note on ethernet support

Supported Amiga hardware in NetBSD can be found here, including ethernet cards. In Amiga 600 or Amiga 1200 it is possible to use PCMCIA cards, however, only those compatible with NE2000 will work. You can find a list of tested ethernet cards here. I can confirm the following PCMCIA ethernet cards works well in both, AmigaOS and NetBSD/amiga:

@cmilanf
cmilanf / ffmpeg-gif.sh
Last active January 9, 2022 15:13
ffmpeg conversion from video to animated gif
#!/bin/sh
# https://superuser.com/questions/556029/how-do-i-convert-a-video-to-gif-using-ffmpeg-with-reasonable-quality
ffmpeg -ss 30 -t 3 -i input.mp4 -vf "fps=10,scale=320:-1:flags=lanczos,split[s0][s1];[s0]palettegen[p];[s1][p]paletteuse" -loop 0 output.gif
@cmilanf
cmilanf / dhcp121.pl
Created August 17, 2020 15:54
Perl script to convert a combination of gateway and network IP addresses to hexadecimal, so it can be used for DHCP options 121 and 249, specifically in Mikrotik routers.
#!/usr/bin/perl -w
# AUTHOR: THG
# URL: https://forum.mikrotik.com/viewtopic.php?t=48262
# This scripts converts the format: [gateway] [host|network]/[bitmask] to hexadecimal,
# so it can be used on Mikrotik RouterOS for defining DHCP options 121 and 249.
#
# Multiple routes can be concatenated. It's usually needed to add the 0x characters at
# the begining.
@cmilanf
cmilanf / docsmsftlang-userscript.js
Created April 8, 2020 22:44
UserScript to make docs.microsoft.com display always the en-us URL
// ==UserScript==
// @name docs.microsoft.com always en-us
// @namespace http://calnus.com
// @version 0.1
// @description Sets the docs.microsoft.com URL to en-us
// @author Carlos Milán Figueredo
// @match https://docs.microsoft.com/*
// @grant none
// ==/UserScript==
@cmilanf
cmilanf / Generate-DockerCerts.ps1
Last active September 23, 2019 22:09
Scripts for setting up a remote Windows Server Docker build machine and connect with any Docker client
param (
[Parameter(Mandatory=$true)]
[string]$DnsName,
[string]$OpenSslDownloadUri="https://slproweb.com/download/Win64OpenSSL_Light-1_1_1d.exe"
)
$ErrorActionPreference = 'Stop'
$ip=(Resolve-DnsName -Name $DnsName -Type A).IPAddress
Invoke-WebRequest -Uri $OpenSslDownloadUri -UseBasicParsing -OutFile "$($env:temp)\openssl_setup.exe"
Start-Process -FilePath "$($env:temp)\openssl_setup.exe" -ArgumentList '/VERYSILENT','/NORESTART','/LOG' -NoNewWindow -Wait
[Environment]::SetEnvironmentVariable('PATH', $env:Path + ';C:\Program Files\OpenSSL-Win64\bin\', [EnvironmentVariableTarget]::User)
@cmilanf
cmilanf / enhance-powershell.ps1
Last active January 9, 2022 15:12
Vim and shell enhancing scripts
# https://gist.github.com/jchandra74/5b0c94385175c7a8d1cb39bc5157365e
$ModulePath = $Env:PSModulePath.Split(";")[0]
Write-Host "It is needed to have installed the PowerLine fonts for Windows"
Set-PSRepository -Name PSGallery -InstallationPolicy Trusted
Install-Module -Name 'posh-git' -Scope CurrentUser
Install-Module -Name 'oh-my-posh' -Scope CurrentUser
if(!(Test-Path -Path "$ModulePath\Get-ChildItemColor")) {
New-Item -ItemType Directory -Path "$ModulePath\Get-ChildItemColor" -Force
} else {
if(Test-Path -Path "$ModulePath\Get-ChildItemColor") {
@cmilanf
cmilanf / MegaflashROM_SCC+_SD.xml
Created October 18, 2018 07:57
openMSX MegaflashROM SCC+ SD definition file
<?xml version="1.0" ?>
<!DOCTYPE msxconfig SYSTEM 'msxconfig2.dtd'>
<msxconfig>
<info>
<name>MegaFlashROM SCC+ SD</name>
<manufacturer>Manuel Pazos</manufacturer>
<code/>
<release_year>2013</release_year>
<description>MSX Flash cartridge of 8MB with SCC-I and PSG and 2 SD card slots.</description>
<type>Flash cartridge</type>