Skip to content

Instantly share code, notes, and snippets.

@shreeve
shreeve / ssl-certs.sh
Last active June 13, 2024 12:48
Self signing certificate script
#!/bin/bash
# =============================================================================
# ssl-certs.sh - Self signing SSL certificates
#
# Author: Steve Shreeve <steve.shreeve@gmail.com>
# Date: Dec 17, 2022
# =============================================================================
# Use https://gist.github.com/shreeve/3358901a26a21d4ddee0e1342be7749d
function useAbortController() {
const abortControllerRef = React.useRef()
const getAbortController = React.useCallback(() => {
if (!abortControllerRef.current) {
abortControllerRef.current = new AbortController()
}
return abortControllerRef.current
}, [])
React.useEffect(() => {
@iggyster
iggyster / PaginateNativeQuerySubscriber.php
Last active July 16, 2024 12:52
How to handle a NativeQuery for the KNP paginator
<?php
declare(strict_types=1);
namespace AppBundle\EventSubscriber;
use Doctrine\ORM\EntityManagerInterface;
use Doctrine\ORM\NativeQuery;
use Doctrine\ORM\NonUniqueResultException;
use Doctrine\ORM\Query\ResultSetMapping;
@ansemjo
ansemjo / container-systemd-autologin.conf
Created April 26, 2019 10:53
enable root autologin when starting a container with systemd init
# drop-in override to fix and enable autologin in rootless containers with systemd init
# e.g.:
#
# podman run --rm -it \
# -v .../container-systemd-autologin.conf:/etc/systemd/system/console-getty.service.d/override.conf:ro \
# centos:latest /usr/lib/systemd/systemd
[Service]
ExecStart=
ExecStartPre=-/usr/bin/sed -i '/pam_loginuid.so/d' /etc/pam.d/login
@ceekz
ceekz / gmail.css
Created March 30, 2017 12:46
Chrome Stylist
/* mail.google.com */
table img[title*=".zip" i], table img[title*=".rar" i], table img[title*=".gz" i], table img[title*=".tar" i], table img[title*=".bz2" i] {
width:0px!important; height:0px!important; padding-left:16px!important; padding-top:16px!important; background-position: top left !important;background-image: url(https://ssl.gstatic.com/docs/doclist/images/mediatype/icon_1_archive_x16.png) !important;
}
table img[title*=".txt" i], table img[title*=".rtf" i], table img[title*=".csv" i], table img[title*=".tsv" i] {
width:0px!important; height:0px!important; padding-left:16px!important; padding-top:16px!important; background-position: top left !important; background-image:url(https://ssl.gstatic.com/docs/doclist/images/mediatype/icon_1_text_x16.png) !important;
}
table img[title*=".c" i], table img[title*=".pl" i], table img[title*=".sql" i] {
width:0px!important; height:0px!important; padding-left:16px!important; padding-top:16px!important; background-position: top left !important; background-
![Иллюстрация к проекту](https://github.com/jon/coolproject/raw/master/image/image.png)
![Image alt](https://github.com/{username}/{repository}/raw/{branch}/{path}/image.png)
{username} — ваш ник на ГитХабе;
{repository} — репозиторий где хранятся картинки;
{branch} — ветка репозитория;
{path} — путь к месту нахождения картинки.
@fntlnz
fntlnz / self-signed-certificate-with-custom-ca.md
Last active July 25, 2024 12:02
Self Signed Certificate with Custom Root CA

Create Root CA (Done once)

Create Root Key

Attention: this is the key used to sign the certificate requests, anyone holding this can sign certificates on your behalf. So keep it in a safe place!

openssl genrsa -des3 -out rootCA.key 4096
@lanrat
lanrat / NetworkManager.conf
Created July 12, 2016 01:19
NetworkManager ignore docker, virtualbox, and vmware adapters
[main]
plugins=ifupdown,keyfile
[ifupdown]
managed=false
[keyfile]
unmanaged-devices=interface-name:docker0;interface-name:vmnet1;interface-name:vmnet8;interface-name:vboxnet0