SlideShare a Scribd company logo
1 of 70
Ultimate UNIX Setup
For Developers
Jacob Menke – Software Engineer && Business ComputerTechnologies LabTechnician (Ann Arbor MI)
Boring and not too usable
defaults…
Config Files &&YouTubeTutorials
• https://github.com/MenkeTechnologies/TutorialFiles
• https://www.youtube.com/channel/UCLOQFBXPrcVvO2
Wb3wna8Ow
• RecentTopics : GNU Readline Shortcuts in mysql,
python3 and various REPLs
• http://jakobmenke.com/
Custom Shell functions
• cd
• aliases > functions > reserved words > builtins > external
commands in PATH > not found
• clearList == bash function
• essentially: clear && ls -AlhFi
Functions and aliases
UNIX Spirit – One letter commands. The more cryptic and less typing the better
Aliases Demo
Package Managers
• Mac => Homebrew, MacPorts, Fink (old)
• Homebrew HomePage => https://brew.sh/
• install => /usr/bin/ruby -e "$(curl -fsSL
https://raw.githubusercontent.com/Homebrew/install/ma
ster/install)"
Homebrew Jargon
• Package == Formula == ruby file
• installed into /usr/local/Cellar/<package> with symlinks into
/usr/local/bin, /usr/local/lib etc
• Taps == Github repositories
• Homebrew Core Repo Formulae
• downloaded to /usr/local/Homebrew/Library/taps/homebrew/homebrew-
core/formula
• Bottle == binary program already built for macOS (configure and make
already done for you)
• Cask == GUI program or font ie microsoft-office, intellij-idea
Homebrew Formula
brew install zzz
Homebrew Exploration
Homebrew
• brew install <package>
• brew ls
• brew rm <package>
• brew search <package>
• brew cleanup
• brew update
• brew upgrade
• brew cask install <gui-package>
• Brew cask rm <gui-package>
(removes .app from /Applications)
• brew cask zap <gui-package> (like
brew cask rm but also removes all
preferences files etc ie full
deinstallation)
• brew cask rm <gui>
Homebrew Demo
Package Managers
• Linux
• Debian based = Debian, Ubuntu, Mint, Raspbian, Kali
• Dpkg, apt, aptitude
• RPM based = Red Hat, Fedora, CentOS
• Rpm, yum
Apt
• sudo apt-get install <package>
• sudo apt-cache search <package>
• sudo apt-get purge <package>
• dpkg –l = list all installed packages
• dpkg –L <package> = show files for this package
• sudo apt-get update
• sudo apt-get upgrade
Tmux
• Terminal Multiplexer
• brew install tmux
• sudo apt-get install tmux
Tmux Commands
• tmux = start server
• tmux new-session –t <session-name>
• tmux new-window –t <window-name>
• tmux split-window = horizontal split pane
• tmux list-sessions (tmux ls) = list sessions
• tmux list-windows
• tmux list-panes
Tmux Commands
• tmux attach –t <session-name>
• tmux kill-session [–t <session-name>]
• tmux kill-window [–t <window-name>]
• tmux kill-pane [–t <pane>]
Tmux Demo
Inside ofTmux
• Prefix = defaults to ^B (Control B) but can be changed
• <prefix> + % => vertical split
• <prefix> + “ = horizontal split
• <prefix> + c = new window
• <prefix> + n = next window
• <prefix> + p = previous window
• <prefix> + : => command line inside tmux similar to vim
• <prefix> + : then kill-pane = kills current pane
• === tmux kill-pane
~/.tmux.conf
• Prefix = defaults to control b but can be changed
• These lines bind:
• prefix to ^a
• <prefix> - | to split vertically
• <prefix> - - to split horizontally
Tmux Demo
Tmux scripts
• usually located in ~/.tmux directory
• list of tmux commands to run
• could be run as tmux selectp –t 0 or <prefix>+: selectp –t 0
• ~/.tmux/four-panes
• ~/.tmux.conf
ControlWindow script
Tmux Demo
Htop
• brew install htop
• sudo apt-get install htop
• Similar to top but shows core usages
• / to search
• space to tag process
• k to kill process
Htop demo
ccze
• brew install ccze
• sudo apt-get install ccze
• tail –f /var/log/**/*.log | ccze
• sudo id = shows up in /var/log/system.log on Mac and
/var/log/auth.log on Linux
Logging with color bash script
ccze demo
iftop
• brew install iftop
• sudo apt-get install iftop
• sudo iftop –c ~/.iftop.conf
• while running:
• t = toggle bar display modes
• q = quit
• f = filter
• h = help
~/.iftop.conf
• port-display:on
• line-display:one-line-both
• interface: en0
iftop - colorized
• git clone
https://github.com/MenkeTechnologies/iftopcolor
• ./configure && make
• sudo make install or move executable ./iftop to
somewhere in PATH
iftop demo
grc – general colorizer
• https://github.com/garabik/grc
• brew install grc
• sudo apt-get install grc
grc config files
• Mac: /usr/local/share/grc/conf.ls
• Linux:/usr/share/grc/conf.ls
• each command that will be colorized has its
corresponding config file
• automatic aliases
• usage: grc netstat
• grc –c /usr/local/share/grc/conf.ls ping google.com
Automatic Aliasing (Over aliases)
• curl https://raw.githubusercontent.com/garabik/grc/master/grc.zsh -
O $HOME/grc.zsh
• ~/.zshrc : [[ -s ”$HOME/grc.zsh" ]] && source
“$HOME/grc.zsh”
• ping is now alias for grc ping
grc uses regex for colorization
grc demo
• ping
• ifconfig
• dd
• ps
Python programs
• Glances = pip package
• Powerline status = pip package
• brew install python = goes into
/usr/local/Cellar/python/<version-number>
• pip, package manager for python, should be included
• Mac: pip installs packages to /usr/local/lib/python2.7/site-
packages on
• Debian: pip installs packages to /usr/local/lib/python2.7/dist-
packages
Pip exploration
pip
• pip install <package>
• pip show <package>
• for package in $(pip list –outdated);do pip install
$package done
Powerline
• Status bars for vim, tmux
• requires special fonts for triangles such as Nerd Fonts
• https://github.com/ryanoasis/nerd-fonts
• pip install powerline-status
• ~/.tmux.conf
• ~/.vimrc
Powerline forVim
• recommend to install latest vim 8+
• brew install vim
• sudo apt-get install vim
• brew install macvim (fastest for mac IMO)
• mvim –v <file> = stay in terminal
• mvim <file> = launch gui
Powerline forVim
Macvim Demo
PowerlineTmux Status Bar
• http://powerline.readthedocs.io/en/master/usage/other.h
tml#tmux-statusline
• Define tmux status line in JSON file =>
• $HOME/.config/powerline/themes/tmux
PowerlineTmux StatusBar Demo
My Prompt == Powerlevel 9k
• https://github.com/bhilburn/power
level9k
• using Knack Nerd Font
• brew tap caskroom/fonts
• brew cask install font-hacknerd-
font
Powerlevel9k prompt config
Prompt Demo
glances
• pip install glances
• on Mac installs to /usr/local/lib/python2.7/site-
packages/glances
• Debian installs to /usr/local/lib/python2.7/dist-packages
• https://github.com/nicolargo/glances
glances
• sudo glances [--disable-alert] [--disable-network] […]
• To change text color from white to blue:
• Change line 203 in glances/outputs/glances_curses.py
• curses.init_pair(1, curses.COLOR_WHITE, -1)=>
• curses.init_pair(1, curses.COLOR_BLUE, -1)
glances demo
Oh-my-zsh
• Framework for zsh, geared toward developers
• Tons of prompts and plugins
• https://github.com/robbyrussell/oh-my-zsh
Oh my zsh install
• sh -c "$(curl -fsSL
https://raw.githubusercontent.com/robbyrussell/oh-my-
zsh/master/tools/install.sh)”
Oh my zsh Plugins
• git clone into ~/.oh-my-zsh/custom/plugins
• add to plugins array ~/.zshrc
Zsh-autosuggestions
• copy of FISH (friendly interactive shell)’s suggestions
• Searches history (~/.zsh-history) for most recent commands
starting with letters typed
• hit right arrow to complete the suggestion
• git clone https://github.com/zsh-users/zsh-autosuggestions
$ZSH_CUSTOM/plugins/zsh-autosuggestions
• add to plugins array in ~/.zshrc
Zsh-syntax highlighting
• Red if invalid command, green if found in PATH
• highlighting for quotes
• git clone https://github.com/zsh-users/zsh-syntax-
highlighting.git ${ZSH_CUSTOM:-~/.oh-my-
zsh/custom}/plugins/zsh-syntax-highlighting
• add to plugins array in ~/.zshrc
Zsh-completions
• adds zsh completions for more commands
• Adds zsh tab completions for many more commands such as caffeinate
• git clone https://github.com/zsh-users/zsh-completions ~/.oh-my-
zsh/custom/plugins/zsh-completions
• add to plugins array in ~/.zshrc
zsh plugins demo
z command
• creates database of visited directories
• usage: z <directory-name>
• directory-name can be just a few letters of the name
• if there is a match you will cd to that directory otherwise
no cd and returns 1
z install
• git clone
https://raw.githubusercontent.com/rupa/z/master/z.sh
$HOME
• source ~/z.sh
Zle line editor in ~/.zshrc
3) declare zsh function
as widget
4) Bind widget
function to Control-S
key combination
1) Define zsh function
2) Define zsh function to be
bound as widget. Calls above
function with the contents of
current command line as
argument
Type your commit
message at prompt no
quotes needed and
then pressControl-S
to add, commit and
push to remote
z and ZLE demo

More Related Content

What's hot

Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleRoman Rodomansky
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixBrendan Gregg
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsBrendan Gregg
 
Ansible - simple it automation
Ansible - simple it automationAnsible - simple it automation
Ansible - simple it automationLarry Nung
 
Tutorial: Cross-compiling Linux Kernels on x86_64
Tutorial: Cross-compiling Linux Kernels on x86_64Tutorial: Cross-compiling Linux Kernels on x86_64
Tutorial: Cross-compiling Linux Kernels on x86_64Samsung Open Source Group
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commandsHanan Nmr
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linuxQIANG XU
 
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...Dexter Horthy
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with ComposerAdam Englander
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with ComposerJason Grimes
 
Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Mischa Taylor
 
An example Hadoop Install
An example Hadoop InstallAn example Hadoop Install
An example Hadoop InstallMike Frampton
 
Building RT image with Yocto
Building RT image with YoctoBuilding RT image with Yocto
Building RT image with YoctoAlexandre LAHAYE
 
Setting up a local WordPress development environment
Setting up a local WordPress development environmentSetting up a local WordPress development environment
Setting up a local WordPress development environmentZero Point Development
 
Installing and running Postfix within a docker container from the command line
Installing and running Postfix within a docker container from the command lineInstalling and running Postfix within a docker container from the command line
Installing and running Postfix within a docker container from the command linedotCloud
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPressdotCloud
 

What's hot (19)

Deploying Symfony2 app with Ansible
Deploying Symfony2 app with AnsibleDeploying Symfony2 app with Ansible
Deploying Symfony2 app with Ansible
 
Hadoop Installation
Hadoop InstallationHadoop Installation
Hadoop Installation
 
Kernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at NetflixKernel Recipes 2017: Using Linux perf at Netflix
Kernel Recipes 2017: Using Linux perf at Netflix
 
JavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame GraphsJavaOne 2015 Java Mixed-Mode Flame Graphs
JavaOne 2015 Java Mixed-Mode Flame Graphs
 
Ansible - simple it automation
Ansible - simple it automationAnsible - simple it automation
Ansible - simple it automation
 
Tutorial: Cross-compiling Linux Kernels on x86_64
Tutorial: Cross-compiling Linux Kernels on x86_64Tutorial: Cross-compiling Linux Kernels on x86_64
Tutorial: Cross-compiling Linux Kernels on x86_64
 
Hadoop installation
Hadoop installationHadoop installation
Hadoop installation
 
Linux Network commands
Linux Network commandsLinux Network commands
Linux Network commands
 
Introduction to linux
Introduction to linuxIntroduction to linux
Introduction to linux
 
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
More than Applications: (Ab)using Docker to Improve the Portability of Everyt...
 
Light my-fuse
Light my-fuseLight my-fuse
Light my-fuse
 
PHP Dependency Management with Composer
PHP Dependency Management with ComposerPHP Dependency Management with Composer
PHP Dependency Management with Composer
 
Dependency management with Composer
Dependency management with ComposerDependency management with Composer
Dependency management with Composer
 
Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)Testing Your Automation Code (Vagrant Version)
Testing Your Automation Code (Vagrant Version)
 
An example Hadoop Install
An example Hadoop InstallAn example Hadoop Install
An example Hadoop Install
 
Building RT image with Yocto
Building RT image with YoctoBuilding RT image with Yocto
Building RT image with Yocto
 
Setting up a local WordPress development environment
Setting up a local WordPress development environmentSetting up a local WordPress development environment
Setting up a local WordPress development environment
 
Installing and running Postfix within a docker container from the command line
Installing and running Postfix within a docker container from the command lineInstalling and running Postfix within a docker container from the command line
Installing and running Postfix within a docker container from the command line
 
Dockerizing WordPress
Dockerizing WordPressDockerizing WordPress
Dockerizing WordPress
 

Similar to Ultimate Unix Meetup Presentation

Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationJacobMenke1
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014biicode
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboyKenneth Geisshirt
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with AnsibleRayed Alrashed
 
Contributing to an os project
Contributing to an os projectContributing to an os project
Contributing to an os projectLasse Schuirmann
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...Docker, Inc.
 
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...Christy Norman
 
Programming in Linux Environment
Programming in Linux EnvironmentProgramming in Linux Environment
Programming in Linux EnvironmentDongho Kang
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetOmar Reygaert
 
24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAs24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAsKellyn Pot'Vin-Gorman
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from githubAntony Gitomeh
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-wayRobert Lujo
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Mandi Walls
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Chu-Siang Lai
 

Similar to Ultimate Unix Meetup Presentation (20)

Ultimate Unix Meetup Presentation
Ultimate Unix Meetup PresentationUltimate Unix Meetup Presentation
Ultimate Unix Meetup Presentation
 
Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014Dependencies Managers in C/C++. Using stdcpp 2014
Dependencies Managers in C/C++. Using stdcpp 2014
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
Ansible - A 'crowd' introduction
Ansible - A 'crowd' introductionAnsible - A 'crowd' introduction
Ansible - A 'crowd' introduction
 
Unleash your inner console cowboy
Unleash your inner console cowboyUnleash your inner console cowboy
Unleash your inner console cowboy
 
PHP selber bauen
PHP selber bauenPHP selber bauen
PHP selber bauen
 
Basics of unix
Basics of unixBasics of unix
Basics of unix
 
IT Automation with Ansible
IT Automation with AnsibleIT Automation with Ansible
IT Automation with Ansible
 
Contributing to an os project
Contributing to an os projectContributing to an os project
Contributing to an os project
 
Docker
DockerDocker
Docker
 
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
From Arm to Z: Building, Shipping, and Running a Multi-platform Docker Swarm ...
 
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
A to Z of a Multi-platform Docker Swarm: Building, Shipping, and Running Mult...
 
Programming in Linux Environment
Programming in Linux EnvironmentProgramming in Linux Environment
Programming in Linux Environment
 
Virtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + PuppetVirtualization and automation of library software/machines + Puppet
Virtualization and automation of library software/machines + Puppet
 
24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAs24HOP Introduction to Linux for SQL Server DBAs
24HOP Introduction to Linux for SQL Server DBAs
 
Installing odoo v8 from github
Installing odoo v8 from githubInstalling odoo v8 from github
Installing odoo v8 from github
 
Django dev-env-my-way
Django dev-env-my-wayDjango dev-env-my-way
Django dev-env-my-way
 
Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014Open Source Tools for Leveling Up Operations FOSSET 2014
Open Source Tools for Leveling Up Operations FOSSET 2014
 
#WeSpeakLinux Session
#WeSpeakLinux Session#WeSpeakLinux Session
#WeSpeakLinux Session
 
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
Continuous Delivery Workshop with Ansible x GitLab CI (2nd+)
 

Recently uploaded

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024Lorenzo Miniero
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Commit University
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyAlfredo García Lavilla
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Wonjun Hwang
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsSergiu Bodiu
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 

Recently uploaded (20)

Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024SIP trunking in Janus @ Kamailio World 2024
SIP trunking in Janus @ Kamailio World 2024
 
Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!Nell’iperspazio con Rocket: il Framework Web di Rust!
Nell’iperspazio con Rocket: il Framework Web di Rust!
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Commit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easyCommit 2024 - Secret Management made easy
Commit 2024 - Secret Management made easy
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
Bun (KitWorks Team Study 노별마루 발표 2024.4.22)
 
DevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platformsDevEX - reference for building teams, processes, and platforms
DevEX - reference for building teams, processes, and platforms
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 

Ultimate Unix Meetup Presentation

  • 1. Ultimate UNIX Setup For Developers Jacob Menke – Software Engineer && Business ComputerTechnologies LabTechnician (Ann Arbor MI)
  • 2. Boring and not too usable defaults…
  • 3.
  • 4. Config Files &&YouTubeTutorials • https://github.com/MenkeTechnologies/TutorialFiles • https://www.youtube.com/channel/UCLOQFBXPrcVvO2 Wb3wna8Ow • RecentTopics : GNU Readline Shortcuts in mysql, python3 and various REPLs • http://jakobmenke.com/
  • 5. Custom Shell functions • cd • aliases > functions > reserved words > builtins > external commands in PATH > not found
  • 6. • clearList == bash function • essentially: clear && ls -AlhFi
  • 7. Functions and aliases UNIX Spirit – One letter commands. The more cryptic and less typing the better
  • 9. Package Managers • Mac => Homebrew, MacPorts, Fink (old) • Homebrew HomePage => https://brew.sh/ • install => /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/ma ster/install)"
  • 10. Homebrew Jargon • Package == Formula == ruby file • installed into /usr/local/Cellar/<package> with symlinks into /usr/local/bin, /usr/local/lib etc • Taps == Github repositories • Homebrew Core Repo Formulae • downloaded to /usr/local/Homebrew/Library/taps/homebrew/homebrew- core/formula • Bottle == binary program already built for macOS (configure and make already done for you) • Cask == GUI program or font ie microsoft-office, intellij-idea
  • 13. Homebrew • brew install <package> • brew ls • brew rm <package> • brew search <package> • brew cleanup • brew update • brew upgrade • brew cask install <gui-package> • Brew cask rm <gui-package> (removes .app from /Applications) • brew cask zap <gui-package> (like brew cask rm but also removes all preferences files etc ie full deinstallation) • brew cask rm <gui>
  • 15. Package Managers • Linux • Debian based = Debian, Ubuntu, Mint, Raspbian, Kali • Dpkg, apt, aptitude • RPM based = Red Hat, Fedora, CentOS • Rpm, yum
  • 16. Apt • sudo apt-get install <package> • sudo apt-cache search <package> • sudo apt-get purge <package> • dpkg –l = list all installed packages • dpkg –L <package> = show files for this package • sudo apt-get update • sudo apt-get upgrade
  • 17. Tmux • Terminal Multiplexer • brew install tmux • sudo apt-get install tmux
  • 18.
  • 19.
  • 20.
  • 21.
  • 22. Tmux Commands • tmux = start server • tmux new-session –t <session-name> • tmux new-window –t <window-name> • tmux split-window = horizontal split pane • tmux list-sessions (tmux ls) = list sessions • tmux list-windows • tmux list-panes
  • 23. Tmux Commands • tmux attach –t <session-name> • tmux kill-session [–t <session-name>] • tmux kill-window [–t <window-name>] • tmux kill-pane [–t <pane>]
  • 25. Inside ofTmux • Prefix = defaults to ^B (Control B) but can be changed • <prefix> + % => vertical split • <prefix> + “ = horizontal split • <prefix> + c = new window • <prefix> + n = next window • <prefix> + p = previous window • <prefix> + : => command line inside tmux similar to vim • <prefix> + : then kill-pane = kills current pane • === tmux kill-pane
  • 26. ~/.tmux.conf • Prefix = defaults to control b but can be changed • These lines bind: • prefix to ^a • <prefix> - | to split vertically • <prefix> - - to split horizontally
  • 28. Tmux scripts • usually located in ~/.tmux directory • list of tmux commands to run • could be run as tmux selectp –t 0 or <prefix>+: selectp –t 0 • ~/.tmux/four-panes • ~/.tmux.conf
  • 31. Htop • brew install htop • sudo apt-get install htop • Similar to top but shows core usages • / to search • space to tag process • k to kill process
  • 33. ccze • brew install ccze • sudo apt-get install ccze • tail –f /var/log/**/*.log | ccze • sudo id = shows up in /var/log/system.log on Mac and /var/log/auth.log on Linux
  • 34. Logging with color bash script
  • 36. iftop • brew install iftop • sudo apt-get install iftop • sudo iftop –c ~/.iftop.conf • while running: • t = toggle bar display modes • q = quit • f = filter • h = help
  • 38. iftop - colorized • git clone https://github.com/MenkeTechnologies/iftopcolor • ./configure && make • sudo make install or move executable ./iftop to somewhere in PATH
  • 40. grc – general colorizer • https://github.com/garabik/grc • brew install grc • sudo apt-get install grc
  • 41. grc config files • Mac: /usr/local/share/grc/conf.ls • Linux:/usr/share/grc/conf.ls • each command that will be colorized has its corresponding config file • automatic aliases • usage: grc netstat • grc –c /usr/local/share/grc/conf.ls ping google.com
  • 42. Automatic Aliasing (Over aliases) • curl https://raw.githubusercontent.com/garabik/grc/master/grc.zsh - O $HOME/grc.zsh • ~/.zshrc : [[ -s ”$HOME/grc.zsh" ]] && source “$HOME/grc.zsh” • ping is now alias for grc ping
  • 43. grc uses regex for colorization
  • 44. grc demo • ping • ifconfig • dd • ps
  • 45. Python programs • Glances = pip package • Powerline status = pip package • brew install python = goes into /usr/local/Cellar/python/<version-number> • pip, package manager for python, should be included • Mac: pip installs packages to /usr/local/lib/python2.7/site- packages on • Debian: pip installs packages to /usr/local/lib/python2.7/dist- packages
  • 47. pip • pip install <package> • pip show <package> • for package in $(pip list –outdated);do pip install $package done
  • 48. Powerline • Status bars for vim, tmux • requires special fonts for triangles such as Nerd Fonts • https://github.com/ryanoasis/nerd-fonts • pip install powerline-status • ~/.tmux.conf • ~/.vimrc
  • 49. Powerline forVim • recommend to install latest vim 8+ • brew install vim • sudo apt-get install vim • brew install macvim (fastest for mac IMO) • mvim –v <file> = stay in terminal • mvim <file> = launch gui
  • 52. PowerlineTmux Status Bar • http://powerline.readthedocs.io/en/master/usage/other.h tml#tmux-statusline • Define tmux status line in JSON file => • $HOME/.config/powerline/themes/tmux
  • 54. My Prompt == Powerlevel 9k • https://github.com/bhilburn/power level9k • using Knack Nerd Font • brew tap caskroom/fonts • brew cask install font-hacknerd- font
  • 57. glances • pip install glances • on Mac installs to /usr/local/lib/python2.7/site- packages/glances • Debian installs to /usr/local/lib/python2.7/dist-packages • https://github.com/nicolargo/glances
  • 58. glances • sudo glances [--disable-alert] [--disable-network] […] • To change text color from white to blue: • Change line 203 in glances/outputs/glances_curses.py • curses.init_pair(1, curses.COLOR_WHITE, -1)=> • curses.init_pair(1, curses.COLOR_BLUE, -1)
  • 60. Oh-my-zsh • Framework for zsh, geared toward developers • Tons of prompts and plugins • https://github.com/robbyrussell/oh-my-zsh
  • 61. Oh my zsh install • sh -c "$(curl -fsSL https://raw.githubusercontent.com/robbyrussell/oh-my- zsh/master/tools/install.sh)”
  • 62. Oh my zsh Plugins • git clone into ~/.oh-my-zsh/custom/plugins • add to plugins array ~/.zshrc
  • 63. Zsh-autosuggestions • copy of FISH (friendly interactive shell)’s suggestions • Searches history (~/.zsh-history) for most recent commands starting with letters typed • hit right arrow to complete the suggestion • git clone https://github.com/zsh-users/zsh-autosuggestions $ZSH_CUSTOM/plugins/zsh-autosuggestions • add to plugins array in ~/.zshrc
  • 64. Zsh-syntax highlighting • Red if invalid command, green if found in PATH • highlighting for quotes • git clone https://github.com/zsh-users/zsh-syntax- highlighting.git ${ZSH_CUSTOM:-~/.oh-my- zsh/custom}/plugins/zsh-syntax-highlighting • add to plugins array in ~/.zshrc
  • 65. Zsh-completions • adds zsh completions for more commands • Adds zsh tab completions for many more commands such as caffeinate • git clone https://github.com/zsh-users/zsh-completions ~/.oh-my- zsh/custom/plugins/zsh-completions • add to plugins array in ~/.zshrc
  • 67. z command • creates database of visited directories • usage: z <directory-name> • directory-name can be just a few letters of the name • if there is a match you will cd to that directory otherwise no cd and returns 1
  • 68. z install • git clone https://raw.githubusercontent.com/rupa/z/master/z.sh $HOME • source ~/z.sh
  • 69. Zle line editor in ~/.zshrc 3) declare zsh function as widget 4) Bind widget function to Control-S key combination 1) Define zsh function 2) Define zsh function to be bound as widget. Calls above function with the contents of current command line as argument Type your commit message at prompt no quotes needed and then pressControl-S to add, commit and push to remote
  • 70. z and ZLE demo