What is Hackers' Pub?

Hackers' Pub is a place for software engineers to share their knowledge and experience with each other. It's also an ActivityPub-enabled social network, so you can follow your favorite hackers in the fediverse and get their latest posts in your feed.

0
0
1
1
2
0
1
0
0
0

僕の使っているコマンドラインツールの 12月5日分はrsyncです。コピー元のディレクトリとコピー先のディレクトリを指定すると更新のある分だけコピーしてくれる便利なコマンドで、僕はおもに家サーバでの日ごとのバックアップに利用しています。リモートへのコピーにも利用できます。

rsyncでのコピー元やコピー先の指定は、最後の / の有無で動作が変わります。注意。

下記は家サーバ(まだcronが動いてる)の/etc/cron.daily/backup-localスクリプトの一部です(このままでは走らないかも)。システム側のディレクトリに含まれるファイルのうち失くしたくないものを/home/backup以下にコピーして、/home全体を/backup以下にコピーしています。

extraopt=
dst=/home/backup
for dir in /etc /usr/local /var/spool/cron; do
dstdir=$dst/$dir
mkdir -p $dstdir
chmod og-rwx $dstdir
rsync -a --delete $extraopt $dir/ $dstdir
done
rsync -a --delete $extraopt /home/ /backup

この後、/backup1に外付けのハードディスクがマウントしてあればそこにコピーして、

if mount | grep -q /backup1 ; then
mkdir -p /backup1/Backup/home
rsync -a --delete $extraopt /home/ /backup1/Backup/home

さらに/bacup2に外付けのハードディスクがマウントしてあれば読み書き可能にリマウントしてBackupとArchive以下をコピーします

if mount | grep -q /backup2 ; then
mount -o remount,rw /backup2 && rsync -a $extraopt /backup1/ /backup2
mount -o remount,ro /backup2
fi

extraopt='-v --dry-run'などとすると試験走行できます。

僕の使っているコマンドラインツールの 12月6日分はscreenです。端末が止まっても止まらない端末のやつ。ナウなヤングはscreenではなくByobuやtmuxを利用するらしいです。

何日かコマンドを走らせ続けておきたい時や、端末での作業内容を同僚(いたんだ)やリモートの自分などと共有したい時に使います。

$ screen

デフォルトではC-aがscreenを操作するためのホットキーとなりますが、僕は行頭に移動するC-aを多用するので、~/.screenrcでC-]に設定しています。続く2行では最初の画面とビジュアルベルを無効にしています。

escape ^]^]
startup_message off
vbell off

screenをデタッチする時は、C-]のあとdをタイプします。screen -list でデタッチされたまま稼動を続けているscreenのリストが表示されるので、

$ screen -x 12345.pts-0.localhost

などとしてアタッチしなおすことができます。デタッチされたscreenがひとつだけの場合はアタッチするscreenを指定する必要はありません。

screen内でシェルを終了させるとscreenも終了します。

0
0
1
0
0

Ugh just had to switch Intelligent Octopus off..

I just came back from a long trip down to 10% and plugged in as I normally would. Octopus selected a 10 hour charge - 4 hours at peak rate with no option to reduce it. Nice little earner for them.. Luckily I saw the news on social media.. many customers wouldn't.

So I've had to switch it off and set manual schedules overnight as I just can't trust it, or indeed even begin to calculate what it cost me if I let Octopus control it.

0
0
1
1
1

なにかボタンを押してしまったらしくSafewayのセルフレジが突然スペイン語を話しだしてびっくりだよ。だいたいボタンの位置を覚えてたっぽくてそのまま決済まで進めましたw

0
0
0

The haunting melody of the ferry MV Puyallup, recorded at midnight last night as the chill air of Puget Sound blasted the railings. I met a crewman who shared my fascination with the sound... He described how small holes drilled to add clamps to the railings caught the air like flutes. The long pipes of the railings act as resonators, reverberating through the windward hull.
en.wikipedia.org/wiki/MV_Puyal

0
1
1
0
0
0
0
0
0
0
0
0

I love the whole "they made pixel art with the CRT blending effect in mind!" argument, completely sidestepping the fact that a bunch of the same pixel art techniques used for consoles were also used on PCs with monitors that very much did not have a fuzzifying CRT effect to benefit from

And given how many games back then drew circles assuming square pixels which then turned into ovals, I think the amount of thought that went into period pixel art is greatly overestimated

0
0
2
0

i love how so many maths problems are like

"how many polygons can you draw, without lifting your pen, on the surface of a sphere?": trivial, proven by hand
"...of any 3-dimensional shape?" trivial, proven by hand
"...of any 4-dimensional shape?" trivial, proven by hand
"...of any 5-dimensional shape?" extremely complex, proven by computer search using a novel method in 2011
"...of any 6-dimensional shape?" moderately complex, proven by computer search in 1996
"...of any 7-dimensional shape?" unproven and likely beyond the limits of present day mathematics. it is trivially provable by hand that you can draw any triangle, however

0
1
0
1
1
0
0
0
0
1

Hacky and absolute unsupported way to run 32-bit programs under wine-devel on 15: Use the binaries from FreeBSD 14.

1. Install compat14x-amd64.
2. Use the following pkg32.sh script instead of the one installed by wine-devel.

```
#!/bin/sh -e

if [ "$(id -u)" = 0 ]; then
echo "Don't run this script as root!"
exit 1
fi

I386_ROOT="${WINE_i386_ROOT:-$HOME/.i386-wine-pkg}"
ABI="FreeBSD:14:i386"
OSVERSION="1403000"

if [ ! -d "$I386_ROOT/usr/share/keys/pkg" ]; then
mkdir -p "$I386_ROOT/usr/share/keys"
ln -s /usr/share/keys/pkg "$I386_ROOT/usr/share/keys/pkg"
fi

# Show what we're going to do, then do it.
echo pkg -o ABI=$ABI -o OSVERSION=$OSVERSION -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@"
exec pkg -o ABI=$ABI -o OSVERSION=$OSVERSION -o INSTALL_AS_USER=true -o RUN_SCRIPTS=false --rootdir "$I386_ROOT" "$@"
```

0
1
1

"Pacifists Are Not Silly Geese"

The idea of just war is questionable.

People on both sides of a war nearly always have reasons for thinking they are fighting a defensive war. Given that, a pacifist norm is better than a norm of supporting wars one believes to be defensive. Moreover, the overall social impact of an individual's decision to support war is almost always negative.

My first Medium article. No paywall.

medium.com/@mildlyunreasonable

0

What I'm listening to today: "Ha", Juvenile

This one's a classic of Dirty South hip-hop, a truly foundational work. If you feel this you will Feel it and I won't need to explain it to you. If you don't feel it, try to think of this as a *historical document*. Here is a narration of being a drug dealer in the late 90s (what is a "triple beam", and what is it for?) and a video which is basically a documentary time capsule of pre-Katrina New Orleans. Entirely unreplicable.

youtube.com/watch?v=Ww9VlmXKYgs

@mcc I feel old, the vid is super cool, but the delivery is too "modern" for me. I prefer this (also references triple beams): youtube.com/watch?v=jhG8xoFqYz8

Fun fact: Triple beams are called "tanitas" in Spain because of the dominance of a single brand in the 90's: tanita.eu/consumer-scales

Now THAT is old school!

0