Skip to content

Instantly share code, notes, and snippets.

@zaius
zaius / background.sh
Created January 16, 2011 23:29
How to redirect a running process output to a file and log out
ctrl-z
bg
touch /tmp/stdout
touch /tmp/stderr
gdb -p $!
# In GDB
p dup2(open("/tmp/stdout", 1), 1)
p dup2(open("/tmp/stderr", 1), 2)
javascript:(function%20()%20{var%20selection%20=%20window.getSelection%20?%20window.getSelection()%20:document.getSelection%20?%20document.getSelection()%20:document.selection%20?%20document.selection.createRange().text%20:%20%27%27;if%20(selection)%20{selection%20=%20String(selection);}if%20(selection)%20{var%20match%20=%20selection.match(%27\/(.*)\/%27);var%20ipa;if%20(match%20&&%20match[1])%20{ipa%20=%20match[1];}if%20(!ipa)%20{ipa%20=%20prompt(%22Couldn%27t%20find%20any%20IPA.%20Type%20it%20in%20instead?%22);}if%20(ipa)%20{ipa%20=%20ipa.replace(/./g,%20function%20(c)%20{if%20(/%u0(...)/.test(escape(c)))%20{return%20escape(c).replace(/%u0(...)/g,%20%27&#x$1;%27);}%20else%20{return%20c;}});var%20request%20=%20{txt:%20%27<phoneme%20alphabet=%22ipa%22%20ph=%22%27+ipa+%27%22>%20</phoneme>%27,voice:%20%27crystal%27};var%20iframe%20=%20document.createElement(%27iframe%27);iframe.name%20=%20iframe.id%20=%20%22iframe%22+new%20Date().getTime();document.body.appendChild(iframe);var%20form%20=%20document.createElemen
@tomasdev
tomasdev / minecraft-emoji.md
Last active May 5, 2024 16:55
Minecraft allowed emojis

Minecraft allowed emojis

Ever wondered how to insert emoji in minecraft? Well turns out Minecraft supports only a subset of emoji (old one) but you can copy-paste these in it!

Screenshot of the emojis being rendered in Minecraft

These also look great on signs!

Minecraft sign with glowing effect showcasing arrows

@mountbatt
mountbatt / ZOE-Widget.js
Last active May 5, 2024 16:55
Scriptable iOS widget that displays the status of your Renault ZOE (or Megane, Dacia Spring) on your iPhone and iPad.
// Variables used by Scriptable.
// These must be at the very top of the file. Do not edit.
// icon-color: light-gray; icon-glyph: car;
// version 2024-04-19
// latest changes:
// new kameron api key
// added language strings so you can translate it by yourself!
// add your my-renault account data:
// let myRenaultUser = "user" // email
@jbrown123
jbrown123 / bookmarklet.md
Last active May 5, 2024 16:55
A simple bookmarklet to help clip a webpage to a google doc

Bookmarklet to clip webpages to google docs

Below is a simple bookmarklet (see https://en.wikipedia.org/wiki/Bookmarklet) to make it easier to capture the content of a webpage into a google doc. This is similar (but much simpler and less functionality) to Evernote Web Clipper (see https://evernote.com/webclipper/).

This bookmarklet will copy the URL and the title of the current page. Since most browsers forbid directly manipulating the clipboard contents, it makes a copy by creating a pop-up with all the data highlighted and asks the user to press control-c (the keyboard copy shortcut) and then enter. Once you press enter it will create a new google document for you in a new tab. You can simply press control-v (the keyboard paste shortcut) to put in the URL and title.

If you press escape or hit 'cancel' in the popup, nothing happens and you return to your original webpage.

If you happen to have some text selected on the current webpage, this will be appended to the end of the pasted block. However,

@mathix420
mathix420 / medium.user.js
Last active May 5, 2024 16:47
Bypass Medium Paywall - Working late 2023 - Greasy Fork, Violentmonkey, Tampermonkey - Click the RAW button to install
// ==UserScript==
// @name Medium Paywall Bypass
// @namespace Violentmonkey Scripts
// @run-at document-start
// @match *://*.medium.com/*
// @match *://medium.com/*
// @match *://*/*
// @grant none
// @version 2.3
// @inject-into content
@kabili207
kabili207 / Rclone systemd service.md
Last active May 5, 2024 16:47
Rclone systemd user service

rclone systemd service

Preparation

This service will use the same remote name you specified when using rclone config create. If you haven't done that yet, do so now.

Next, create the mountpoint for your remote. The service uses the location ~/mnt/<remote> by default.

mkdir ~/mnt/dropbox
@hkfuertes
hkfuertes / proxmox_alpine_lxc_ollama_igpu.md
Last active May 5, 2024 16:46
Alpine LXC Container with iGPU Ollama Server on Proxmox

How to setup an LXC container with AMD iGPU (Ryzen 7 5800H) passthrougth for Ollama in Proxmox

Proxmox

First we need to install the Alpine LXC, the easiest way is to use Proxmox Helper scripts: https://tteck.github.io/Proxmox/

bash -c "$(wget -qLO - https://github.com/tteck/Proxmox/raw/main/ct/alpine.sh)"

I would install in "advance" mode and be generous with the resources (8-16 cores, 16G ram, 128GB disk)

@padeoe
padeoe / README_hfd.md
Last active May 5, 2024 16:45
CLI-Tool for download Huggingface models and datasets with aria2/wget+git

🤗Huggingface Model Downloader

Considering the lack of multi-threaded download support in the official huggingface-cli, and the inadequate error handling in hf_transfer, this command-line tool smartly utilizes wget or aria2 for LFS files and git clone for the rest.

Features

  • ⏯️ Resume from breakpoint: You can re-run it or Ctrl+C anytime.
  • 🚀 Multi-threaded Download: Utilize multiple threads to speed up the download process.
  • 🚫 File Exclusion: Use --exclude or --include to skip or specify files, save time for models with duplicate formats (e.g., *.bin or *.safetensors).
  • 🔐 Auth Support: For gated models that require Huggingface login, use --hf_username and --hf_token to authenticate.
  • 🪞 Mirror Site Support: Set up with HF_ENDPOINT environment variable.
@vorozhba
vorozhba / Как удалить commit в Github.txt
Last active May 5, 2024 16:45
Как удалить commit в Github
1. Получаем хэш-код коммита, к которому хотим вернуться.
2. Заходим в папку репозитория и пишем в консоль:
$ git reset --hard a3775a5485af0af20375cedf46112db5f813322a
$ git push --force