A (more) complete cheatsheet for Arel, including NamedFunction functions, raw SQL and window functions.
posts = Arel::Table.new(:posts)
posts = Post.arel_table # ActiveRecord
#!/bin/sh | |
# | |
# sort a "du" listing by directory size | |
# usage: du | dusort | |
FILES= | |
TFORM=0 | |
while test $# -ge 1; do | |
case $1 in | |
-t) TFORM=1; ;; |
// To delete tweets, navigate to your Twitter/X profile, open your browser's JavaScript console, and paste the script below. | |
async function sleep(ms) { | |
return new Promise((resolve) => setTimeout(resolve, ms)) | |
} | |
async function deleteTweets() { | |
const tweetsRemaining = document.querySelectorAll('[role="heading"]+div')[1].textContent; | |
console.log('Remaining: ', tweetsRemaining); | |
window.scrollBy(0, 10000); |
// Go to https://www.reddit.com/user/<username>/ and paste into your console. | |
// Reddit throttles these actions, hence the 1s timer. | |
let interval = setInterval(() => { | |
let deleteButtons = $('a.togglebutton[data-event-action="delete"]'); | |
if (deleteButtons.length === 0) { | |
clearInterval(interval); | |
if ($('.next-button > a')[0]) { | |
$('.next-button > a')[0].click(); | |
alert('Restart script.'); | |
} |
Since 2008 or 2009 I work on Apple hardware and OS: back then I grew tired of Linux desktop (which is going to be MASSIVE NEXT YEAR, at least since 2001), and switched to something that Just Works. Six years later, it less and less Just Works, started turning into spyware and nagware, and doesn't need much less maintenance than Linux desktop — at least for my work, which is system administration and software development, probably it is better for the mythical End User person. Work needed to get software I need running is not less obscure than work I'd need to do on Linux or othe Unix-like system. I am finding myself turning away from GUI programs that I used to appreciate, and most of the time I use OSX to just run a terminal, Firefox, and Emacs. GUI that used to be nice and unintrusive, got annoying. Either I came full circle in the last 15 years of my computer usage, or the OSX experience degraded in last 5 years. Again, this is from a sysadmin/developer ki
The easiest way to "convert" MKV to MP4, is to copy the existing video and audio streams and place them into a new container. This avoids any encoding task and hence no quality will be lost, it is also a fairly quick process and requires very little CPU power. The main factor is disk read/write speed.
With ffmpeg
this can be achieved with -c copy
. Older examples may use -vcodec copy -acodec copy
which does the same thing.
These examples assume ffmpeg
is in your PATH
. If not just substitute with the full path to your ffmpeg binary.
this gist is part of this series
This assumes you are running Proxmox 8.2 and that the line source /etc/network/interfaces.d/*
is at the end of the interfaces file (this is automatically added to both new and upgraded installations of Proxmox 8.2).
This changes the previous file design thanks to @NRGNet for the suggestions to move thunderbolt settings to a file in /etc/network/interfaces.d it makes the system much more reliable in general, more maintainable esp for folks using IPv4 on the private cluster network (i still recommend the use of the IPv6 FC00 network you will see in these docs)
This will result in an IPv4 and IPv6 routable mesh network that can survive any one node failure or any one cable failure. Alls the steps in this section must be performed on each node
this gist is part of this series
This fixes issues i bugged with the thunderbolt / thunderbolt-net maintainers (i will take everyones thanks now, lol)
apt install lldpd
// Copyright (c) 2024 Neomantra BV | |
// | |
// Opinionated Reader/Writer wrappers | |
package nmio | |
import ( | |
"compress/gzip" | |
"io" | |
"os" |