Skip to content

Instantly share code, notes, and snippets.

View elderica's full-sized avatar
🚞
I'm enjoing with trains and computers.

elderica

🚞
I'm enjoing with trains and computers.
View GitHub Profile
@kazuho
kazuho / sshd-tcpd.socket
Last active July 3, 2024 14:29
sshd + tcp wrappers
# こいつは systemctl enable sshd-tcpd.socket する
[Unit]
Description=ssh
ConditionPathExists=!/etc/ssh/sshd_not_to_be_run
Conflicts=ssh.socket
[Socket]
ListenStream=22
Accept=yes
@sheepla
sheepla / Program.fs
Last active June 24, 2024 08:12
.NET Core F#でコマンドラインツールを作ろう
open System
open System.IO
open FSharp.SystemCommandLine
let listCommand: CommandLine.Command =
let handler (count: int) =
printfn "Running listCommand!"
printfn "count: %A" count
0
@elderica
elderica / download_bing_wallpapers.sh
Last active August 22, 2024 11:25
Download wallpapers from Bing. This script depends curl and jq.
#!/bin/sh
### Usage:
### $ env RESOLUTION=UHD NDAYSAGO=1 SAVETO=$HOME/Bing sh download_bing_wallpaper.sh
set -euo pipefail
RESOLUTION=${RESOLUTION:-1920x1080} # Possible values: 1920x1080, 1366x768, UHD
NDAYSAGO=${NDAYSAGO:-0}
@digikar99
digikar99 / lispy-numerical-computing-library-features.org
Last active August 19, 2024 02:35
A comparison and wish-list of features for a Common Lispy approach to a (better) Numpy

Features of a Common Lispy approach to (better) Numpy

Numpy is great, in fact it’s one of the things that pulls people to Python. But can it be better?

Common Lisp is great, in fact it’s one of the things that pulls people to Common Lisp. But can it be better? Indeed Python can’t be better than Common Lisp without it becoming another Lisp. The closest we have is Julia. And while it gets some things right, Julia lacks certain features that limit the goodness of a numerical computing library.

All combined, below I will highlight some of the features that I wish a numerical computing library or ecosystem had. I also want to request the readers for their own inputs about how things can be even better. The goal amidst this is solely to keep things numpy-like. I do not intend to - nor have the background to - make a DSL like April or Petalisp.

While I take some interest in performance and numerical computing, I have m

@elderica
elderica / lib.rs
Last active April 18, 2022 13:08
Union-Find in Rust
pub const NIL: usize = usize::MAX;
pub struct UnionFind {
pub parents: Vec<usize>,
pub ranks: Vec<usize>,
pub sizes: Vec<usize>,
pub mins: Vec<usize>,
}
impl UnionFind {
@greymd
greymd / sudo新一.md
Last active October 24, 2024 08:43
sudo新一

 オレは高校生シェル芸人 sudo 新一。幼馴染で同級生の more 利蘭と遊園地に遊びに行って、黒ずくめの男の怪しげな rm -rf / 現場を目撃した。端末をみるのに夢中になっていた俺は、背後から近づいてきたもう1人の --no-preserve-root オプションに気づかなかった。 俺はその男に毒薬を飲まされ、目が覚めたら・・・ OS のプリインストールから除かれてしまっていた!

sudo がまだ $PATH に残っていると奴らにバレたら、また命を狙われ、他のコマンドにも危害が及ぶ』

 上田博士の助言で正体を隠すことにした俺は、 which に名前を聞かれて、とっさに『gnuplot』と名乗り、奴らの情報をつかむために、父親がシェル芸人をやっている蘭の $HOME に転がり込んだ。ところが、このおっちゃん・・・とんだヘボシェル芸人で、見かねた俺はおっちゃんになりかわり、持ち前の権限昇格能力で、次々と難タスクを解決してきた。おかげで、おっちゃんは今や世間に名を知られた名エンジニア、俺はといえばシェル芸 bot のおもちゃに逆戻り。クラスメートの convertojichattextimg にお絵かきコマンドと誤解され少年ワンライナーお絵かき団を結成させられる始末。

 ではここで、博士が作ってくれたメカを紹介しよう。最初は時計型麻酔 kill 。ふたについた照準器にあわせてエンターを押せば、麻酔シグナルが飛び出し、プロセスを瞬時に sleep させることができる。 次に、蝶ネクタイ型 banner 。裏についているダイヤルを調整すれば、ありとあらゆる大きさのメッセージを標準出力できる。必殺のアイテムなら fork 力増強シューズ。電気と磁力で足を刺激し、 :(){ :|:&amp; };: でプロセステーブ

@TaKO8Ki
TaKO8Ki / cd.sh
Last active April 12, 2023 00:19
An alternative to `cd`
# requirements
# fd: https://github.com/sharkdp/fd
# fzf: https://github.com/junegunn/fzf
function cd() {
flag='-f'
if [ $# -eq 0 ]; then
builtin cd
elif [ $# -eq 1 ]; then
if [ $1 = "$flag" ]; then
dirs=$(fd --type d . $HOME | fzf)
@oofnikj
oofnikj / answerfile
Last active November 15, 2024 20:14
Install Docker on Termux
KEYMAPOPTS="us us"
HOSTNAMEOPTS="-n alpine"
INTERFACESOPTS="auto lo
iface lo inet loopback
auto eth0
iface eth0 inet dhcp
hostname alpine
"
TIMEZONEOPTS="-z UTC"
@onlurking
onlurking / programming-as-theory-building.md
Last active November 13, 2024 17:31
Programming as Theory Building - Peter Naur

Programming as Theory Building

Peter Naur

Peter Naur's classic 1985 essay "Programming as Theory Building" argues that a program is not its source code. A program is a shared mental construct (he uses the word theory) that lives in the minds of the people who work on it. If you lose the people, you lose the program. The code is merely a written representation of the program, and it's lossy, so you can't reconstruct

@tenpoku1000
tenpoku1000 / AC_2018-12-02_Intel-doc-links.md
Last active June 15, 2024 15:36
インテル関連ドキュメント・リンク集