Linux

From Wiki
Revision as of 14:43, 8 October 2019 by Joseph (talk | contribs) (wget: Ignore no-follow option)

Subpages


General

Offline dictionary - GoldenDict

GoldenDict-rescan-dictionaries.png

Install the GoldenDict dictionary application for your Linux distribution.

By default, the application only seems to use online dictionaries for English to English dictionaries.

Download the free offline dictionary Wordnet3 from here.

Unzip the downloaded file and place the file that ends with .dz in /usr/share/dictd

Now open GoldenDict. Go to Edit -> Dictionaries (or press F3). Under the Sources -> Files, you'll see the directories that GoldenDict looks for dictionary files. Press the "Rescan now" button in the right pane to index the newly added dictionary.

Optional: You can also make WordNet3 the dictionary with the highest priority by dragging it to the top in the Dictionaries tab.

Network Tricks

Connecting to two networks - one Wi-Fi and one wired

Wi-Fi network has internet, wired does not. Then, disable the gateway of the Wired network for internet access.


Show the networks

$ ip route show

Smaller metric number means higher priority for the gateway


Remove the gateway of the wired network

$ sudo ip route del default via 192.168.1.1

Gnome tricks

Creating a desktop launcher on Gnome

Install gnome-panel

sudo apt-get install --no-install-recommends gnome-panel


Open the Create Launcher dialog and enter the details for the launcher

sudo gnome-desktop-item-edit --create-new /usr/share/applications

Done.


Reset Gnome configuration

Run this command as your user

dconf reset -f /org/gnome/

Logout and login.

Video Editing

Trimming a video

ffmpeg can be used to quickly trim a video from a given start time to end time.

ffmpeg -i video.webm -ss 00:00:00 -t 00:05:04 -c copy video-cut.webm

ss and t can be skipped in case of start of video or end of video respectively.

See this for joining videos.

Create ebook from a website using Calibre

Some free books on the internet are available as HTML pages.
An epub file is simply an archive of HTML pages that can be treated as an ebook.
A book website can be stitched into an ebook using wget and calibre

wget -r --no-parent -erobots=off http://www.hpmor.com/
ebook-convert index.html hpmor.epub

X Window system tricks

Switch to Colemak layout in X window system

setxkbmap us -variant colemak

Natural scrolling

Run the following command, then logout and login.

echo "pointer = 1 2 3 5 4 6 7 8 9 10 11 12" >> ~/.Xmodmap

VirtualBox tricks

Adding a new virtual USB disk to a virtual machine

  • Enable USB controller for the virtual machine. This can be done from the VirtualBox UI.
  • Create a new virtual disk and add it using the USB controller.
  • Run this command as root inside the box.
   # mkfs.ext4 /dev/sdb