Skip to content

Instantly share code, notes, and snippets.

View c0m4r's full-sized avatar
🐧

c0m4r

🐧
View GitHub Profile
@c0m4r
c0m4r / _malicious_hide_youtube_short_extension_in_google_chrome_web_store.md
Last active November 12, 2024 08:28
Malicious "Hide Youtube Shorts" extension in Google's Chrome Web Store

Malicious "Hide Youtube Shorts" extension in Google's Chrome Web Store

https://gist.githubusercontent.com/c0m4r/45e15fc1ec13c544393feafca30e74de/raw/6f5924b8e9c138cea35642b86c53b06011166ecc/hide_youtube_shorts_chrome_web_store.png

TL;DR: This extension for Chrome and Brave is malicious, do not use it.

(Update) A follow up story by Wladimir Palant: https://palant.info/2024/10/30/the-karma-connection-in-chrome-web-store/

(Update 2024-11-11) The extension has been removed from CWS and marked as violating Chrome Web Store policies (which is good, but odd, as it should be marked as malware)

@c0m4r
c0m4r / _nginx_ssl_php_fpm_certbot.md
Last active November 3, 2024 09:53
nginx ssl + ocsp + http/2 + quic + php-fpm + certbot

This setup allows restrictive chmods, which prevents users for reading the conents of each others directories and provides a layer of security against reading raw PHP code in case of FPM failure. You can set chmod 600 for all .php files and chmod 640/710 for any other static files/dirs.

certbot certonly -d example.com
useradd -m -d /home/example -s /bin/bash example
usermod -a -G nginx example
su - example -c "mkdir ~/www"
chmod 710 /home/example
chmod 710 /home/example/www
su - example -c "echo '' > ~/www/index.php"
@c0m4r
c0m4r / _epic_free_games_email_notifications.md
Last active November 3, 2024 09:12
Email notifications with weekly Epic Store Free Games

Epic Store Free Games email notifications

OS Setup: Linux (any), Postfix as a forwarder

Depends on: nodejs + AuroPick/epic-free-games

It's best to run cron once every 2-3 days, so as not to miss the release time window. The script compares with the last run to avoid sending duplicate emails.

v2: JS only

@c0m4r
c0m4r / observium_on_alpine_linux.md
Last active September 29, 2024 23:35
Observium on Alpine Linux

Observium on Alpine Linux

WARNING: It's a draft. It doesn't cover security, permissions and other stuff.

Tested on Alpine Linux v3.20 / Observium CE 24.4

Installation

Derived from https://docs.observium.org/install_debian/

@c0m4r
c0m4r / _whitelist_ddns_mikrotik_ip_iptables.md
Last active September 29, 2024 07:49
Whitelist DDNS Mikrotik IP iptables

Whitelist DDNS Mikrotik IP iptables

A python script solution to whitelist an IP address in iptables resolved with Mikrotik DDNS service (or any other).

In this example I have whitelisted Mikrotik DDNS IP to allow access to SSH and OpenVPN ports.

The script is scheduled in crontab to run every minute. It will resolve Mikrotik DDNS domain, flush the iptables WHITELIST chain and add the IP address if it changed.

@c0m4r
c0m4r / lenovo_ideapad_gaming_3_bios_update_linux.md
Last active June 1, 2024 02:54
Update Lenovo ideapad Gaming 3 Laptop BIOS on Linux

Update Lenovo ideapad Gaming 3 Laptop BIOS on Linux

WARNING: flashing the new BIOS can brick your laptop, DON'T do it if you don't know what you're doing or just for the sake of having the latest firmware. Make sure you actually need it and that both your laptop's power AC adapter is plugged in and the battery is fully charged.

Preamble

If you've got one the ideapad gaming 3 laptops you might face the problem with updating the BIOS, if your model isn't covered via fwupd.

There are ways to workaround it with some crazy shit magic tools, but the safest way is just use the Windows environent in the absence of a BIOS update file for Linux.

@c0m4r
c0m4r / alpine_3.19_desktop_setup.md
Last active February 4, 2024 05:28
Alpine 3.19 desktop setup

Alpine 3.19 desktop setup

Install Alpine

  1. Get Standard ISO from https://alpinelinux.org/downloads/
  2. Boot the ISO and log in as root (no password required).
  3. Run setup-alpine and install using defaults. For partition layout use sys or lvmsys.

Desktop Setup

@c0m4r
c0m4r / q3arena_ioquake3_linux.md
Last active February 2, 2024 01:39
Building Quake III Arena on Linux from ioquake3 source
@c0m4r
c0m4r / gentoo_arm64_ipv6_hetzner_cloud.md
Last active January 24, 2024 22:30
Gentoo ARM64 IPv6 installation on Hetzner Cloud VPS

Gentoo ARM64 IPv6 quick-ish setup on Hetzner Cloud

image

This guide explains how to waste your time installing Gentoo on a Hetzner Cloud VPS.

Not only that, I use IPv6-only connected machine and Arm64 at the same time. If I'm not insane, I don't know who is.

Also, yes, I'm skipping lots of configuration steps.