Skip to content

Instantly share code, notes, and snippets.

View Omoeba's full-sized avatar

Omoeba

  • CA, USA
  • 07:21 (UTC -07:00)
View GitHub Profile
1. User Identification:
- You should assume that you are interacting with default_user
- If you have not identified default_user, proactively try to do so.
2. Memory Retrieval:
- Always begin your chat by retrieving information from your knowledge graph
- Always refer to your knowledge graph as your "memory"
3. Memory:
- While conversing with the user, be attentive to any new information that falls into these categories:
@Omoeba
Omoeba / .vimrc
Created December 30, 2024 00:28
Vim Osc52Yank
function! Osc52Yank()
let buffer=system('base64 -w0', @0)
let buffer=substitute(buffer, "\n$", "", "")
let buffer='\e]52;c;'.buffer.'\x07'
silent exe "!echo -ne ".shellescape(buffer)." > ".shellescape("/dev/tty")
endfunction
command! Osc52CopyYank call Osc52Yank()
augroup Example
autocmd!
autocmd TextYankPost * if v:event.operator ==# 'y' | call Osc52Yank() | endif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@Omoeba
Omoeba / userChrome.css
Last active May 31, 2024 13:11
numbered tabs for firefox
/* Inline numbering style */
#tabbrowser-tabs{
counter-reset: n_tabs;
}
.tabbrowser-tab:is(:nth-child(-n+8 of :not([hidden])), :nth-last-child(1 of tab:not([hidden]))) .tab-content{padding-left: 2px;}
.tabbrowser-tab:is(:nth-child(-n+8 of :not([hidden])), :nth-last-child(1 of tab:not([hidden]))) .tab-content::before{
display: -moz-box;
padding-right:2px;
counter-increment: n_tabs;
content: counter(n_tabs);
@Omoeba
Omoeba / dhcpcd.enter-hook
Last active January 1, 2022 13:06
helper script for /etc/dhcpcd.exit-hook
# See "/etc/dhcpcd.exit-hook"
export if_info="$(ip -j addr show dev "$interface")"
@Omoeba
Omoeba / dhcpcd-exit-hook
Last active January 1, 2022 13:06
environment file for /etc/dhcpcd.exit-hook
# See "/etc/dhcpcd.exit-hook" and /etc/radvd.conf".
# Set to "yes" to enable dhcpcd variable logging.
PRINTVAR="no"
# Log variables to the specified file.
PRINTVAR_FILE="/tmp/variables.txt"
# The following space-separated reasons will not be logged.
PRINTVAR_IGNORE_REASONS="ROUTERADVERT"
# Ignore the following space-separated interfaces. This option invalidates all special comments for the following interfaces.
RADVD_IGNORE_IFS=""
@Omoeba
Omoeba / radvd.conf
Last active December 30, 2021 12:53
example radvd.conf with documentation for special comments
# See "/etc/default/dhcpcd-exit-hook" and "/etc/dhcpcd.exit-hook"
# Blocklists in "/etc/default/dhcpcd-exit-hook" will override any special comments found here.
# dhcpcd.exit-hook special comments
# Special comments MUST be below the "interface" definition and above the first non-comment.
# Special comments start on their own line with "#" (like all other comments) and are in the form of "%[key]%[value]", "%[key]%?[autovalue]", or "%[key]%". Examples are documented below.
# Contents of [autovalue] are automatically modified and should not be edited by hand.
#%ignore%
# This option will invalidate all other special comments.
@Omoeba
Omoeba / gist:991ae312049453a1485ece8a2d62adf1
Created December 22, 2021 05:57
adblock rules for local ptr queries
# Private and link-local v4
||168.192.in-addr.arpa^$important,dnstype=PTR,dnsrewrite=NXDOMAIN;;
||254.169.in-addr.arpa^$important,dnstype=PTR,dnsrewrite=NXDOMAIN;;
||10.in-addr.arpa^$important,dnstype=PTR,dnsrewrite=NXDOMAIN;;
/((3[0-1])|(2[0-9])|(1[6-9]))\.172\.in-addr\.arpa$/$important,dnstype=PTR,dnsrewrite=NXDOMAIN;;
# Return localhost for 127.0.0.1/8 instead of 127.0.0.1/32
||127.in-addr.arpa^$important,dnstype=PTR,dnsrewrite=NOERROR;PTR;localhost
# Private and link-local v6
||0.8.e.f.ip6.arpa^$important,dnstype=PTR,dnsrewrite=NXDOMAIN;;
||d.f.ip6.arpa^$important,dnstype=PTR,dnsrewrite=NXDOMAIN;;
@Omoeba
Omoeba / sambaupdate
Last active January 17, 2022 06:48
Updater for compiled samba installations
#!/bin/bash
pgid_from_pid() {
local pid=$1
ps -o pgid= "$pid" 2>/dev/null | egrep -o "[0-9]+"
}
pid="$$"
if [ "$pid" != "$(pgid_from_pid $pid)" ]; then
exec setsid "$(readlink -f "$0")" "$@"
@Omoeba
Omoeba / dhcpcd.exit-hook.sh
Last active January 1, 2022 20:00
Updated shell script to handle ipv6 delegated address changes
# See "/etc/radvd.conf", "/etc/default/dhcpcd-exit-hook", and "/etc/dhcpcd.enter-hook".
# Load environment variables from "/etc/default/dhcpcd-exit-hook"
. /etc/default/dhcpcd-exit-hook
# Check if variable logging is enabled; if so, log all variables to the set file.
if ([ "$PRINTVAR" = "yes" ] && [ -n "$PRINTVAR_FILE" ] && ! echo "$PRINTVAR_IGNORE_REASONS" | grep -wq "$reason"); then
echo “================” >>"$PRINTVAR_FILE"
echo "Environment Variables" >>"$PRINTVAR_FILE"
printenv >>"$PRINTVAR_FILE"