Skip to content

Instantly share code, notes, and snippets.

@lavr
lavr / send_email.py
Last active May 10, 2024 10:35
std email vs emails
# see also: http://code.activestate.com/recipes/578150-sending-non-ascii-emails-from-python-3/
import os
import smtplib
from email.utils import formataddr
from email.utils import formatdate
from email.utils import COMMASPACE
from email.header import Header
@abelcallejo
abelcallejo / README.md
Last active May 10, 2024 10:32
Create bootable Linux USB using Mac

Creating bootable Linux USB using Mac

mac

CentOS, Ubuntu, Slackware, etc. Whatever Linux-based OS it is, you can create a bootable USB for it by using a Mac.

1. Prepare the .iso file

Download it, copy it, whatever it takes to prepare that Linux-based OS .iso file

2. Convert the .iso file into a .img.dmg

# ██████╗ ███████╗███╗ ███╗ ██████╗ ██╗ ██╗███████╗ ██╗ ██╗██████╗
# ██╔══██╗██╔════╝████╗ ████║██╔═══██╗██║ ██║██╔════╝ ██║ ██║██╔══██╗
# ██████╔╝█████╗ ██╔████╔██║██║ ██║██║ ██║█████╗ ███████║██████╔╝
# ██╔══██╗██╔══╝ ██║╚██╔╝██║██║ ██║╚██╗ ██╔╝██╔══╝ ██╔══██║██╔═══╝
# ██║ ██║███████╗██║ ╚═╝ ██║╚██████╔╝ ╚████╔╝ ███████╗ ██║ ██║██║
# ╚═╝ ╚═╝╚══════╝╚═╝ ╚═╝ ╚═════╝ ╚═══╝ ╚══════╝ ╚═╝ ╚═╝╚═╝
#
# ██████╗ ██╗ ██████╗ █████╗ ████████╗██╗ ██╗ █████╗ ██████╗ ███████╗
# ██╔══██╗██║ ██╔═══██╗██╔══██╗╚══██╔══╝██║ ██║██╔══██╗██╔══██╗██╔════╝
# ██████╔╝██║ ██║ ██║███████║ ██║ ██║ █╗ ██║███████║██████╔╝█████╗
@ForsakenHarmony
ForsakenHarmony / protocol.md
Last active May 10, 2024 10:27
dbx DriveRack PA2 protocol exploration

PA2 protocol

  • port: 19272
  • protocol: text over TCP (UDP might also be possible)

PA2 Control

Searching for devices

Broadcast (UDP)

#include <stdio.h>
#include <stdlib.h>
struct node{
int data;
struct node* next;
}*head = NULL;
void insert(int data){
struct node* newNode;
newNode = (struct node*)malloc(sizeof(struct node));
@cybik
cybik / README.md
Last active May 10, 2024 10:25
GDM with KDE: a dumb revelation

The Neckbeard

Hi. I'm cybik. Look for me around the internet.

The Background

I used Pop_OS. I kinda liked GDM because of its sleekiness, simplicity, yet overall subdued tones. But I use KDE since GNOME can't actually implement interesting features or actual desktop UX to save its life.

The Issue

@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 10, 2024 10:22
国内的 Docker Hub 镜像加速器,由国内教育机构与各大云服务商提供的镜像加速服务 | Dockerized 实践 https://github.com/y0ngb1n/dockerized

Docker Hub 镜像加速器

国内从 Docker Hub 拉取镜像有时会遇到困难,此时可以配置镜像加速器。Docker 官方和国内很多云服务商都提供了国内加速器服务。

Dockerized 实践 https://github.com/y0ngb1n/dockerized

配置加速地址

Ubuntu 16.04+、Debian 8+、CentOS 7+

@tuxity
tuxity / navicat_premium_reset_trial.sh
Last active May 10, 2024 10:17
Reset Navicat Premium 15/16 remaining trial days
#!/bin/bash
set -e
file=$(defaults read /Applications/Navicat\ Premium.app/Contents/Info.plist)
regex="CFBundleShortVersionString = \"([^\.]+)"
[[ $file =~ $regex ]]
version=${BASH_REMATCH[1]}
@renich
renich / 00-gentoo-installation-partitioning.bash
Last active May 10, 2024 10:16
Install Gentoo on BtrFS subvolumes + UEFI
#!/usr/bin/env bash
# WARNING!!
# This will obliterate all the data in your partition!! (not actually true, but act as if it was)
# Do NOT execute this script if you don't fully understand it!
# a few vars
amount_of_swap=$( free --si -g | grep Mem: | gawk '{ print $2 + 1}' )
# create directories
@mjbalcueva
mjbalcueva / password-input.tsx
Last active May 10, 2024 10:14
shadcn ui custom password input
"use client"
import { forwardRef, useState } from "react"
import { EyeIcon, EyeOffIcon } from "lucide-react"
import { Button } from "@/components/ui/button"
import { Input, InputProps } from "@/components/ui/input"
import { cn } from "@/lib/utils"
const PasswordInput = forwardRef<HTMLInputElement, InputProps>(
({ className, ...props }, ref) => {