Skip to content

Instantly share code, notes, and snippets.

View dandrzejewski's full-sized avatar
🥵

David Andrzejewski dandrzejewski

🥵
View GitHub Profile
@grizz
grizz / stream2alma.sh
Last active November 23, 2023 15:14
Convert CentOS Stream to AlmaLinux
# swap back to stream repos
# dnf swap centos-{stream,linux}-repos -- only works if the centos-linux-repos package is cached
dnf install --allowerasing https://mirror.rackspace.com/centos-vault/8.5.2111/BaseOS/x86_64/os/Packages/centos-linux-repos-8-3.el8.noarch.rpm
# doesn't work, need to manually flip after update
# dnf swap centos-{stream,linux}-release
# update to centos-vault repos
sudo sed -i -e '/mirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=/ s/^#*/#/' -e '/baseurl=http:\/\/mirror.centos.org\/$contentdir\/$releasever\// s/^#*/#/' -e '/^\[baseos\]/a baseurl=https://mirror.rackspace.com/centos-vault/8.5.2111/BaseOS/$basearch/os' /etc/yum.repos.d/CentOS-Linux-BaseOS.repo
sudo sed -i -e '/mirrorlist=http:\/\/mirrorlist.centos.org\/?release=$releasever&arch=$basearch&repo=/ s/^#*/#/' -e '/baseurl=http:\/\/mirror.centos.org\/$contentdir\/$releasever\// s/^#*/#/' -e '/^\[appstream\]/a baseurl=https://mirror.rackspace.com/centos-vault/8.5.2111/AppStream/$basearch/os' /e
@chris2k20
chris2k20 / Proxmox-Cloudinit.sh
Last active April 21, 2024 13:20
Proxmox Cloud-Init Template Creation Bash-Script (Ubuntu)
#!/bin/bash
# Creates a Ubuntu Cloud-Init Ready VM Template in Proxmox
#
# Update the image name and URL for Ubuntu 22.04 LTS
export IMAGENAME="jammy-server-cloudimg-amd64.img"
export IMAGEURL="https://cloud-images.ubuntu.com/jammy/current/"
export STORAGE="local-zfs-cache"
export VMNAME="ubuntu-2204-cloudinit-template"
export VMID=902204
@wpmudev-sls
wpmudev-sls / wpmudev-forminator-editor-access.php
Last active April 15, 2024 16:51
[Forminator] Grants Full Acesses For Editor Role. This plugin allows users with the editor role to have full access (view and save) to the Forminator administrative pages.
<?php
/**
* Plugin Name: [Forminator] Grants Full Access For Editor Role.
* Plugin URI: https://premium.wpmudev.org/
* Description: This plugin allows users with the editor role to have full access (view and save) to the Forminator administrative pages.
* Author: Glauber Silva @ WPMUDEV
* Author URI: https://premium.wpmudev.org/
* Task: 0/11289012348292/1169742392170370
* License: GPLv2 or later
*
@syrte
syrte / markdown.tid
Last active June 29, 2022 23:26
A drop-in replacement to the official TiddlyWiki Markdown plugin. It is implemented with markdown-it and supports math through katex.
author: JeremyRuston, Syrte
core-version: >=5.0.0
dependents:
description: Markdown parser
list: readme usage howto
plugin-type: plugin
revision: 0
title: $:/plugins/tiddlywiki/markdown
type: application/json
version: 6.0.0
@ageis
ageis / YubiKey-GPG-SSH-guide.md
Last active July 5, 2024 09:20
Technical guide for using YubiKey series 4 for GPG and SSH

YubiKey 4 series GPG and SSH setup guide

Written for fairly adept technical users, preferably of Debian GNU/Linux, not for absolute beginners.

You'll probably be working with a single smartcard, so you'll want only one primary key (1. Sign & Certify) and two associated subkeys (2. Encrypt, 3. Authenticate). I've published a Bash function which automates this slightly special key generation process.

@htuscher
htuscher / .gitlab-ci.yml
Created August 3, 2017 08:12
Deploying with docker-compose via SSH tunnel in Gitlab CI
deploy:live:
image: 1drop/docker:git
stage: deploy
when: manual
environment:
name: production
url: https://www.somecustomer.de
before_script:
- eval $(ssh-agent -s)
- ssh-add <(echo "$SSH_PRIVATE_KEY")
@SmartFinn
SmartFinn / dhcp-leases-to-dns.rsc
Last active June 14, 2024 22:44
MikroTik (RouterOS) script for automatically setting DNS records for clients when they obtain a DHCP lease
# MikroTik (RouterOS) script for automatically setting DNS records
# for clients when they obtain a DHCP lease.
#
# author SmartFinn <https://gist.github.com/SmartFinn>
:local dnsTTL "00:15:00";
:local token "$leaseServerName-$leaseActMAC";
# Normalize hostname (e.g. "-= My Phone =-" -> "My-Phone")
# - truncate length to 63 chars
@jtyr
jtyr / corporate-linux-desktop-howto.md
Created November 3, 2015 17:09 — forked from anonymous/corporate-linux-desktop-howto.md
How to run Linux desktop in a corporate environment

How to run Linux desktop in a corporate environment

DISCLAIMER

Some of the practices described in this HOWTO are considered to be illegal as they often break internal corporate policies. Anything you do, you do at your own risk.

@non
non / answer.md
Last active January 9, 2024 22:06
answer @nuttycom

What is the appeal of dynamically-typed languages?

Kris Nuttycombe asks:

I genuinely wish I understood the appeal of unityped languages better. Can someone who really knows both well-typed and unityped explain?

I think the terms well-typed and unityped are a bit of question-begging here (you might as well say good-typed versus bad-typed), so instead I will say statically-typed and dynamically-typed.

I'm going to approach this article using Scala to stand-in for static typing and Python for dynamic typing. I feel like I am credibly proficient both languages: I don't currently write a lot of Python, but I still have affection for the language, and have probably written hundreds of thousands of lines of Python code over the years.

@eteubert
eteubert / wordpress-passwort-reset-unmultisite.php
Last active July 10, 2024 22:46
Multisite: Passwort Reset on Local Blog
<?php
/**
* Plugin Name: Multisite: Passwort Reset on Local Blog
* Plugin URI: https://gist.github.com/eteubert/293e07a49f56f300ddbb
* Description: By default, WordPress Multisite uses the main blog for passwort resets. This plugin enables users to stay in their blog during the whole reset process.
* Version: 1.0.0
* Author: Eric Teubert
* Author URI: http://ericteubert.de
* License: MIT
*/