• Activity
  • Votes
  • Comments
  • New
  • All activity
  • Showing only topics with the tag "unix". Back to normal view
    1. Can you help me figure out why my VM is growing?

      I have an M1 MacBook Air. I use UTM to run a Debian 11 virtual machine. After the initial setup, updating and upgrading, installing Firefox and a few small programs, (I almost called them apps,...

      I have an M1 MacBook Air. I use UTM to run a Debian 11 virtual machine.

      After the initial setup, updating and upgrading, installing Firefox and a few small programs, (I almost called them apps, d'oh), the Debian.utm file size was about 6GB. Now, less than a month later, it's almost 9GB.

      The VM size increases after each use. I haven't downloaded or installed anything close to 3GB worth. I have downloaded files, then put them into the trash and emptied the trash, could the trash not be emptying properly?

      I have run ncdu, but nothing stands out. When I drill down into /usr and into each large folder, no sub folder is larger than a few 100MB. I can't see any big files lurking.

      I've googled using many search terms, but I can't get past results that are about how to increase the size of a VM that is running out of room.

      Thanks very much for reading this, any ideas?

      11 votes
    2. Share your personal dotfile treats and Unix tool recommendations

      I am currently preparing for a new job and cleaning up my dotfile repository. During the process, I had the idea that it would be nice to create a list of amazing tools, aliases, functions, and...

      I am currently preparing for a new job and cleaning up my dotfile repository. During the process, I had the idea that it would be nice to create a list of amazing tools, aliases, functions, and recommendations together.

      I will start.

      First, here is a list of nice tools to apt-get install or brew install that I can wholeheartedly recommend:

      • nvim is just an amazing text editor.
      • fzf is a very good fuzzy finder util. For example, you can quickly find files with it.
      • eza is a good ls replacement (and the successor of exa).
      • bat is a great replacement for cat with nice integrations and many options.
      • stow is great for managing your dotfiles. Thanks to @TangibleLight for telling me about it some while ago. I really love it.
      • tmux is a terminal multiplexer, i.e. you can have many sessions in one single terminal window. It's easy to use and super helpful. (When on a mac, I prefer iTerm tabs, though.)
      • nvm is practically a must if you are working with Node.
      • glow is an excellent markdown reader.
      • tldr is a nice man replacement. (You must run tldr -u after installing it to update available texts.)
      • z, an amazing tool for switching directories quickly.

      Also, I can recommend Oh My ZSH! which I have been using for years.

      Here is a small list of aliases I enjoy (I have 100+ aliases and I tried to pick some others may enjoy as well):

      # Serve current dir
      alias serve="npx serve ."
      
      # What's my IP?
      alias ip="curl --silent --compressed --max-time 5 --url 'https://ipinfo.io/ip' && echo ''"
      
      # This should be the default
      alias mkdir="mkdir -p"
      
      # Nice git helpers
      alias amend="git add . && git commit --amend --no-edit"
      alias nuke="git clean -df && git reset --hard"
      
      # Make which more powerful
      which='(alias; declare -f) | /usr/bin/which --tty-only --read-alias --read-functions --show-tilde --show-dot'
      
      # This saves so many keystrokes, honestly
      alias -- +x="chmod +x"
      
      # Turns your path into a nice list and prints it
      alias path='echo -e ${PATH//:/\\n}'
      
      # Map over arguments and run a command
      # Usage: map <command>
      # Example: ls | map cat
      alias map="xargs -n1"
      

      And, finally, here are some fun functions:

      # Get cheat sheets for almost anything!
      # https://github.com/chubin/cheat.sh
      cheat() {
          WITH_PLUS=$(echo $@ | sed 's/ /+/g')
          CAT_TOOL=$(command -v batcat || command -v bat || command -v cat)
          curl "cheat.sh/$WITH_PLUS" | $CAT_TOOL
      }
      
      # Send everything to /dev/null
      nullify() {
        "$@" >/dev/null 2>&1
      }
      
      # Create a new dir and enter it
      mk() {
        mkdir -p "$@" && cd "$_"
      }
      
      # Create a data URL from a file
      # Source: https://github.com/mathiasbynens/dotfiles/blob/master/.functions
      data-url() {
      	local mimeType=$(file -b --mime-type "$1");
      	if [[ $mimeType == text/* ]]; then
      		mimeType="${mimeType};charset=utf-8";
      	fi
      	echo "data:${mimeType};base64,$(openssl base64 -in "$1" | tr -d '\n')";
      }
      
      74 votes
    3. best way to go about with a script that seems to need both bash and python functionality

      Gonna try and put this into words. I am pretty familiar with bash and python. used both quite a bit and feel more or less comfortable with them. My issue is I often do a thing where if I want to...

      Gonna try and put this into words.

      I am pretty familiar with bash and python. used both quite a bit and feel more or less comfortable with them.

      My issue is I often do a thing where if I want to accomplish a task that is maybe a bit complex, I feel like I have to wind up making a script, let's call it hello_word.sh but then I also make a script called .hello_world.py

      and basically what I do is almost the first line of the bash script, I call the python script like ./hello_world.py $@ and take advtange of the argparse library in python to determine what the user wants to do amongst other tasks that are easier to do in python like for loops and etc.

      I try to do the meat of the logic in the python scripts before I write to an .env file from it and then in the bash script, I will do

      set -o allexport
      source "${DIR}"/"${ENV_FILE}"
      set +o allexport
      

      and then use the variable from that env file to do the rest of the logic in bash.

      why do I do anything in bash?

      cause I very much prefer being able to see a terminal command being executed in real-time and see what it does and be able to Ctrl+c if I see the command go awry.

      in python, you can run a command with subprocess or other similar system libraries but you can't get the output in real-time or terminate a command preemptively and I really hate that. you have to wait for the command to end to see what happened.

      But I feel like there is something obvious I am missing (like maybe bash has an argparse library I don't know about and there is some way to inject the concept of types into it) or if there is another language entirely that fits my needs?

      6 votes
    4. Which language would you pick to completely rewrite BSD, Linux, etc.?

      It'd my understanding that C has stuck around in the UNIX world for so long, nearly half a century, mostly due to the inertia of legacy code. If you could snap your fingers and magically port/fork...

      It'd my understanding that C has stuck around in the UNIX world for so long, nearly half a century, mostly due to the inertia of legacy code.

      If you could snap your fingers and magically port/fork the entire stack of open source codebases to the language of your choice, which would you pick and why?

      20 votes
    5. What DE and distro do you use and why?

      I'm curious as to what the Tildes Linux/BSD community (and I suppose other answers like Windows or MacOS would be acceptable, though they may feel a bit more dry) use for their desktop. I imagine...

      I'm curious as to what the Tildes Linux/BSD community (and I suppose other answers like Windows or MacOS would be acceptable, though they may feel a bit more dry) use for their desktop. I imagine that Ubuntu and Gnome will dominate the answers as you would expect, but maybe you'll surprise me. Personally, I'm on Arch Linux with i3-gaps. I use Arch because I enjoy the DIY aspect of Linux as well as the aur and slim nature of Arch. I'd also be lying if I didn't say I use it partially just because I like the "pacman" pun.

      As for i3-gaps, I think that WMs are generally more customizable and good for 'ricing', plus they go with my workflow and are convenient in that they load faster and the likes, though I have to admit I have only ever used i3 (I've been considering trying out bspwm). So, what do you guys use? You can also of course share more information such as your shell or DM if you wanted, though I highly doubt anyone cares what display manager you us or anything.

      24 votes
    6. Switching from Linux to BSD: What do you miss?

      There seems to be a trend lately of people switching over to BSD operating systems. Having read some blog posts on the matter and now given the recent system-d controversy, I'm genuinely curious...

      There seems to be a trend lately of people switching over to BSD operating systems. Having read some blog posts on the matter and now given the recent system-d controversy, I'm genuinely curious to give FreeBSD or OpenBSD a go as my main OS.

      For those who have switched over to BSD, what are some problems you've encountered and/or what are some things you miss?

      31 votes