=== ANCHOR POEM ===
═════════════════════════════════════════════════════──────────────────────────────
┌─────────────────────────┐
│ CW: programming-is-easy │
└─────────────────────────┘
Need to install a program from Github? Follow these simple steps:
step 1: make an empty text file
step 2: put this at the top: #!/bin/bash
step 3: put this on the next line: set -euo pipefail
step 4: mkdir -p the directory you want to install it to
step 5: rm -dr the directory you want to install it to
step 6: mkdir -p the directory you want to install it to
step 7: git clone the project
step 8: this is the hard part - go through each of the steps listed in the
readme and configure the installation to the needs of your system. Put them in
the bash script one-by-one.
step 9: save the file, it doesn't need an extension like .txt or .sh,
extensions are for windows noobs
step 10: chmod +x the file and then ./the file!
step 11: fix it when they change their installation instructions...
Need a run script? Easy! Write it as a function below your update script, then
echo the bottom half of the update script into a file named "run" that's
placed in the project directory.
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧══════════════════════════════════════════════─────────────────────────────┘
=== SIMILARITY RANKED ===
--- #1 fediverse/2097 ---
═════════════════════════════════════════════════════──────────────────────────────
If you're writing a bash script, you should never hard-code file locations.
Instead, put them in a variable at the top of your script, so they're easy to
find when people need to configure your script or move files around.
It's like a config file built INTO the script itself. Just change the
variables, they're at the top with comments.
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧══════════════════════════════════════════════─────────────────────────────┘
--- #2 fediverse/1940 ---
═════════════════════════════════════════════════════──────────────────────────────
@user-579
Yeah if there isn't a package in the package manager XBPS then I usually just
install it from source. Which is ALSO something you can automate with a quick
and easy script! Just put all the notes from the README on Github or whatever
into a file named "update" and put that one level above the project directory!
For any installed program my file hierarchy usually looks like:
program-name
- run (script)
- update (script)
- files (directory to clone into)
- configs (point the program here)
I find that this kind of organization makes it MUCH easier to keep my packages
configured and installed as I'd like. Using a package manager is hard because
they're all specific per distro, but using this distro-agnostic approach
always seems to work better 9/10 times I find.
And if another program needs a library that you manually installed, just
symlink where it's looking to point to where you're installed! Or vice versa I
guess.
I use DWM so I don't have a desktop like KDE or anything like that
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧══════════════════════════════════════════════─────────────────────────────┘
--- #3 fediverse/582 ---
═════════════════════════════════════════════──────────────────────────────────────
@user-431
I made an alias that overwrites cd so I don't have to do this. The important
line is line 27, you could probably accomplish something similar like this:
alias cd="cd ${1} && ls -v --color=auto"
I also set it up so I can change more than one directory up using ... or ....
or .....
also I have a few shortcut scripts, cdir and qcd. cdir creates a quick way to
drop a bookmark wherever I'd like, while qcd can make permanent bookmarks.
Also qcd makes it so whenever I open a new terminal it opens to the last
directory I was in, which is nice if you need a new terminal to do something
in the current folder and you don't want to have to walk alllllllll the way
back.
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧══════════════════════════════════════─────────────────────────────────────┘
--- #4 fediverse/1694 ---
════════════════════════════════════════════════════───────────────────────────────
would anyone be interested in a Bash+Lua script that takes your Mastodon
archive and turns it into a folder full of .txt files?
I also made a script that spits out a random one on your terminal, if you want
that
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧═════════════════════════════════════════════──────────────────────────────┘
--- #5 fediverse/2566 ---
══════════════════════════════════════════════════════─────────────────────────────
┌──────────────────────┐
│ CW: re: mh+, nix │
└──────────────────────┘
@user-1286
I totally agree! Every time I install new software I write an "update" and
"run" script so that I can easily use software that I haven't touched in a
while.
once I started doing that the usability of my system went way up. Unless they
change the installation requirements, grrrrrrr
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧═══════════════════════════════════════════════────────────────────────────┘
--- #6 fediverse/3907 ---
══════════════════════════════════════════════════════════─────────────────────────
kinda wanna make a linux distro that has all the capabilities of a GUI distro
and isn't so minimal (like screen recording, calculator, screenshot, wifi
manager, etc etc) but with i3 instead of a desktop.
they could literally just be symlinks (shortcuts) to scripts that are in your
/usr/bin or whatever directory
seriously it's not like there's THAT many ways to use ffmpeg, why not just
write a script for them? that's what you're going to do when you use it for
the first time, anyway, so...
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧═══════════════════════════════════════════════════────────────────────────┘
--- #7 messages/755 ---
═════════════════════════════════════════════════════════════════──────────────────
Code editor that moves boxes by saving over the file with a lua script every
time you moved a function call around.
Oh lemme start at the beginning:
A code editor program that's like a text editor like Vim or Emacs. If you
don't know what those are, you should probably learn Emacs. Or Vim. Up to you.
Oh right so if you do know what those mean, here's the idea: the white space
matters. It's counted and tracked into variables in a LUA script which
interface with the Vim C keybindings.
"run a function within a c program or LUA script which calls a bash command
which opens Vim for example with a file you want to edit. Then, inside the
file, your spaces and tabs would WYSIWYG for the various food ads placed
about, and then you could very easily create game design knowledge.
WASD to move, alternatively hjkl
It would run a check every time the file updates and depending on how it
changed it'd mark certain variables which would change the website as the user
moved things around.
It's just files. And files are just bits. But files are a useful abstraction,
If you realize that "ugly hacking" should be industry standard.
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧══════════════════════════════════════════════════════════─────────────────┘
--- #8 fediverse/3878 ---
══════════════════════════════════════════════════════════─────────────────────────
@user-570
that's not actually my script, here's the real one:#!/bin/bash
alias cd="cd-improved"
function cd-improved(){
if [ "${1}" = "..." ] ; then
builtin cd .. && builtin cd ..
elif [ "${1}" = "...." ] ; then
builtin cd .. && builtin cd .. && builtin cd ..
elif [ "${1}" = "....." ] ; then
builtin cd .. && builtin cd .. && builtin cd ..
&& builtin cd ..
elif [ -d "./${1}" ] ; then
local target_dir="./${1}"
elif [ "${1}" = "cdir" ] ; then
local target_dir="$(tail -n 1 '/home/ritz/scripts/.cdir-target')"
echo ${target_dir}
else
local target_dir="${1}"
fi
if [ ! "${2}" = '--no-ls' ] ; then
builtin cd "${target_dir}" && ls -v --color=auto
else
builtin cd "${target_dir}"
fi
}
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧═══════════════════════════════════════════════════────────────────────────┘
--- #9 fediverse/4772 ---
═══════════════════════════════════════════════════════════════────────────────────
@user-1692
I usually write everything down in a script that way when I call it from an
external service all I have to do is point at the file
sorta like... hacking environmental options into a config file
like... I don't write an ffmpeg command every time I want to record my screen.
I just type "screen-record" and then it'll do the thing that I figured out how
to do a long time ago.
... oh no there's an error, I wonder what changed out from under my feet.
huh it's wine, that one's always confusing to debug. Let's see... "could not
open program.exe" uh-huh. Well, why not? is there a dependency issue?
something miscompiled or configured? no? it's just... broken? you don't get to
use that program today? huh that's weird. that's linux for ya I guess.
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧════════════════════════════════════════════════════════───────────────────┘
--- #10 notes/comms-box ---
════════════════════════════════════════════════════════════───────────────────────
there is a requirement for a simple, easy to set-up, and easily replacable
system which can be used for comms.
Specifically running a variety of different services, such as fediverse
instances, matrix for text-comms, VoIP, and distributed computing using Chapel
or DistCC or other such capabilities. In addition, it should be able to run a
file-server and a web-server which hosts an HTML page for the user.
All of this functionality should be operational out-of-the-box, with minimal
configuration required. No more than adding a checkbox to a config file in
order
to activate each individual service.
This box should be cheap, and easy to provision. An image must be made, and
some bash scripts should be written to easily configure it.
In addition, there should be rudimentary programming capabilities included,
just
in-case a user is left with no other options. It should come pre-configured
with
SSH access out of the box, so it can be remotely controlled, and the languages
included should be:
C/C++
Python
Lua
Bash
Rust
Chapel
This should cover most surfaces in terms of programming capability
requirements.
In terms of hardware, it need be little more than a SoC such as a Raspberry Pi
or other such hardware. It needs at a minimum an ethernet port, and USB ports.
The box itself should cost no more than 40$, excluding provisioning and the
cost
to pay back whatever capital investments are necessary to create such a thing.
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧═════════════════════════════════════════════════════──────────────────────┘
--- #11 notes/todo ---
═════════──────────────────────────────────────────────────────────────────────────
1. write a proper todo script
2. finish installing the drivers for the printer
-> fix the "make" command, it seems to be borked
3. figure out how to install Overwatch
4. reinstall 351-elec
5. get another cord for the hard drive's power supplies so you can connect
the cmdo drive again
6. get a life
7. finish installing GNUstep (requires make I think)
7. ????
8. profit
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘════════─┴╧══─────────────────────────────────────────────────────────────────────────┘
--- #12 fediverse/6107 ---
═══════════════════════════════════════════════════════════════════════════────────
commanding a coding agent to write bash is a lot different than telling it to
write a systems analysize.
one is "hey can you examine this repository and make a note somewhere on a
todo-list or whatever that there needs to be a bugfix in relation to the
options setting input translation recommendation algorithm matchbox field
because when I click on it the program crashes"
and the other is like "okay now put the box over there. great now drag it a
little bit closer. okay now take the refluxinator and adjust the bamboozlewhap
to account of brass-terminatrix-incorporated and strip out the
question-mark-eyes"
wait actually neither of them is like that okay the bash one is like: "okay
yeah do it. sure. yeah okay. yes, but we should put them at this location:
[loc]. ummm it still has this error message. it still says the same error.
okay now it says this, I don't think it's gonna work so let's try this other
thing."
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧════════════════════════════════════════════════════════════════════───────┘
--- #13 fediverse/5765 ---
╔═══════════════════════════════════════════════════════════════════════───────────┐
║ Lua is the most fun language to write code in! The reason is because it's so │
║ simple, it distills programming down to it's basics, and there's very few │
║ surprises. Plus, you can use it like a bash script, meaning it's great for │
║ writing little utilities. │
║ │
║ why are we so attached to monolithic massive programs without shared memory? │
║ we could just write to the hard drive by file.io'ing a file and opening it │
║ later in a different program. What's the deal with databases, whatever │
║ happened to just loading things into a datastructure? │
║ │
║ oh, is your filesize too massive? what if we redundancied and abstracted and │
║ concentrically inter-co-acted and thus our familiar forces are defined. │
║ │
║ who are your true foes, in [checks notes] computer programming? um, probably │
║ complexity, probably logical incongruities, probably │
║ future-technical-debt-style incomprehensibilities, probably stuff that doesn't │
║ really have anything to do with the hardware but instead is mostly software. │
║ │
║ essentially, organization, but done on a whim. │
║ │
║ "but $?" │
╟─────────┐ ┌───────────┤
║ similar │ chronological │ different │
╚═════════╧════════════════════════════════════════════════════════════┴──────────┘
--- #14 fediverse/2947 ---
╔══════════════════════════════════════════════════════────────────────────────────┐
║ the downside of Proton and Lutris is now the ONLY games that work on Steam are │
║ either continually updated (untenable) or playable on Lutris or Proton. Same │
║ thing with Wine, though there's always at least one decent substitute. │
║ │
║ kinda makes me want to write a manager-style program which runs programs using │
║ whichever version of their git repository would work best for their system / │
║ configuration / purposes. Idk how I would start working on that though. │
║ │
║ I bet you could make one that acted like a shop, but where you didn't charge │
║ any dollars. You could like... "swipe" through UI options, and pick whichever │
║ felt most useful for your setup. Like, how some people use i3 and some use dwm │
║ │
║ with maybe inspectors that are modeled off of video-game style "options" GUIs │
║ that mainly correspond to flags on the command/terminal line or compilation │
║ flags │
║ │
║ I feel like that kind of abstraction would make it a lot easier for users to │
║ adjust their system. they're noobs, after all. gotta show them all the choices │
║ in one place... │
╟─────────┐ ┌───────────┤
║ similar │ chronological │ different │
╚═════════╧═══════════════════════════════════════════─────────────────┴──────────┘
--- #15 fediverse/3587 ---
════════════════════════════════════════════════════════───────────────────────────
┌─────────────────────────────┐
│ CW: re: computers-mentioned │
└─────────────────────────────┘
I realized that script was bugged, so... here's a better one. Plus a fun run
script too!#!/bin/bash
set -euo pipefail
DIR="/home/ritz/programming/chapel/language-files"
VER="2.1.0"
FIL="chapel-${VER}.tar.gz"
URL="https://github.com/chapel-lang/chapel/releases/download/${VER}/${FIL}"
NUM_THREADS="16"
touch ${DIR}/files
rm -dr ${DIR}/files
mkdir -p ${DIR}/files
wget --output-document ${DIR}/${FIL} ${URL}
tar xf ${FIL} --directory=${DIR}/files
rm ${FIL}
cd ${DIR}/files/chapel-${VER}
export CHPL_LLVM=system
source ${DIR}/files/chapel-${VER}/util/setchplenv.bash
make -j${NUM_THREADS}
echo "now testing, to validate LLVM configuration as suggested in the docs:"
chpl "./examples/hello3-datapar.chpl"
./hello3-datapar
echo "the chapel programming language is now fully installed! Have fun!"
cd -
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧═════════════════════════════════════════════════──────────────────────────┘
--- #16 fediverse/1238 ---
╔═══════════════════════════════════════════════───────────────────────────────────┐
║ did you know you can run runescape classic offline, locally, just for your own │
║ server? You can keep several computers ready for a LAN party, each with their │
║ own accounts ready to go. │
║ │
║ "Oh we're level 30 this time because so-and-so is hosting and this is how far │
║ their computer has levelled up." │
║ │
║ vim ~/games/runescape-classic/credentials.txt │
║ │
║ at least, I think you can. I know it's singleplayer, so worst case scenario │
║ you can all be doing the same things at the same time in your own games. Maybe │
║ split up for a mission or two, but it can get hectic if everyone's in the same │
║ room. │
║ │
║ = │
║ │
║ a game jam where everyone works on the same project, uses the same asset list, │
║ but builds their own collection of minigames. │
║ │
║ common functions could be shared, and art references distributed and together │
║ they could design a whole land. Like, there's no reason minigames can't be │
║ fully fledged experiences. You can have as many as you want, all in the same │
║ engine and built from a massive (yet sandboxed) environment. │
║ │
║ an all in one game. │
╟─────────┐ ┌───────────┤
║ similar │ chronological │ different │
╚═════════╧════════════════════════════════════────────────────────────┴──────────┘
--- #17 fediverse/2674 ---
══════════════════════════════════════════════════════─────────────────────────────
┌────────────────────────────────────────────────────────────────────┐
│ CW: factually-untrue,-that-never-happened.-this-is-just-gesturing. │
└────────────────────────────────────────────────────────────────────┘
the kind of friendship where you SSH into each other's systems and leave notes
for one another.
as soon as you find one you message the person who left it like "yoooo only
just found this lol" and they're like oooo yeah did you see the bash script I
wrote in that directory "yeah totally I used it on one of my video files just
now - cool filter!"
ahhhh reminds me of all the times hackers have hacked my permanently insecure
system and left me friendly messages like "hey I'm on your side" or "how's
life, friend? I hope it's going well." or "never forget; you are worth all the
fear" y'know cute things like that
oh. right. because leaving vulnerabilities like that can lead to threat actors
affecting your stuff. how lame.
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧═══════════════════════════════════════════════────────────────────────────┘
--- #18 fediverse/2638 ---
══════════════════════════════════════════════════════─────────────────────────────
I really do believe that you can write any computer program you'd like with a
combination of Lua, Bash, and C.
Bash to start the program and enable updates / configuration, Lua to handle
the scripting and ordering of events, and C (or Rust) to execute performance
intensive sections. (often in their own threads)
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧═══════════════════════════════════════════════────────────────────────────┘
--- #19 fediverse/3469 ---
════════════════════════════════════════════════════════───────────────────────────
you know how SSH password login is deprecated because the password needs to be
transmitted in cleartext or whatever?
what if we just... required two passwords?
the first initiates the conversation, and sets up an encrypted line. It
doesn't matter if anyone sees the first password because they'll get a new set
of encrypted keys, meaning each session automatically is encrypted in a
different, randomized way.
the second password is the one that actually authenticates you.
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘═════════╧╧═════════════════════════════════════════════════──────────────────────────┘
--- #20 notes/environment-variables ---
═══════────────────────────────────────────────────────────────────────────────────
To edit environment variables:
~/.bashrc is for variables only accessible by the user.
/etc/profile is for variables accessible by all users.
/etc/environment is for variables accessible by anyone.
┌─────────┐ ┌───────────┐
│ similar │ chronological │ different │
╘══════───┴╧───────────────────────────────────────────────────────────────────────────┘
|