the f*ck rants about stuff

easy-fix

Latest posts related to :



  1. Get a nearly fresh debian install without reinstalling

    I was recently asked how to get rid of the old and unused packages without having to reinstall?

    Debian have the mechanisms to deal with this and more. Unfortunately for new people, its not as automated and a little more obscure that i would like

    Anyway, heres what i would do:

    # apt-mark showmanual
    # apt-mark auto <packages you dont recognize>
    # apt purge <packages you recognize but dont want anymore>
    # apt autoremove --purge
    
  2. Copy list of packages installed to another debian machine

    In this day and age, reading debian forums, I still see $ dpkg --get-selections as the recommended way to copy the list of packages installed on one machine in order to install the same packages on another machine

    This list misses vital information… such as which of those packages were automatically installed as dependence!!!

    If you dont want to break your new installation so early on, use $ apt-mark showmanual instead for the list of packages. It will show only packages that you manually installed. You should get the rest as dependences

  3. Dealing with mime types

    The mime type is a little text like image/jpeg or application/pdf that is used to identify the content of a file. Its main use is to determine what program can handle each file

    Theres been this problem where the default program offered by debian were a very awkward one. Like trying to use the notepad.exe that comes with wine to open .txt files. In linux we dont rely on extensions to determine the content of a file, but still wines registers itself as being able to handle text/plain files using its wine-extension-txt.desktop file

    The reason this happens is that in some lightweight desktops (like xfce), it will default to the last program installed (or upgraded!!!) that can handle the file, unless you define a default one yourself

    I fixed this weird behaviour a long time ago by using strace |grep home to locate the file that was being used and updating it. In this case

    ~/.local/share/applications/mimeapps.list
    

    It was fast, but I never really understood why it happened on the first place

    This post found on planet debian digs a little deeper using a different but longer approach and was used to find the reason behind it. Good catch!

  4. Bringing existing repo into gitolite

    The proposition on the original docs is slightly complex because it involves bringing the bare repo to the server, check a lot of things and run exotic gitolite commands

    My solution is easier and without having to touch anything server side

    1. Create the repo in gitolite-admin/conf/gitolite.conf and push it. This creates an empty bare repo remotely

    2. Go to some copy of the existing repo you want to move to gitolite

      $ #Configure your repo url as origin
      $ git remote add origin your.gitserver:repo.name.from.step1
      $ #Push the repo
      $ git push origin master
      $ #Assign current branch (master) to origin/master
      $ git branch --set-upstream-to=origin/master
      
    3. Profit!!!

¡ En Español !