SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Downloaden Sie, um offline zu lesen
Tips and Tricks for Increased
Development Efficiency
or, “things you will probably not learn in university”
Olivier Bourgeois
Mount Allison University
February 12, 2018
Content
● Introduction
● A Note for Windows Users
● A Note for macOS Users
● Modern Shells
● Terminal Multiplexer
● Personalize Your Dotfiles
● Useful Commands
● Misc FAQ
● Closing Words
Introduction
As a computer science student at university, you know a lot about algorithms.
What about everything that surrounds writing these algorithms?
I’ll be walking through a high level overview of terminals, shells, multiplexers, as
well as a decent amount of useful commands and flags.
What about an example of a highly useful command?
fortune -s | cowsay | lolcat
A Note for Windows Users
Avoid using Windows*
*Linux Subsystem for Windows 10: https://docs.microsoft.com/en-us/windows/wsl/install-win10
A Note for Windows Users
Three main reasons to move to a Unix system for development:
1. Package managers
2. Shell scripting
3. Less friction interacting with other Unix systems
● Ubuntu: https://www.ubuntu.com/download/desktop
● Mint: https://linuxmint.com/download.php
● macOS: https://www.apple.com/ca/mac/
A Note for macOS Users
macOS is based off a branch of Unix, but by default is missing two important
pieces that Linux distributions generally already have:
● A good customizable terminal: https://iterm2.com/
● A universal package manager: https://brew.sh/
Once those two things are installed, we’ll be ready to roll!
Modern Shells
Every Unix systems comes with some close variant or unmodified version
of sh (1971) or bash (1989) as a default shell. These programs are old.
Various widely available shell features:
● Aliases
● Environment variables
● Shortcuts (C-[a/e/l/k], A-[f/b], up/down…)
● Piping (|, >, <, >>, &)
● Expressions (!!, -, ., .., ~)
Modern Shells
Advantages of moving towards a more modern shell instead:
● Powerful tab completion
● Command suggestions
● Path expansion
● Git plugins
● Dynamic aliases
● Tons of customization
Modern Shells
zsh:
● Extension of Bash from 1990
● Follows the POSIX standard more closely than fish
● More customizable than fish
fish:
● Exotic shell from 2005
● Slightly different from the Bash syntax
● A lot more out-of-the-box than zsh
Terminal Multiplexer
“A terminal multiplexer is a software application that can be used to multiplex
several virtual consoles” - Wikipedia, useful as always
Advantages of multiplexers:
● Persistence
● Multiple panes/tabs
● Session sharing
● Predefined configurations
● Input synchronization
Terminal Multiplexer
screen:
● Initial release in 1987
● Installed by default on most systems
● Built-in telnet client
tmux:
● Initial release in 2007
● Easier configuration and plugins
Personalize Your Dotfiles
Dotfiles are configuration files for Unix applications (usually starting with a dot
to hide the file, hence the name) stored in your home directory.
Suggestions:
● Customize dotfiles for applications you spend a lot of time in (e.g. tmux)
● Store customized dotfiles in a source repository (e.g. github)
● Automate repeated processes using dotfiles, aliases, and scripts
● Pick a preferred color scheme and font, and use it consistently
Useful Commands
In 1986, Donald Knuth (the father of algorithm analysis) was asked to write a
program which could read a text, determine the n most frequently used words,
and print out a sorted list of those words along with their frequencies.
His solution was about 10 printed pages of Pascal long.
It was well designed and used efficient data structures.
In response, a reader wrote a shell script that produced the same output [...]
Useful Commands
The script was six lines long.
tr -cs A-Za-z ‘n’ |
tr A-Z z-a |
sort |
uniq -c |
sort -rn |
sed {$1}q
Useful Commands
Basic commands:
● man - display the manual for a command
● ls - list directory content (-l print details, -a print hidden, -h human units)
● cd - change current directory
● pwd - print current path
● mv - move files around
● cp - copy files around (-r recursive)
● rm - remove files (-r recursive, -f force)
● mkdir - create directories (-p also create parent directories)
Useful Commands
Basic commands:
● which - show the path of a shell command
● date - print the system date and time
● tree - list directories and files in a tree-like format (-L level)
● ln - make links between files (-s symbolic link)
● touch - create empty files
● chmod - change the permissions of files
● chown - change the owner of files
Useful Commands
Files and inputs:
● echo - print a line of text (-e recognize escape sequences)
● less - interactive reading of file or input
● tail - output last portion of a file or input (-f follow, -n number of lines)
● grep - print lines matching a pattern (-v invert pattern)
● find - search for files in directories (-name file pattern)
● diff - compare files line by line (-w ignore all whitespace)
● sort - sort lines of text (-f ignore case, -r reverse)
● wc - print the amount of lines, words, and bytes (-l print only line count)
Useful Commands
System-related commands:
● uname - print system information (-a print all information)
● free - display amount of free and used memory (-h human units)
● lsblk - list the system’s block devices and partitions
● df - display file system disk space usage (-h human units)
● du - estimate file space usage (-h human units, -s summarize)
Useful Commands
Process-related commands:
● top - process manager / viewer
● htop - better process manager / viewer
● ps aux - lists all currently running processes
● kill - kill a process based on pid (-9 force kill)
● pkill - kill a process based on name pattern (-9 force kill)
Useful Commands
Network commands:
● ssh - ssh client
● scp - secure copy over ssh (-r recursive)
● ping - send icmp echo requests to hosts
● wget - non-interactive file downloader
● curl - transfer data to or from server (-k insecure connection)
Misc FAQ
● How do I change my shell permanently?
○ chsh -s <shell path> (after installing the shell)
● What if a command seems to be missing?
○ apt-get install <command> or brew install <command> (or other, depending on distro)
● How do I do the whole “git dotfiles” deal?
○ Have your customized dotfiles in a separate directory that isn’t your home (e.g. ~/dotfiles)
and symlink them to where they should be. (e.g. ln -s ~/dotfiles/.vimrc ~/.vimrc)
● What font and color scheme do you use currently?
○ At the moment I’m a big fan of SF Mono with a Solarized Dark theme.
Closing Words
Don’t be afraid of trying new techniques, languages, and tools.
Text Editors:
● Vim, Emacs
● Atom
● VSCode
Java IDEs:
● IntelliJ**
Languages:
● Java/Kotlin
● Python
● C++
● Golang
● Javascript
Data formats:
● JSON
● YAML
Technologies:
● Ansible
● Docker
Closing Words
“I have never let schooling interfere with my education.”
- Grant Allen / Mark Twain
Continuous learning is already important in most areas of life,
but it is almost required in software engineering to stay relevant.
There are a ton of great blogs, podcasts, and books out there.
Great starter Wiki about a ton of topics relating to software careers:
https://www.reddit.com/r/cscareerquestions/wiki/index
Questions?
Any other things I should cover for next time?

Weitere ähnliche Inhalte

Was ist angesagt?

Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command LineAnuchit Chalothorn
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformaticsBonnie Ng
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic CommandsHanan Nmr
 
Basic command ppt
Basic command pptBasic command ppt
Basic command pptRohit Kumar
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands Raghav Arora
 
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...Anne Nicolas
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editorshanmuga rajan
 
Automating with ansible (Part c)
Automating with ansible (Part c) Automating with ansible (Part c)
Automating with ansible (Part c) iman darabi
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commandsHimani Singh
 
Lcna tutorial-2012
Lcna tutorial-2012Lcna tutorial-2012
Lcna tutorial-2012Gluster.org
 
Bsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdBsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdScott Tsai
 
The Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsThe Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsDivye Kapoor
 

Was ist angesagt? (19)

Experimental dtrace
Experimental dtraceExperimental dtrace
Experimental dtrace
 
Quick Guide with Linux Command Line
Quick Guide with Linux Command LineQuick Guide with Linux Command Line
Quick Guide with Linux Command Line
 
Basic 50 linus command
Basic 50 linus commandBasic 50 linus command
Basic 50 linus command
 
Basic linux commands for bioinformatics
Basic linux commands for bioinformaticsBasic linux commands for bioinformatics
Basic linux commands for bioinformatics
 
Linux Basic Commands
Linux Basic CommandsLinux Basic Commands
Linux Basic Commands
 
Basic command ppt
Basic command pptBasic command ppt
Basic command ppt
 
Linux Commands
Linux CommandsLinux Commands
Linux Commands
 
Basic linux commands
Basic linux commands Basic linux commands
Basic linux commands
 
3 technical-dns-workshop-day2
3 technical-dns-workshop-day23 technical-dns-workshop-day2
3 technical-dns-workshop-day2
 
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
Kernel Recipes 2016 - Would an ABI changes visualization tool be useful to Li...
 
Linux Basic commands and VI Editor
Linux Basic commands and VI EditorLinux Basic commands and VI Editor
Linux Basic commands and VI Editor
 
Automating with ansible (Part c)
Automating with ansible (Part c) Automating with ansible (Part c)
Automating with ansible (Part c)
 
Useful linux-commands
Useful linux-commandsUseful linux-commands
Useful linux-commands
 
Unix Ramblings
Unix RamblingsUnix Ramblings
Unix Ramblings
 
Lcna tutorial-2012
Lcna tutorial-2012Lcna tutorial-2012
Lcna tutorial-2012
 
Linux for Beginners
Linux for  BeginnersLinux for  Beginners
Linux for Beginners
 
Bsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsdBsdtw17: george neville neil: realities of dtrace on free-bsd
Bsdtw17: george neville neil: realities of dtrace on free-bsd
 
Basic Linux commands
Basic Linux commandsBasic Linux commands
Basic Linux commands
 
The Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOsThe Linux Kernel Implementation of Pipes and FIFOs
The Linux Kernel Implementation of Pipes and FIFOs
 

Ähnlich wie Tips and Tricks for Increased Development Efficiency

Ähnlich wie Tips and Tricks for Increased Development Efficiency (20)

Linux Internals - Part I
Linux Internals - Part ILinux Internals - Part I
Linux Internals - Part I
 
Adhocr T-dose 2012
Adhocr T-dose 2012Adhocr T-dose 2012
Adhocr T-dose 2012
 
2018-Summer-Tutorial-Intro-to-Linux.pdf
2018-Summer-Tutorial-Intro-to-Linux.pdf2018-Summer-Tutorial-Intro-to-Linux.pdf
2018-Summer-Tutorial-Intro-to-Linux.pdf
 
Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01Linuxtraining 130710022121-phpapp01
Linuxtraining 130710022121-phpapp01
 
An Introduction To Linux
An Introduction To LinuxAn Introduction To Linux
An Introduction To Linux
 
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)UCL All of the Things (MeetBSD California 2014 Lightning Talk)
UCL All of the Things (MeetBSD California 2014 Lightning Talk)
 
Introduction to Shell script
Introduction to Shell scriptIntroduction to Shell script
Introduction to Shell script
 
Nithi
NithiNithi
Nithi
 
Linuxs1
Linuxs1Linuxs1
Linuxs1
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Systemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to loveSystemd: the modern Linux init system you will learn to love
Systemd: the modern Linux init system you will learn to love
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Linuxppt
LinuxpptLinuxppt
Linuxppt
 
Lamp ppt
Lamp pptLamp ppt
Lamp ppt
 
UNIX/Linux training
UNIX/Linux trainingUNIX/Linux training
UNIX/Linux training
 
Lamp ppt
Lamp pptLamp ppt
Lamp ppt
 
Linux-Internals-and-Networking
Linux-Internals-and-NetworkingLinux-Internals-and-Networking
Linux-Internals-and-Networking
 
Terminals and Shells
Terminals and ShellsTerminals and Shells
Terminals and Shells
 
Linux introduction (eng)
Linux introduction (eng)Linux introduction (eng)
Linux introduction (eng)
 
Introduction to Linux
Introduction to LinuxIntroduction to Linux
Introduction to Linux
 

Kürzlich hochgeladen

Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsSafe Software
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...confluent
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfAlina Yurenko
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencessuser9e7c64
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringHironori Washizaki
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Developmentvyaparkranti
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecturerahul_net
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxAndreas Kunz
 

Kürzlich hochgeladen (20)

Powering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data StreamsPowering Real-Time Decisions with Continuous Data Streams
Powering Real-Time Decisions with Continuous Data Streams
 
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
Catch the Wave: SAP Event-Driven and Data Streaming for the Intelligence Ente...
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdfGOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
GOING AOT WITH GRAALVM – DEVOXX GREECE.pdf
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
Advantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your BusinessAdvantages of Odoo ERP 17 for Your Business
Advantages of Odoo ERP 17 for Your Business
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Patterns for automating API delivery. API conference
Patterns for automating API delivery. API conferencePatterns for automating API delivery. API conference
Patterns for automating API delivery. API conference
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
Machine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their EngineeringMachine Learning Software Engineering Patterns and Their Engineering
Machine Learning Software Engineering Patterns and Their Engineering
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
VK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web DevelopmentVK Business Profile - provides IT solutions and Web Development
VK Business Profile - provides IT solutions and Web Development
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
Understanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM ArchitectureUnderstanding Flamingo - DeepMind's VLM Architecture
Understanding Flamingo - DeepMind's VLM Architecture
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptxUI5ers live - Custom Controls wrapping 3rd-party libs.pptx
UI5ers live - Custom Controls wrapping 3rd-party libs.pptx
 

Tips and Tricks for Increased Development Efficiency

  • 1. Tips and Tricks for Increased Development Efficiency or, “things you will probably not learn in university” Olivier Bourgeois Mount Allison University February 12, 2018
  • 2. Content ● Introduction ● A Note for Windows Users ● A Note for macOS Users ● Modern Shells ● Terminal Multiplexer ● Personalize Your Dotfiles ● Useful Commands ● Misc FAQ ● Closing Words
  • 3. Introduction As a computer science student at university, you know a lot about algorithms. What about everything that surrounds writing these algorithms? I’ll be walking through a high level overview of terminals, shells, multiplexers, as well as a decent amount of useful commands and flags. What about an example of a highly useful command? fortune -s | cowsay | lolcat
  • 4. A Note for Windows Users Avoid using Windows* *Linux Subsystem for Windows 10: https://docs.microsoft.com/en-us/windows/wsl/install-win10
  • 5. A Note for Windows Users Three main reasons to move to a Unix system for development: 1. Package managers 2. Shell scripting 3. Less friction interacting with other Unix systems ● Ubuntu: https://www.ubuntu.com/download/desktop ● Mint: https://linuxmint.com/download.php ● macOS: https://www.apple.com/ca/mac/
  • 6. A Note for macOS Users macOS is based off a branch of Unix, but by default is missing two important pieces that Linux distributions generally already have: ● A good customizable terminal: https://iterm2.com/ ● A universal package manager: https://brew.sh/ Once those two things are installed, we’ll be ready to roll!
  • 7. Modern Shells Every Unix systems comes with some close variant or unmodified version of sh (1971) or bash (1989) as a default shell. These programs are old. Various widely available shell features: ● Aliases ● Environment variables ● Shortcuts (C-[a/e/l/k], A-[f/b], up/down…) ● Piping (|, >, <, >>, &) ● Expressions (!!, -, ., .., ~)
  • 8. Modern Shells Advantages of moving towards a more modern shell instead: ● Powerful tab completion ● Command suggestions ● Path expansion ● Git plugins ● Dynamic aliases ● Tons of customization
  • 9. Modern Shells zsh: ● Extension of Bash from 1990 ● Follows the POSIX standard more closely than fish ● More customizable than fish fish: ● Exotic shell from 2005 ● Slightly different from the Bash syntax ● A lot more out-of-the-box than zsh
  • 10. Terminal Multiplexer “A terminal multiplexer is a software application that can be used to multiplex several virtual consoles” - Wikipedia, useful as always Advantages of multiplexers: ● Persistence ● Multiple panes/tabs ● Session sharing ● Predefined configurations ● Input synchronization
  • 11. Terminal Multiplexer screen: ● Initial release in 1987 ● Installed by default on most systems ● Built-in telnet client tmux: ● Initial release in 2007 ● Easier configuration and plugins
  • 12. Personalize Your Dotfiles Dotfiles are configuration files for Unix applications (usually starting with a dot to hide the file, hence the name) stored in your home directory. Suggestions: ● Customize dotfiles for applications you spend a lot of time in (e.g. tmux) ● Store customized dotfiles in a source repository (e.g. github) ● Automate repeated processes using dotfiles, aliases, and scripts ● Pick a preferred color scheme and font, and use it consistently
  • 13. Useful Commands In 1986, Donald Knuth (the father of algorithm analysis) was asked to write a program which could read a text, determine the n most frequently used words, and print out a sorted list of those words along with their frequencies. His solution was about 10 printed pages of Pascal long. It was well designed and used efficient data structures. In response, a reader wrote a shell script that produced the same output [...]
  • 14. Useful Commands The script was six lines long. tr -cs A-Za-z ‘n’ | tr A-Z z-a | sort | uniq -c | sort -rn | sed {$1}q
  • 15. Useful Commands Basic commands: ● man - display the manual for a command ● ls - list directory content (-l print details, -a print hidden, -h human units) ● cd - change current directory ● pwd - print current path ● mv - move files around ● cp - copy files around (-r recursive) ● rm - remove files (-r recursive, -f force) ● mkdir - create directories (-p also create parent directories)
  • 16. Useful Commands Basic commands: ● which - show the path of a shell command ● date - print the system date and time ● tree - list directories and files in a tree-like format (-L level) ● ln - make links between files (-s symbolic link) ● touch - create empty files ● chmod - change the permissions of files ● chown - change the owner of files
  • 17. Useful Commands Files and inputs: ● echo - print a line of text (-e recognize escape sequences) ● less - interactive reading of file or input ● tail - output last portion of a file or input (-f follow, -n number of lines) ● grep - print lines matching a pattern (-v invert pattern) ● find - search for files in directories (-name file pattern) ● diff - compare files line by line (-w ignore all whitespace) ● sort - sort lines of text (-f ignore case, -r reverse) ● wc - print the amount of lines, words, and bytes (-l print only line count)
  • 18. Useful Commands System-related commands: ● uname - print system information (-a print all information) ● free - display amount of free and used memory (-h human units) ● lsblk - list the system’s block devices and partitions ● df - display file system disk space usage (-h human units) ● du - estimate file space usage (-h human units, -s summarize)
  • 19. Useful Commands Process-related commands: ● top - process manager / viewer ● htop - better process manager / viewer ● ps aux - lists all currently running processes ● kill - kill a process based on pid (-9 force kill) ● pkill - kill a process based on name pattern (-9 force kill)
  • 20. Useful Commands Network commands: ● ssh - ssh client ● scp - secure copy over ssh (-r recursive) ● ping - send icmp echo requests to hosts ● wget - non-interactive file downloader ● curl - transfer data to or from server (-k insecure connection)
  • 21. Misc FAQ ● How do I change my shell permanently? ○ chsh -s <shell path> (after installing the shell) ● What if a command seems to be missing? ○ apt-get install <command> or brew install <command> (or other, depending on distro) ● How do I do the whole “git dotfiles” deal? ○ Have your customized dotfiles in a separate directory that isn’t your home (e.g. ~/dotfiles) and symlink them to where they should be. (e.g. ln -s ~/dotfiles/.vimrc ~/.vimrc) ● What font and color scheme do you use currently? ○ At the moment I’m a big fan of SF Mono with a Solarized Dark theme.
  • 22. Closing Words Don’t be afraid of trying new techniques, languages, and tools. Text Editors: ● Vim, Emacs ● Atom ● VSCode Java IDEs: ● IntelliJ** Languages: ● Java/Kotlin ● Python ● C++ ● Golang ● Javascript Data formats: ● JSON ● YAML Technologies: ● Ansible ● Docker
  • 23. Closing Words “I have never let schooling interfere with my education.” - Grant Allen / Mark Twain Continuous learning is already important in most areas of life, but it is almost required in software engineering to stay relevant. There are a ton of great blogs, podcasts, and books out there. Great starter Wiki about a ton of topics relating to software careers: https://www.reddit.com/r/cscareerquestions/wiki/index
  • 24. Questions? Any other things I should cover for next time?