Skip to content

Instantly share code, notes, and snippets.

@yordanoweb
yordanoweb / squid_https_cached.conf
Last active November 1, 2022 00:59
Squid Cache configuration for caching HTTPS
##################################################################################################################
# openssl req -new -newkey rsa:2048 -sha256 -days 365 -nodes -x509 -extensions v3_ca -keyout squid-ca-key.pem -out squid-ca-cert.pem
# cat squid-ca-cert.pem squid-ca-key.pem >> squid-ca-cert-key.pem
# sudo mkdir /etc/squid/certs
# sudo mv squid-ca-cert-key.pem /etc/squid/certs/
# sudo chown proxy:proxy -R /etc/squid/certs
# sudo /usr/lib/squid/security_file_certgen -c -s /var/cache/squid/ssl_db -M16MB
# sudo chown -R proxy:proxy /var/cache/squid/ssl_db
# sudo systemctl restart squid
# echo After this, import in Firefox or Chrome (Settings -> Security -> Certificates -> Authorities)
@fnx4
fnx4 / noty.py
Created December 25, 2021 18:46
monitor windows notifications
import os
import sqlite3
import time
from bs4 import BeautifulSoup
ids = set()
user = os.environ['USERPROFILE'].replace("\\", "/")
adr = u"file:" + user + u"/AppData/Local/Microsoft/Windows/Notifications/wpndatabase.db?mode=ro"
@rifazn
rifazn / dark-toggle.sh
Last active September 19, 2021 14:24
A shell script to toggle between light and dark variants of a GTK theme.
#!/bin/sh
# A small POSIX compliant script to toggle between dark and light variant
# of a theme for GNOME based desktops.
# Copyright (C) 2021 Rifaz Nahiyan
# This code is licensed under the MIT License.
# View the license in its entirety at: https://opensource.org/licenses/MIT
get_current_theme () {
@akihikodaki
akihikodaki / README.en.md
Last active April 18, 2024 21:30
Linux Desktop on Apple Silicon in Practice

Linux Desktop on Apple Silicon in Practice

I bought M1 MacBook Air. It is the fastest computer I have, and I have been a GNOME/GNU/Linux user for long time. It is obvious conclusion that I need practical Linux desktop environment on Apple Silicon.

Fortunately, Linux already works on Apple Silicon/M1. But how practical is it?

  • Two native ports exist.
@marcorichetta
marcorichetta / ExtensionsProvider.md
Last active December 14, 2020 21:09
Change OpenVSX for MS Marketplace as extensions provider
find /usr/share/ -name "product.json"

# cd into vscodum directory
cd /usr/share/vscodium-bin/resources/app

nano product.json
org.gnome.desktop.wm.keybindings switch-group ['<Super>Above_Tab', '<Alt>Above_Tab']
org.gnome.desktop.wm.keybindings begin-resize ['<Alt>F8']
org.gnome.desktop.wm.keybindings switch-to-workspace-7 []
org.gnome.desktop.wm.keybindings begin-move ['<Alt>F7']
org.gnome.desktop.wm.keybindings move-to-side-w []
org.gnome.desktop.wm.keybindings move-to-corner-nw []
org.gnome.desktop.wm.keybindings move-to-workspace-10 []
org.gnome.desktop.wm.keybindings move-to-workspace-6 []
org.gnome.desktop.wm.keybindings move-to-workspace-right ['<Control><Shift><Alt>Right']
org.gnome.desktop.wm.keybindings always-on-top []
@djfdyuruiry
djfdyuruiry / README.md
Last active March 7, 2024 16:35
WSL 2 - Enabling systemd

Enable systemd in WSL 2

NOTE: If you have Windows 11 there is now an official way to do this in WSL 2, use it if possible - see MS post here (WINDOWS 11 ONLY)

This guide will enable systemd to run as normal under WSL 2. This will enable services like microk8s, docker and many more to just work during a WSL session. Note: this was tested on Windows 10 Build 2004, running Ubuntu 20.04 LTS in WSL 2.

  • To enable systemd under WSL we require a tool called systemd-genie

  • Copy the contents of install-sg.sh to a new file /tmp/install-sg.sh:

@win0err
win0err / install-apple-emoji.md
Last active March 28, 2024 22:29
💃 Apple Emoji on Linux

Install Apple Color Emoji on Linux

  1. Download font.
mkdir ~/.local/share/fonts/
wget https://github.com/samuelngs/apple-emoji-linux/releases/latest/download/AppleColorEmoji.ttf -O ~/.local/share/fonts/AppleColorEmoji.ttf
# or system-wide to /usr/share/fonts/AppleColorEmoji/, for example
  1. Put Apple Color Emoji on the 1st place in /etc/fonts/conf.d/60-generic.conf:
@NuxRo
NuxRo / msteams.lua
Created March 13, 2020 13:46
Apply Windows Decorations to Microsoft Teams
-- MS Teams on Linux doesn't show the window decorations, let's fix that
-- drop this in your devilspie2 folder, typically ~/.config/devilspie2 and start devilspie2
if string.match(get_window_name(), "Microsoft Teams") then
decorate_window();
end
@andrewgodwin
andrewgodwin / QuakeTerminal.ahk
Created February 15, 2020 17:41
AutoHotkey script for making Windows Terminal appear/disappear with a single keypress
#NoEnv ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn ; Enable warnings to assist with detecting common errors.
SendMode Input ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir% ; Ensures a consistent starting directory.
F12::ToggleTerminal()
ShowAndPositionTerminal()
{
WinShow ahk_class CASCADIA_HOSTING_WINDOW_CLASS