Skip to content

Instantly share code, notes, and snippets.

Disabled phony services

sudo systemctl --global mask tracker-miner-fs-3.service
sudo systemctl --global mask tracker-xdg-portal-3.service
sudo apt remove tracker tracker-extract tracker-miner-fs
/**
* Conserve aspect ratio of the original region. Useful when shrinking/enlarging
* images to fit into a certain area.
*
* @param {Number} srcWidth width of source image
* @param {Number} srcHeight height of source image
* @param {Number} maxWidth maximum available width
* @param {Number} maxHeight maximum available height
* @return {Object} { width, height }
*/
@lemajes
lemajes / Linux-missing-firmware-rtl.md
Created August 7, 2023 21:13
[Linux missing rtl firmware] Linux missing rtl firmware #linux #debian #rtl #firmware #lavalise
  • Download files
#!/bin/bash
mkdir /tmp/fw && cd /tmp/fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8125b-2.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8125a-3.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8107e-2.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8107e-1.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/tl8168fp-3.fw
wget https://git.kernel.org/pub/scm/linux/kernel/git/firmware/linux-firmware.git/plain/rtl_nic/rtl8168h-2.fw
@lemajes
lemajes / htaccess-redirections.md
Created July 7, 2023 14:38
Common Htaccess redirections #php #htaccess #redirection #rewrite #url

Redirect if !_DEBUG=1

RewriteCond %{QUERY_STRING} !_DEBUG=1 #RewriteRule ^/(.)$ /$1?_DEBUG=1 [QSA,R,L] RewriteRule ^/(.)$ /$1?_DEBUG=1 [QSA,L]

#301 Redirects for .htaccess

#Redirect a single page: Redirect 301 /pagename.php http://www.domain.com/pagename.html

@thepwrtank18
thepwrtank18 / keys.md
Last active April 17, 2025 05:06
Windows XP/2003 Product Keys

DEPRECATION NOTICE

Consider this gist to be deprecated. It's full of information that may or may not be correct, given recent findings. Consider the in-development PIDDatabase, and UMSKT, instead: https://umskt.github.io/PIDDatabase-viewer https://github.com/UMSKT/UMSKT

Windows XP/2003 Product Keys

These keys have been tested to work. These are a combination of keys from Chinese websites, trial keys inside ISO's, auto-activate keys in OEM ISO's, and directly from Microsoft's website, all aggregated for your convenience.

Usage

In order to use these keys, you need the right edition of Windows XP/2003. Not just Home/Pro/Enteprise/etc, whether it's a Retail, OEM or Volume version. There's a clear cut way to check this.

@DaniruKun
DaniruKun / whisper-transcribe.bash
Last active November 7, 2024 07:15
Transcribe (and translate) any VOD (e.g. from Youtube) using Whisper from OpenAI and embed subtitles!
#!/usr/bin/env bash
# Small shell script to more easily automatically download and transcribe live stream VODs.
# This uses YT-DLP, ffmpeg and the CPP version of Whisper: https://github.com/ggerganov/whisper.cpp
# Use `./transcribe-vod help` to print help info.
# MIT License
# Copyright (c) 2022 Daniils Petrovs
@lemajes
lemajes / IMAGEMAGICK-101.md
Created August 2, 2022 16:15
[IMAGEMAGICK 101] IMAGEMAGICK 101 #debian #web #php #convert #imagemagick #imagick

IMAGEMAGICK 101

  • Create thumbnail of pdf with first page convert my.pdf[0] -flatten mythumbnail-pdf.jpg
#!/bin/bash
cd /tmp
echo "Wget $1"
wget --spider --recursive --level=3 --no-verbose --output-file=sitemap.txt $1
echo "Grep URLs"
grep -i URL /tmp/sitemap.txt | awk -F 'URL:' '{print $2}' | awk '{$1=$1};1' | awk '{print $1}' | sort -u | sed '/^$/d' > /tmp/sitemap-urls.txt
header='<?xml version="1.0" encoding="UTF-8"?><urlset
xmlns="http://www.sitemaps.org/schemas/sitemap/0.9"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.sitemaps.org/schemas/sitemap/0.9
@lemajes
lemajes / YOUTUBE-DL-101.md
Last active October 26, 2024 23:51
[YOUTUBE DL 101] Youtube DL 101 #bash #youtube #dl #youtubedl #101 #python #pip
  • Install Youtube-DL apt install youtube-dl
  • Download only audio of a video youtube-dl -f 'bestaudio[ext=m4a]' 'http://youtu.be/hTvJoYnpeRQ'
@lemajes
lemajes / Server2019-OpenSSH-Server-Install.md
Created August 18, 2021 13:18
[Server 2019] Install OpenSSH Server #windows #server #2019 #openssh #install
  • Open elevated PowerShell

  • Install the OpenSSH Client Add-WindowsCapability -Online -Name OpenSSH.Client~~~~0.0.1.0

  • Install the OpenSSH Server Add-WindowsCapability -Online -Name OpenSSH.Server~~~~0.0.1.0

  • Start the sshd service Start-Service sshd