Skip to content

Instantly share code, notes, and snippets.

@ekollof
ekollof / sshfp.yml
Created January 30, 2020 12:40
ansible playbook getting/registering sshfp records with cloudflare
- name: get SSHFP records
shell: "ssh-keygen -r {{ ansible_nodename }} | awk '{print $4, $5, $6}'"
register: sshfp_entries
- name: Register SSHFP with CloudFlare
cloudflare_dns:
zone: "hackerheaven.org"
record: "{{ ansible_hostname }}"
type: SSHFP
account_email: "{{ cloudflare_email }}"
@odudex
odudex / nostr_seed.py
Last active May 10, 2024 09:43
Uses Embit to convert hex or bech32 keys to BIP39 seed words and vice-versa
"""Uses Embit and qrcode modules to convert hex and bech32 keys to BIP39 seed words and vice-versa.
Also generates ascii compact seed QR codes.
Install Embit:
pip install embit
Exemple: Words as input:
python nostr_c_seed_qr.py picture body actor coil end satoshi fish mom distance proof thank play fantasy friend dinner clump boring ozone review cart virtual toss foot infant
Hex Key: a4431c0a96a4997ed5ec763fb58b7f532530b9cf916219f3d2e2118f47cb56bb
Bech32 key: nsec153p3cz5k5jvha40vwclmtzml2vjnpww0j93pnu7juggc737t26ascxcmgr
BIP39 seed numbers: [1315, 200, 22, 363, 589, 1532, 702, 1143, 510, 1379, 1791, 1331, 665, 744, 499, 355, 208, 1269, 1477, 281, 1956, 1838, 728, 923]
# This supports merging as many adapters as you want.
# python merge_adapters.py --base_model_name_or_path <base_model> --peft_model_paths <adapter1> <adapter2> <adapter3> --output_dir <merged_model>
from transformers import AutoModelForCausalLM, AutoTokenizer
from peft import PeftModel
import torch
import os
import argparse
@bradtraversy
bradtraversy / webdev_online_resources.md
Last active May 10, 2024 09:38
Online Resources For Web Developers (No Downloading)
@y0ngb1n
y0ngb1n / docker-registry-mirrors.md
Last active May 10, 2024 09:36
国内的 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+

@keuv-grvl
keuv-grvl / pandoc.md2pdf.sublime-build
Last active May 10, 2024 09:35
Convert Markdown to PDF within Sublime Text using Pandoc
{
"cmd": ["pandoc --latex-engine=xelatex --filter=pandoc-citeproc -o '$file_base_name.pdf' '$file_name'"],
"selector": "text.html.markdown",
"shell": true
}
@adhithyan15
adhithyan15 / countdown.js
Last active May 10, 2024 09:35
A simple countdown timer in Javascript
/********************************************************************************************************************
Countdown.js is a simple script to add a countdown timer
for your website. Currently it can only do full minutes
and partial minutes aren't supported. This script is a fork of http://jsfiddle.net/HRrYG/ with some
added extensions. Since the original code that I forked was released under Creative Commons by SA license,
I have to release this code under the same license. You can view a live demo of this code at http://jsfiddle.net/JmrQE/2/.
********************************************************************************************************************/
function countdown(minutes) {
var seconds = 60;
var mins = minutes
@almas
almas / ubuntu-22.04-mbp-a1707.md
Created May 10, 2024 09:30 — forked from rob-hills/ubuntu-22.04-mbp-a1707.md
Ubuntu 22.04 on MacBook Pro 2017 (A1707, MBP 14,3)

Summary

Random set of notes and links that have helped me in the saga to get Ubuntu 22.04 up and running on my 2017 MacBook Pro These notes are mainly for myself in the event that I have to do this again some day. But if you find them helpful, that's great.

Important update

Unfortunately the MacBookPro that I bought second hand turned out to be a dud with some serious hardware flaws that didn't show up until a couple of months after I'd bought it.

I've since purhcased another laptop so I'm not going to be able to maintain this GIST.

I'll leave it here for now in case others want to contribute updates, or clone it. If you feel it's out of date or misleading or a waste of time, let me know in the comments and I'll remove it.

@rob-hills
rob-hills / ubuntu-22.04-mbp-a1707.md
Last active May 10, 2024 09:30
Ubuntu 22.04 on MacBook Pro 2017 (A1707, MBP 14,3)

Summary

Random set of notes and links that have helped me in the saga to get Ubuntu 22.04 up and running on my 2017 MacBook Pro These notes are mainly for myself in the event that I have to do this again some day. But if you find them helpful, that's great.

Important update

Unfortunately the MacBookPro that I bought second hand turned out to be a dud with some serious hardware flaws that didn't show up until a couple of months after I'd bought it.

I've since purhcased another laptop so I'm not going to be able to maintain this GIST.

I'll leave it here for now in case others want to contribute updates, or clone it. If you feel it's out of date or misleading or a waste of time, let me know in the comments and I'll remove it.

@TrevTV
TrevTV / ArcOn10.md
Last active May 10, 2024 09:29
Guide to installing Arc Browser on Windows 10

As this is not an official way of installing Arc, if you encounter any issues do NOT report them to the developers, they did not intend for people to be running Arc on Windows 10.

This guide is a bit more manual since I wanted to respect the developers' wishes and not directly link any downloads to the beta of Arc.

I don't know how this will work with updates, you may just need to redo the process to update it, but I'm not sure

  1. Install this font: https://aka.ms/SegoeFluentIcons (this fixes the icons since Windows 10 doesn't have this font installed by default)
  2. Download the Arc appinstaller and open it in notepad/some other text editor
  3. Copy everything inside and paste it into this website: https://codebeautify.org/xmlviewer (this is optional, but it makes reading and copying from the file easier)
  4. Find the mainpackage @Uri, it should end in Arc.x64.msix, and open that in a new tab. It should download that msix file.