• 0 Posts
  • 19 Comments
Joined 2 years ago
cake
Cake day: August 2nd, 2023

help-circle
  • I tried to buy an external 20TB drive from Amazon twice. First one that came, I bought refurbished; the drive had been shucked and replaced with a 146GB drive.

    Second one I bought was 20TB, but was clicking and grinding from the moment I turned it on. When I tried to initiate a return saying “drive is clicking and grinding, indicating that it’s failing,” their support bot helpful informed me that a clicking and grinding drive usually indicated drive failure.

    They did accept the return for the latter. They also accepted a return for the former, but it took literal months and several support interactions where the (seemingly real) agents actively lied to me.

    I’ve had okay luck with smaller Amazon drives in the past, but will have trouble recommending them for this kind of purchase in the future.








  • A decade and change ago, in a past life, I was tasked with switching SELinux to permissive mode on the majority of systems on our network (multiple hundreds, or we might have gotten above one thousand at that point, I don’t recall exactly). This was to be done using Puppet. A large number of the systems, including most of our servers, had already been manually switched to permissive but it wasn’t being enforced globally.

    Unfortunately, at that point I was pretty familiar with Puppet but had only worked with SELinux a very few times. I did not correctly understand the syntax of the config file or setenforce and set the mode to … Something incorrect. SELinux interpreted whatever that was as enforcing mode. I didn’t realize what I had done wrong until we started getting alerts from throughout the network. Then I just about had a panic attack when I couldn’t login to the systems and suddenly understood the problem.

    Fortunately, it’s necessary to reboot a system to switch SELinux from disabled to any other mode, so most customer facing systems were not impacted. Even more fortunately, this was done on a holiday, so very few customers were there to be inconvenienced by the servers becoming inaccessible. Even more fortunately, while I was unable to access the systems that were now in enforcing mode, the Puppet agent was apparently still running … So I reversed my change in the manifest and, within half an hour, things were back to normal (after some service restarts and such).

    When I finally did correctly make the change, I made sure to quintuple check the syntax and not rush through the testing process.

    edit: While I could have done without the assault on my blood pressure at the time, it was an effective demonstration of our lack of readiness for enforcing mode.



  • I think I’m a cloud engineer, so I can’t use the same reasoning as you; but when I started at my company, I was given the option of either a Linux laptop with root or a Mac laptop. Obviously I selected Linux, but about a year later they started retiring all Linux laptops. The reason for this, I was told, is because the IT department didn’t know how to manage Linux laptops but they were familiar with Jamf. They did let us keep root on them, though.

    I still miss using that laptop for work. The good news is, since they never implemented mandatory RTO policies, the company moved to a much smaller office. In doing so, they needed to reduce inventory, so they gave away the old laptops (sans drives) to their employees. I now own the same laptop (or a very similar one)!






  • Apologies in advance for the WOT. I will not be offended if you don’t read it, but I did try to include helpful information.

    So, for reference, though this command should work it’s not the correct way to exit vim (for several reasons). Also, if nano works for you, then there’s nothing wrong with using it. IMHO you lose a lot of the power of vim, but some of the beauty of linux is that customization is big part of it. One of the smartest and most linux-knowledgeable people I know uses nano and can outperform me in basically every linuxy way.

    Also, a caveat: I know some stuff, but I’m not an expert in anything, let alone neat stuff like this. The text below is accurate to the best of my knowledge, but may not represent the whole of the paradigm.

    Now, to answer your question: vim is what’s called modal. You have two primary modes: editing (amusing edit: this is also called “insert” mode) and command. editing mode is what it sounds like: When you’re editing a file. This mode is usually entered by pressing a button that starts the process of changing the file - stuff like i (for insert mode, which just starts adding text you type where your cursor is) or o (which starts adding text you type on the next line) or many others. This mode is exited by pressing Esc, which leaves you in command mode. In command mode, you can start with a :, which generally goes to a field (not the right word, but the one I’m using) at the bottom of the window/screen. This is the command. The command can be extremely complex and even chained. People who are more into vi(m) than I am call it a sentence, I believe, but I might be misinterpreting that. (You can also type things without a : but those will have different kind of impact.)

    So, to run the command I posted above, you would start by pressing Esc to make sure you were in command mode (if you already are it will just maintain command mode). Then you would type : to start the command (or possibly sentence). Then you would type the !, which tells vim that this command is to be run in the shell, rather than as a vim command. Then you would type pkill vim which is a command that would tell the shell to identify a process called vim and kill it. This would exit vim but is, again, not the correct way to do so.

    The usual way to exit vim correctly would be to press Esc to make sure you were in command mode, then type one of the following:

    • :wq (write and quit)
    • :q (quit without saving the file)
    • either of the above with a ! after it (e.g. :wq! or :q!) which tells it to ignore errors (:q will complain if you have made any unsaved changed but adding ! will ignore those complaints)
    • press ZZ (I’ve not used this myself, but I think it’s equivalent to :wq)

    One last aside: If you do decide to try to use vim, this is a useful resource: https://vimschool.netlify.app/introduction/vimtutor/

    edit: Very small formatting changes.

    edit 2: Just some random facts because vim is cool:

    • You can type :! with no other text to see the terminal from which you launched vim, then press enter to return to your active vim session, which can be useful if you’re trying to replicate text in an environment where you can’t copy and paste (and probably other circumstances)
    • Adding % before any command applies it to the whole file (rather than, for example, just one line) which can be useful if you’re trying to sort a file (and in other circumstances):
    %!sort
    

    (without the % it would just try to sort the current line, which likely wouldn’t be too useful since I believe it only goes by the first character of the line unless you present other arguments)