tree command

September 7, 2019 Leave a comment

Problem
You want to visualize the tree structure of the current directory.

Solution
You need the “tree” command. Under Manjaro it was not installed by default, but of course it could be installed easily with the package manager.


$ tree
.
├── greetings
│   ├── english.rs
│   └── french.rs
└── lib.rs

1 directory, 3 files

If you want to ignore a subdirectory, use the “-I” option:


$ tree -I target
.
├── Cargo.lock
├── Cargo.toml
├── src
│   ├── greetings
│   │   ├── english.rs
│   │   └── french.rs
│   └── lib.rs
└── src.old
└── lib.rs

3 directories, 6 files

Advertisements
Categories: linux Tags: , , ,

get system info

August 19, 2019 Leave a comment

To get system info in a simple and readable way, use neofetch:

neofetch

As I know, it also exists under Ubuntu.

Categories: linux Tags: ,

[manjaro] change window buttons layout

August 18, 2019 Leave a comment

Problem
On my desktop I have a Manjaro that I installed years ago. It’s a rolling release distro, meaning I get all the updates, but the graphical interface is not always updated. For instance, I installed a new Manjaro on a laptop, and Manjaro looks much better on my laptop than on my old desktop.
On a newly installed Manjaro, the window buttons are on the right side, but on my desktop they are on the left. How could I unify them and move the buttons to the right?

Solution
I found the solution in this video: https://www.youtube.com/watch?v=yVfHDyWcgSA . In short: start the Settings Editor, select xfwm4 on the left, edit “button layout”, and provide the string “O|SHMC” (without quotes).

QuickJump: bookmark your directories and switch between them easily

June 30, 2019 Leave a comment

I made a little project that facilitates jumping between directories in the command line. You can find it here: https://github.com/jabbalaci/quickjump . Visit the GitHub page for more info.

Demo

Categories: python, shell Tags: , , , ,

Make a GIF of your terminal and insert it in your GitHub README

June 30, 2019 Leave a comment

Problem
For your shiny new GitHub project you want to make an animated GIF and insert it in the README file.

Solution
I found a blog post about it here. In short:

$ ttyrec demo
# do some stuff
Ctrl+D
$ ttygif demo
# the result is in tty.gif

Under Manjaro I could install the packages ttyrec and ttygif with yay.

And then you can insert the GIF in your README.md like this:

![GIF Demo](demo/demo.gif)
Categories: linux Tags: , , , ,

ASUS VivoBook S530F: how to install the Windows 10 drivers?

Problem
I got a new laptop at my workplace, an ASUS VivoBook S530F. I wanted to make a dual-boot system with Windows 10 and Manjaro. First, I installed Windows 10 on it. For creating a bootable USB stick, I followed this guide (I used gparted). Windows 10 installed successfully but I had no wifi. Fine, let’s install the drivers from the included DVD. Some drivers went up, but the installation of the wifi driver terminated with a DLL error. This error was produced by a file called pnputil.exe. Hmm… OK, then let’s connect an Ethernet cable. Oh, but this slim laptop has no Ethernet connection! Using another machine, I downloaded the wifi driver from the ASUS home page, I could install it, but nothing happened. The wifi was still dead.

Solution
It turned out that the file pnputil.exe is part of the Windows and you can find it in the C:\Windows\System32 folder. On the DVD there were about 18 copies of this file and by comparing their sizes, there were at least 3 different versions. On the official DVD! Congratulations!

So I copied the content of the DVD to the hard drive and overwrote all instances of pnputil.exe with the one from the System32 folder. Then I launched the installation wizard and it installed all the drivers without any DLL error message.

Update: Installing Manjaro
After Windows 10, I installed Manjaro in a separate partition. Under Windows 10 I downloaded the Manjaro ISO and wrote it on a USB stick with Rufus in dd mode. During the installation I created a swap partition and a root partition. Here I got a warning that an EFI partition is necessary. The Windows 10 installer created a FAT32 partition of size 100 MB. I selected this partition and specified it to be mounted under /boot/efi. The installer flagged it automatically as “esp”. Then the installation went on without any problem and my wifi card was recognized out-of-the-box.

Categories: manjaro, windows 10 Tags: , ,

download a YouTube playlist for offline view and keep the videos numbered

Problem
You want to download a YouTube playlist. youtube-dl can do that, fine. However, if the playlist contains the videos in chronological order, then you may want to watch them offline in the same order too. On YouTube, the videos are ordered and they are also numbered, but if you download them with youtube-dl, you lose the numbers and you lose the original order.

Solution
Good news: youtube-dl has a command-line option for this. When downloading a playlist, I use the following Bash script:

#!/usr/bin/env bash

URL="https://www.youtube.com/playlist?list=<playlist_id_here>"

youtube-dl -o "%(playlist_index)s - %(title)s.%(ext)s" \
           --ignore-errors \
           --download-archive downloaded.txt \
           -f 22 \
           "$URL"

It’ll download the videos in .mp4 format (that’s format 22).

Categories: bash Tags: ,