Skip to content

Instantly share code, notes, and snippets.

@sho-t
sho-t / zsh_variable.md
Last active January 15, 2025 15:00
Zsh 変数メモ

variable

変数に関するメモ。 💤がついてるのはzsh 固有のもの。

📮 シェル変数と環境変数

  • シェル変数 → 子プロセスに継承されない
  • 環境変数 → 子プロセスに継承される

環境変数登録

import os
import cloudflare.pagination
import cloudflare.resources
import cloudflare.resources.dns
import requests
import sys
import cloudflare
cloudflare_email = os.environ['cloudflare_email']
cloudflare_api_key = os.environ['cloudflare_api']
ip = requests.get('https://api.ipify.org').text
@mikegerber
mikegerber / Fix WSL2 vs VPN networking.md
Last active January 15, 2025 14:57
Fix WSL2 vs VPN networking

The problem

WSL2 uses a random network from the 172.16.0.0/12 RFC1918 private IP address block. And our VPN uses that address block, too, with a route metric of 1 (= most preferred.)

This breaks networking for WSL2. Meh!

The solution

While messing around with the interface/route metric of the VPN network may work around the problem, it also reduces the priority of the VPN. We do not really want this. Additionally, changing the interface metric does not seem to be permanent, so it requires more work when it breaks again.

@robconery
robconery / Book.md
Last active January 15, 2025 14:56
Obsidian Bujo Templates
title description author created updated
{{title}}
{{description}}
{{author}}
{"DATE:YYYY-MM-DD HH:mm:ss" => nil}
{"DATE:YYYY-MM-DD HH:mm:ss" => nil}

cover|150

@wolfiediscord
wolfiediscord / FAQ.MD
Last active January 15, 2025 14:55
A guide of how to install unsupported macOS versions on unsupported macs. An FAQ is listed at the end as well.
@nik-gnomic
nik-gnomic / voipmixxer
Last active January 15, 2025 14:54
VOIPmixxer - jack_mixer configuration for JACK
<?xml version="1.0" ?>
<jack_mixer geometry="807x507" paned_position="377" visible="True">
<input_channel name="Mic" type="mono" volume="0.000000" balance="0.000000" out_mute="False" volume_midi_cc="11" balance_midi_cc="12" mute_midi_cc="13" solo_midi_cc="14"/>
<input_channel name="VOIP call" type="mono" volume="0.000000" balance="0.000000" out_mute="False" volume_midi_cc="15" balance_midi_cc="16" mute_midi_cc="17" solo_midi_cc="18"/>
<input_channel name="Music" type="stereo" volume="-15.000000" balance="0.000000" out_mute="False" volume_midi_cc="19" balance_midi_cc="20" mute_midi_cc="21" solo_midi_cc="22"/>
<output_channel name="LIVE" type="stereo" solo_buttons="true" prefader_channels="Music" color="rgb(102,0,0)" volume="0.000000" balance="0.000000" out_mute="False"/>
<output_channel name="VOIP out" type="stereo" muted_channels="VOIP call" color="rgb(0,0,102)" volume="0.000000" balance="0.000000" out_mute="False"/>
<output_channel name="Speaker" type="stereo" muted_channels="Mic|VOIP call" prefader_ch
@eylenburg
eylenburg / msoffice_in_linux.md
Last active January 15, 2025 14:51
Installing Microsoft Office in Linux

Step by step guide: How to install Microsoft Office in any Linux distribution

There are multiple options how to install MS Office on Linux.

VM-based - Integrate Windows apps running in a Windows virtual machine as native-looking in Linux

  1. Winapps, based on KVM, QEMU, Docker/Podman and FreeRDP. Still actively maintained (getting Github commits). Decribed below
  2. Cassowary, based on KVM, QEMU, libvirt/virt-manager, and FreeRDP. Has a helpful GUI and apparently can auto-suspend the VM when no Windows app is in use. Last release in Feb 2022 and seems to be abandoned.

The VM-based options means can run Office 2021 or Office 365 including all apps, but while the Windows apps themselves run flawlessly (as they're running on real Windows) there's various freerdp-related bugs you may encounter.

@tdcosta100
tdcosta100 / WSL2GUIWSLg-XWayland-en.md
Last active January 15, 2025 14:51
A tutorial to use GUI in WSL2/WSLg replacing original Xorg by Xwayland, allowing WSL to work like native Linux, including login screen

Full desktop shell in WSL2 using WSLg (XWayland)

Note

If you want to use Wayland in WSLg in a simpler setup, you can try the WSLg (Wayland) tutorial.

In this tutorial, we will setup GUI in WSL2. No additional software outside WSL (like VcXsrv or GWSL) is required. You will find this tutorial very similar to the one that replaces Xorg with Xvnc. Indeed, it's pretty much the same tutorial, with some few changes.

The key component we need to install is the desktop metapackage you want (GNOME, KDE, Xfce, Budgie, etc), and after that, replace the default Xorg by a script that calls Xwayland instead.

For this setup, I will use Ubuntu 24.04, and install GNOME Desktop. Unfortunately older versions of Ubuntu lack some fundamental things, so we cannot reproduce it in older versions (at least not fully). Since the key components aren't bound to Ubuntu or GNOME, you can use your favorite distro and GUI. Check the [Sample screenshot

Chapter 1: Introduction to PL/pgSQL

What is PL/pgSQL?

PL/pgSQL (Procedural Language/PostgreSQL Structured Query Language) is a procedural language used to write functions, triggers, and stored procedures within the PostgreSQL database. It extends SQL by adding control structures such as loops, conditions, and error handling. This allows developers to write more complex database operations and business logic inside the database itself.

Unlike SQL, which is primarily used to query and manipulate data, PL/pgSQL allows for procedural control over how and when those operations occur, making it ideal for tasks such as automation, batch processing, and integrating complex business logic into your database operations.

History and Significance in PostgreSQL