ctr1

@ctr1@fl0w.cc
0 Post – 41 Comments
Joined 1 years ago

Yes! Awk is great, I use it all the time for text processing problems that are beyond the scope of normal filters but aren't worth writing a whole program for. It's pretty versatile, and you can split expressions up and chain them together when they get too complicated. Try piping the output into sh sometime. It can be messy though and my awk programs tend to be write-only

As a Vim/NeoVim user my number one reason is speed. There's a pretty steep learning curve, but it doesn't take long to see noticeable improvements.

Aside from terminal applications generally running faster than GUI ones, there is a tremendous amount of flexibility that it offers when it comes to actual text editing. For example, you learn how to type things like _f(vi(cfoo _f(ci(foo^†^ which goes to the beginning of the line, finds the first open parens, selects everything inside of the parens expression, then replaces that text with "foo". After a while these kinds of inputs become second nature, and you can start using them to construct macros on the fly that can be applied to different places in your code.

One major downside is that it can take some configuration to get working the way you want it, especially if you want an IDE-like environment. NeoVim comes with a built-in LSP interface, which I've been able to get working pretty well for all of the languages that I use the most, but it's still kind of a pain to configure.

I'm sure Emacs is similar, but I've never used it. I don't think many people use Nano unless they need to edit something in a terminal but don't know how to use Vim. On that note, being comfortable with a terminal editor means that you'll have no problem if you're SSH-ing into a server or using the TTY console.

^†^ _f(ci(foo avoids an unnecessary mode change, see comment below

1 more...

mpd + ncmpcpp

I usually use Awk to do the heavy lifting within my Bash scripts (e.g. arg parsing, filtering, stream transformation), or I'll embed a Node.JS script for anything more advanced. In some cases, I'll use eval to process generated bash syntax, or I'll pipe into sh (which can be a good way to set up multiprocessing). I've also wanted to try zx, but I generally just stick to inlining since it saves a dependency.

Maybe try programming? It's incredibly exciting once you get the hang of it. It can be frustrating at times but it's really rewarding. Since becoming my hobby/job its given me an endless source of things to do at home. Plus it can open up new career paths :)

Great list. Customizing the font is definitely a priority. I recommend one of the Terminus fonts. Also zellij multiplexer + helix editor is a great combo that works well in the tty.

One thing to add is that it took me a while to create a decent 16-color theme for helix and vim, and while they're okay by default you can actually get a pretty nice looking IDE if you spend some time tinkering with the colors

2 more...

For vegetables I throw everything into a big stew with a lot of different things (kale, broccoli, cauliflower, onion, potato, mushrooms, tofu, garlic, beans), lots of hot sauce, seasoning, olive oil, etc. and eat the same thing every day, for the most part. I don't eat enough fruit but I do have a handful of dried fruit with oats every day

It's great for anything low bandwidth that isn't tied to your identity, and helps for peace of mind, despite its issues. You do run into captcha or DDOS protection issues occasionally, but the new tor circuit for this site button sometimes works. Also it uses letterboxing to prevent resolution-based fingerprinting, which isn't very pretty, but leaving it at its default size (or locking the size using the WM) works well and is good for privacy.

Had the same issue with Plasma Wayland in QEMU but I never found a solution. Toggling anti-aliasing sometimes helped, temporarily

I learned by watching a bunch of cppcon videos, reading cppreference, and writing a lot of programs. Learning how to understand the error messages is also really important

Personally, I've relied on an OnlyKey for a few years (with backups and an extra fallback device) and haven't needed to type passwords since. This doesn't help with the number of prompts, but it does make them easier to dismiss.

I do use autologin, but I don't use a system wallet (only KeePassXC, which I do need to unlock manually). Autologin with system wallets can be tricky, but I've had some luck setting it up in the past. You might want to check out this wiki for PAM configuration.

8 more...

If you're willing to spend the time to learn how to write custom policies, SELinux can be used for this, to some extent. It's highly customizable and can sandbox your apps, but the process of doing so is quite complicated. I wrote a small guide on custom policy management on Gentoo in another comment if you're interested.

There's also apparently a "sandbox" feature, but I don't know much about it. I just write my own policies and make them as strict as possible.

As an example, my web browser can't access my home directory or anything except its own directories, and nobody (including my own user), except root and a few select processes (gpg, gpg-agent, git, pass) can access my gnupg directory.

This only covers security/permissions, and doesn't include many of the other benefits of containerization or isolation. You could also try KVM with libvirt and Gentoo VMs; that works pretty well (despite update times) and I did that for a while with some success.

I use fzf with a popup terminal:

# example for i3
bindsym $mod+Return exec --no-startup-id kitty -T _menu_ -e bash -c 'ls $HOME/.local/bin/ | fzf | xargs -r -I{} i3-msg -t command exec $HOME/.local/bin/{}'
for_window [title="_menu_"] floating enable
for_window [title="_menu_"] resize set 600 800

I like this approach because it's simple and configurable. I prefer to see only the symlinks/scripts that I put in my local bin folder, but it can easily be extended to support .desktop files, multiple folders, filtering, etc.

1 more...

The difference is that your ISP doesn't know where your packets are headed, and the destination doesn't know where your packets came from. The ISP sees you connect to the entrance node and the destination sees you connect from the exit node, and it's very difficult for anyone to trace the connection back to you (unless they own both the entrance and exit and use traffic coorelation or some other exploit/fingerprint). Regardless, both parties are generally able to tell that you are using TOR if they reference lists of known entrance/exit nodes. Also the anti-fingerprinting measures taken by TB are a bit more strict than other privacy-focused browsers

2 more...

I'm sure there's a better solution, but SELinux is an option. It can be difficult to customize, but it's capable of locking down the system entirely. You could theoretically block all actions taken by the user except for a select few mozilla_t actions and others necessary for login.

1 more...

fl0w.cc- single user; the domain is meant to be part of my username :)

I started by writing small scripts to automate things, but really got into it after learning how fun it can be to make the computer do stuff. I also see it as a kind of creative outlet, but in general I just want to learn how to fix anything in software if I'm not satisfied with how it works.

I stopped using recommendations years ago and only use NewPipe and Invidious. I did notice a reduction in my watch time, but there is plenty to watch when using a subscription-only feed. I havent added very many channels to my list since then, but personalized recommendations aren't worth the privacy cost. Hoping to leave the platform eventually

1 more...

Yes! Depending on how much time you want to spend figuring things out... there is a learning curve, but the documentation is quite extensive. And you do learn a lot about Linux by diving in. The compile times aren't really an issue today if you have decent hardware- I run it at home and on all of my servers (some of them not very powerful). You can do other things while it's compiling.

It's great if you want to customize everything and learn how your system works, or are interested in optimizing everything for your specific CPU architecture. There are a few pitfalls (especially when learning), but I've generally been able to learn how to fix any issues as they arise.

Also, the package availability is great. If you can't find something in the gentoo repository or in an overlay, you can usually find its dependencies and build it yourself.

Thanks! This works pretty well for now, until a more integrated solution comes along. I made a slight modification, since the original script only works when you're at the community level. This version redirects community URLs as before, but also redirects any non-matching URLs to the search form of your home instance. It seems to work pretty well for posts. Comments and user profiles have some issues- searching comments works as long as the user is commenting on their own instance, and searching profiles works as long as the user is registered with that instance.

Edit: It actually does seem to work well for comments; I was using the B/W chain link icon rather than the multicolored fedilink icon. Also, I added another regex to fix profiles, so this should now work with anything that is searchable from your instance.

javascript:((inst = "lemmy.world") => { const l = location; const m = l.href.match(/(?:.*)\/c\/(.*(?=\/)|.*$)/i); if (m) { l.href = `https://${inst}/c/${m[1]}@${l.host.toString()}`; } else if (l.host !== inst) { const m = l.href.match(/(?:.*)\/u\/([^@]*(?=\/)|[^@]*$)/i); if (m) { l.href = `https://${inst}/u/${m[1]}@${l.host.toString()}`; } else { const q = new URLSearchParams(); const m = l.href.match(/(?:.*)\/u\/([^@]+)@(.+(?=\/)|.+$)/i); if (m) { q.append('q', `https://${m[2]}/u/${m[1]}`); } else { q.append('q', l.href); } l.href = `https://${inst}/search?${q.toString()}`; } } })()

If you want to mess around with scripting instead of an editor I would recommend Awk- it works great for CSV files and is really powerful. Usually you can use -F, to separate using commas, but for full CSV support (with potential quoted commas) you need to use something like -vFPAT='[^,]*|"[^"]*"' (which isn't POSIX compliant but works with gawk)

Also a fan of sway! Plenty configurable, and swaymsg+jq bash scripts can go a long way. Hoping we'll see more development in lightweight DEs as well- Wayland is pretty great, and sway could use with some more features. also nice username :D

Genkernel is a good alternative generator, but you can also write your own initramfs and build it into the kernel. A custom initramfs (see also) is pretty flexible- I've had success setting up cryptsetup, lvm, and dropbear sshd by reading the various wiki examples. Not sure about your Intel issue though

Major bugs usually get fixed pretty quickly- I always check the GitHub to make sure I have the latest version when I have issues. And Invidious can work as an alternative most of the time, but some instances work better than others

Haha yeah, nicely put. I do enjoy the content, mostly because I've been following these creators for some time, and it's hard to find a replacement for it... there is a lot of great content there, but it makes me feel gross using it. And same, I had no problem finding an alternative for Reddit (this), probably because I was not very attached to individual creators there.

I'm hoping a decentralized solution gains traction, but in the meantime I've been trying to limit the amount of information I share with the platform. I'm not actively trying to restrict my usage (most of that was achieved when I stopped using an account), but maybe it's a good idea to do so. I mostly use it when eating or going to sleep, and there are better ways to occupy that time.

Ah true! Thanks, yeah that's a better way to do that. It seems I've developed a bad habit of going into visual more often than I need to- will keep an eye out for that

I suppose the most tangible benefit I get out of it is embedding a custom initramfs into the kernel and using it as an EFI stub. And I usually disable module loading and compile in everything I need, which feels cleaner. Also I make sure to tune the settings for my CPU and GPU, enable various virtualization options, and force SELinux to always remain active, among other things.

Ah nice! Thanks for the suggestion. Yeah --preview is a great feature that is good to remember.

And true, it's better to use find -executable than ls. Although in my case I would use -type f -o -type l since I want to include symlinks (often I will cd into my local bin folder and ln -s $(which ) to add it to my launcher). I'm using ls since I only put executables in there and using relative file paths so that it's nicer to look at. But cd or sed would work as well

Yeah the xargs + i3-msg part is a bit clunky but I'm not sure what else to do, since the terminal window needs to close immediately, which prevents the application from running. I tried a few variations with nohup and launching in the background, but haven't found another solution. But I'm sure there's a way

I alternate between helix and vim depending on the task, and their key bindings are kind of opposite from each other in a lot of ways. I've found that switching back and forth has kept me on my toes a bit and I don't feel as locked in to one editor as I did with vim before trying helix.

So I’m now stuck with my customized neovim, devoid of any hope of abandoning this strange addiction.

I would also try getting used to the defaults or a minimal config, which is also a good way to feel at home in the editor regardless of the system

Yeah for me it's been great and I do essentially leave it plugged in the whole time I'm using my PC (attached to my keys). It does require a pin entered each boot, so leaving it in would still offer security. But as someone else mentioned getting kwallet PAM working would make things easier in any case

No problem! And yeah, it's good to see people talking about it over here. I think it's the best tool for online privacy OOTB (depending on your threat model), and it gets better the more people use it.

An extension would be cool! I'm currently trying to do something similar, in some sense; I've patched my instance to filter out DB results from public queries so that only my posts and comments are visible (unless I am logged in).

The only thing I’m not sure about yet is if it’s possible - if I create a Post on an instance that’s not my home, who is hosting the data? Do I only send ActivityPub Create Post with the data and the instance then saves it, or do I create the post on my own instance, send an ID, and if someone requests the Post data on the instance I posted to, it will be requested from mine?

I believe it might be possible, but I'm not sure. It seems that the protocol itself is mostly geared for synchronizing data and distributing updates. From my limited understanding, servers follow users or communities on other servers, which inform those servers that updates should be sent to the requesting inbox. These updates are then used to build up a local copy of the remote page. In the case of a remote community, users interact with their local copy and notify the remote community of those changes.

For example, I am viewing a local copy of this post that I received from lemmy.ml, and my reply to your comment will be stored locally. My server will notify lemmy.ml of this comment (including its contents), and lemmy.ml will notify my inbox if anyone interacts with it (because I am a follower).

It seems that at least some of this syncing might not be necessary... a lightweight frontend could rely on the API of each site it connects with to build up the activities it sends. However, this would probably cause some unnecessary traffic, as such a follower would both receive updates and query the API. Also it would probably break some things, such as ap_id (see the multicolored fedilink icon, which points the original copy of the content on my instance).

Lol. I press a button on the device (which I unlocked with a pin before boot), but it would be nice to have the DB unlock automatically

Looks great! The background texture is really nice

Encourages hardware-based optimization and kernel specialization

I'm not using an immutable distro, but I am daily driving a KVM-based Gentoo setup where most of my VMs use transient (immutable) storage and iSCSI where persistence is required.

I'd say that immutability has a ton of benefits for security and reliability, but it's important to be able to customize things when needed. I'm not sure an immutable distro would offer much in the way of customization though.

In my case I am generally unable to harm my system without meaning to, and I'm able to test new configurations without issue. I have lost data before when accidentally saving to a transient disk, but this is something I could fix with better scripting.

I'd say that in general, incremental backups are a better solution if you're only looking to avoid messing up the system. But immutability is a good option if you like containers or have some other way to configure things before locking them down.

Haha. Yeah it takes time to learn how to do even the most basic things with it. Just how I would approach the situation

👋 right on! I actually also have used containers as a key to my security layout before, but yeah you miss out on all the benefits of portage.

I was doing something crazy and actually running Gentoo inside each one! It was very difficult to stay up-to-date. But I basically had my host as barebones as possible and used LibVirt containers for everything, attempting to make a few templates that I could keep updated and base other VMs on. I was able to keep this up for about two years then I had to relax (was my main PC). But it was really secure, and it does work.

The benefit of encapsulation is that you have a lot of freedom inside each container, like install a different distro if you need to. Also as long as they are isolated you don't need to worry as much about their individual security. But it's still good to. I ran SELinux on the host and non-SELinux (but hardened) in the guests.

SELinux has a lot of advantages over users/groups, but I think the latter can be just as secure if you know what you're doing. For example with SELinux you can prevent certain applications from accessing the network, or restrict access to certain ports, etc. It's also useful for desktop environments where a lot of GUI apps run under one user- e.g. neither my main user nor any other program can access my keepassxc directory, only the keepassxc process (and root) can (even though the application is running under my main user). You can also restrict root quite a bit, especially if you compile in the option to prevent disabling SELinux at boot (I need to recompile my kernel to disable it).

But again while it is fun to learn, it is quite a pain and I've relaxed the setup on my new computer to use a different user for everything (including gui apps), which I think is secure enough for me. But this style relies on my ability to adhere to it, whereas with SELinux you can set it up to where you're forced to

I use Terminus (ter-112n) for TTY, Source Code Pro for terminal emulators, and DejaVu, Liberation, and Noto for others

Like others have mentioned, SELinux could be a great addition. It can be a massive pain, but it's really effective at locking things down (if configured properly).

However, the difficulty will depend on the distro. I use it with Gentoo, which has plenty of support/docs for it and provides policies for many packages. Although (when running strict policy types) I usually end up needing to adjust them or write my own.

Obviously Red Hat would be another good choice, but I haven't tried it. Fedora also has good support, but I've only ever used the OOTB targeted policies.

That said, I've started relying on users/groups more often lately, since it really gets in the way of everything.

1 more...