Skip to content

Instantly share code, notes, and snippets.

@chetanyakan
Last active January 24, 2021 16:56
Show Gist options
  • Save chetanyakan/c28003d8fb50893a3a384ea0dfdff7fc to your computer and use it in GitHub Desktop.
Save chetanyakan/c28003d8fb50893a3a384ea0dfdff7fc to your computer and use it in GitHub Desktop.
Linux lessons and tools to be productive

Linux lessons and tools to be productive

Plugins and Tips for jetbrains:

  1. Key Promoter X
  2. Nyan Progress Bar
  3. String Manipulation
  4. Rainbow Brackets
  5. Live Templates
  6. ligatures

Extensions for VS Code:

  1. Code Spell Checker
  2. VS Code input sequence

Extensions, tools and tips for Linux:

  1. Terminal in nautilus (File manager)
  2. Tmux
  3. ZShell, Oh-my-zsh a. Plugins: git, zsh-autosuggestions, zsh-syntax-highlighting
  4. notify (my custom alias) a. alias notify="spd-say 'Job finished, wake up'; notify-send 'Job finished!'" b. Success (&&) and failure (||) c. If the command has already started you may use job control to suspend it, then return it to the foreground with fg chained with your notification:
    Ctrl+Z fg ; notify
  5. Clipboard Indicator
  6. System Monitor
  7. GTile
  8. Sticky Notes
  9. Places Status Indicator
  10. Redshift (if using ubuntu 16.04 or older)
  11. Electron app for Music players like JioSaavn
  12. Executing js without console
  13. Gnome and it’s extensions
  14. Install media codecs: sudo apt-get install ubuntu-restricted-extras
  15. Tweak Tools
  16. Mac Theme (personal)
  17. Start up applications (with sleep command)
  18. Awesome Extensions

Linux Terminal Commands:

  1. ll
  2. !! (Reuse the previous command) and !$ (Reuse the last command arguments)
  3. cd - and cd
  4. Running multiple commands in one single command using (;, ||, &&)
  5. Running command or job in background &
  6. Ctrl + A to move to start and Ctrl + E to move to the end in terminal
  7. alias
  8. > filename (empty a file without deleting it)
  9. apt list --installed | grep program_name
  10. Insult the user when typing wrong bash command (insult-linux-user-when-typing-wrong-command)
  11. sl (display-animation)

Lessons:

  1. What are Ubuntu Repositories? (https://itsfoss.com/ubuntu-repositories/)

    • What are repositories?
    • 4 categories (/etc/apt/sources.list file):
      • Main – Canonical-supported free and open-source software.
      • Universe – Community-maintained free and open-source software.
      • Restricted – Proprietary drivers for devices.
      • Multiverse – Software restricted by copyright or legal issues.
    • Third party repositories and PPA (Personal Package Archive):
      • To access more software or to access newer version of a software
      • Ubuntu controls what software and more importantly which version of a software you get on your system. But if a software developer releases a new version of the software. Ubuntu won’t make it available immediately. There is a procedure to check if the new version of the software is compatible with the system or not. This ensures the stability of the system.
      • weeks or months to come to ubuntu repo
      • beta testing
      • Launchpad
            sudo add-apt-repository ppa:dr-akulavich/lighttable
            sudo apt-get update
            sudo apt-get install lighttable-installer
        
      • Ppa are hierarchical
      • When we use PPA, it doesn’t change your original sources.list. Instead, it creates two files in /etc/apt/sources.d directory, a list and a back up file with suffix ‘save’.
      • Offical PPA vs unofficial PPA
  2. Difference Between apt and apt-get? (https://itsfoss.com/apt-vs-apt-get-difference/)

    a. Introduced in ubuntu 16.04
    b. apt install package instead of the usual apt-get install package c. Quick word for Linux Mint users: A few years ago, Linux Mint implemented a python wrapper called apt that actually uses apt-get but provides more friendly options. This apt which we are discussing here is not the same as the one in Linux Mint. d. APT: Advanced Packaging Tool, Debian, it’s not a command e. Various tools that interact with ATP: apt, aptitude f. Commands such as apt-cache, these commands are way too low level and they have so many functionalities which are perhaps never used by an average Linux user. On the other hand, the most commonly used package management commands are scattered across apt-get and apt-cache. The apt commands have been introduced to solve this problem. apt consists some of the most widely used features from apt-get and apt-cache leaving aside obscure and seldom used features. g. Bottom line: apt=most common used command options from apt-get and apt-cache. h. It has fewer but sufficient command options but in a more organized way. On top of that, it enables a few options by default that is actually helpful for the end users. i. For example, you get to see the progress bar while installing or removing a program in apt j. apt also prompts you with the number of packages that can be upgraded when you update the repository database. k. We can achieve the same with apt-get as well if you use additional command options. apt enables them by default and takes the pain away. l. While apt does have some similar command options as apt-get, it’s not backward compatible with apt-get. That means it won’t always work if you just replace the apt-get part of an apt-get command with apt. m. apt install apt-get install n. apt remove apt-get remove o. apt full-upgrade apt-get dist-upgrade p. apt search apt-cache search (Searches for the program) q. apt show apt-cache show (Shows package details) r. apt has a few commands of its own as well: i. apt list ii. apt edit-sources s. Is apt-get deprecated? - No, It still has a lot more functionalities to offer than apt. For low-level operations, in scripting etc, apt-get will still be used. t. To summarize the apt vs apt-get debate: i. apt is a subset of apt-get and apt-cache commands providing necessary commands for package management ii. While apt-get won’t be deprecated, as a regular user, you should start using apt more often u. PS: Apt command actually uses dpkg command underneath it but apt is more popular and easy to use. v. PS: apt-fast - apt-fast is a shell script wrapper for apt-get that improves updated and package download speed by downloading packages from multiple connections simultaneously.

  3. Snap Packages: (https://itsfoss.com/use-snap-packages-ubuntu-16-04/)

    a. Canonical introduced a new packaging system called Snap packaging in Ubuntu 16.04 LTS. It claims to be more stable and secure. b. What is packaging? - There are several ways you can install programs in Linux systems. One way is to install it from source code. In here, you manually run the scripts, build dependencies etc. Not user-friendly at all. c. .deb (Debian software packaging). The binaries are available in the .deb, one-to-two clicks, and the software is installed. d. Canonical did it for convergence (similar user experience on a variety of devices) and it is being used in Drones and other similar IoT projects. e. From its official website: - A .snap package for the Ubuntu Core system contains all its dependencies. This has a couple of advantages over traditional deb or rpm based dependency handling, the most important being that a developer can always be assured that there are no regressions triggered by changes to the system underneath their app. f. Snaps are more secure. Running in own "containers". g. It's much more easy to handle with snaps than with deb packages. h. In the future, snaps will be the package format for mobile devices, internet of things and desktop. i. is or will be .deb abandoned? Canonical said, there will be support deb packages also in the future. j. Snapcraft is a tool for developing snap packages. With this tool its very easy to convert deb packages into snap packages. k. Commands to install and manage snap packages

  4. 7 Reasons Why Linux is Better Than Mac: (Debatable) (https://itsfoss.com/linux-vs-mac/)

    a. Price: i. Just want to browse stuff, watch movies, download photos, write a document, create a spreadsheet, and other similar stuff. b. Hardware Choices: i. Install it on computers with any configuration. No matter how powerful/old your system is, Linux will work. Even if you have an 8-year old PC laying around, you can have Linux installed and expect it to run smoothly by selecting the right distro. c. Security and Privacy i. It’s difficult to create any backdoor in Linux kernel system, and it also ensures that it doesn’t track any digital footprint of the users. On the other hand, Mac OS is a nicely organized walled garden for the users created by Apple. Most of the Apple’s software keeps track of their user’s movement so that it can sell the product in a better way to its customer. Moreover, as Mac OS is a closed source, so we don’t know how the apple is using the users’ data or to whom the company sells it. ii. There are malware and adware targeting macOS and the number is growing every day. I have seen not-so-techie users struggling with their slow mac. A quick investigation revealed that a browser hijacking malware was the culprit. d. Customization & Flexibility i. You don’t like something? Customize it or remove it. e. Using Linux helps your professional career f. Reliability i. Ever wondered why Linux is the best OS to run on any server? Because it is more reliable! ii. More control to the user while providing better security. Mac OS does not provide you with the full control of its platform. g. Open Source i. A Mac-powered system enables you to get a car for yourself but the downside is you cannot open up the hood to see what’s inside. That’s bad! h. Administrative Privilege and Root Access

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment