Skip to content

Instantly share code, notes, and snippets.

View supersonictw's full-sized avatar
🦋

不知火 Shiranui supersonictw

🦋
View GitHub Profile
@supersonictw
supersonictw / .bashrc
Created May 2, 2024 03:19
Default .bashrc from Debian 12
# ~/.bashrc: executed by bash(1) for non-login shells.
# see /usr/share/doc/bash/examples/startup-files (in the package bash-doc)
# for examples
# If not running interactively, don't do anything
case $- in
*i*) ;;
*) return;;
esac
import torch
from torch import nn
from sklearn.metrics import r2_score
#torch.set_default_device("mps")
class MyMachine(nn.Module):
def __init__(self):
super().__init__()
@supersonictw
supersonictw / ollama-export.sh
Last active April 30, 2024 07:07
Ollama Model Export Script
#!/bin/bash
# Ollama Model Export Script
# Usage: bash ollama-export.sh vicuna:7b
# License: MIT (https://ncurl.xyz/s/RD0Yl5fSg)
# https://gist.github.com/supersonictw/f6cf5e599377132fe5e180b3d495c553
set -e
echo "Ollama Model Export Script"
echo "License: MIT (https://ncurl.xyz/s/RD0Yl5fSg)"
MIT License
Copyright (c) 2024 SuperSonic (https://github.com/supersonictw)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
@supersonictw
supersonictw / ISO-639-1-language.json
Created March 23, 2024 05:09 — forked from jrnk/ISO-639-1-language.json
ISO 639-1 Alpha-2 codes of languages JSON
[
{ "code": "aa", "name": "Afar" },
{ "code": "ab", "name": "Abkhazian" },
{ "code": "ae", "name": "Avestan" },
{ "code": "af", "name": "Afrikaans" },
{ "code": "ak", "name": "Akan" },
{ "code": "am", "name": "Amharic" },
{ "code": "an", "name": "Aragonese" },
{ "code": "ar", "name": "Arabic" },
{ "code": "as", "name": "Assamese" },
@supersonictw
supersonictw / timezone.json
Created March 23, 2024 03:18 — forked from EmadAdly/timezone.json
Common timezone list in json
[
{
"zone": "Pacific/Midway",
"gmt": "(GMT-11:00)",
"name": "Midway Island"
},
{
"zone": "US/Samoa",
"gmt": "(GMT-11:00)",
"name": "Samoa"
#!/bin/sh
cat /dev/urandom | head -n 1 | sha256sum - | cut -d ' ' -f 1
#!/bin/sh
# docker-local
# License: MIT (https://ncurl.xyz/s/RD0Yl5fSg)
# https://gist.github.com/supersonictw/1dc1cc0d74f4578827577a5f30cb7b47
# Usage:
# docker-local login example.org
# docker-local pull example.org/the_app:latest
set -e
@supersonictw
supersonictw / flush_dns.sh
Created October 23, 2023 02:32
Flush Cloudlflare DNS records
#!/bin/bash
# Flush Cloudlflare DNS records
CF_TOKEN=""
ZONE_ID=""
QUERY_RECORDS() {
curl -s -X GET https://api.cloudflare.com/client/v4/zones/${ZONE_ID}/dns_records?per_page=500 \
-H "Authorization: Bearer ${CF_TOKEN}" \
-H "Content-Type: application/json"
[Install]
WantedBy=multi-user.target
[Unit]
Description=dynamic-http-tunnel
Wants=network-online.target
After=network-online.target
[Service]
Type=simple