SlideShare a Scribd company logo
1 of 37
Download to read offline
WHATIDOWITHLINUX
I have been using a Linux computer as my workstation for a long time
I nd it a productive environment, and having my tools available allows me to work
quickly
Author: Glen Ogilvie - nelg@linuxsolutions.co.nz
Date: July 2017
This work is licensed under a .Creative Commons Attribution-NonCommercial-ShareAlike 3.0 New Zealand License
How many people use a Linux based computer for work?
svg@presentations:automation:work_people
TALKOUTLINE
SSH
SSH agent (launch on start, adding keys)
Quick launch
Desktop apps ( yakuake, meld, clipper, keepass, kde connect)
Command line (syntax highlighting, prompt, history, script, path,
aliases)
version your home dir con guration (mr, vcsh, git)
Bash LS colors
Bash shortcuts
Bash variable regex, loops and
expansion
Powerline
Ansible OS setup
sudo
su
groups
network manager dispatcher
keep notes
SSH
1. use ssh keys
2. use ssh agent
3. have an .ssh/con g
le
Socks, and ssh keys: ~? (~C)
ssh -A
ssh -D 5555
.SSH/CONFIG
ProxyJump can be used twice
.ssh/con g
Host *
ControlMaster auto
ControlPath /home/nxxx/tmp/ssh-%r@%h:%p
PubkeyAcceptedKeyTypes=+ssh-dss
Host jump
Hostname jxxxxx01.xxx.co.nz
User gxxxxxxe
IdentityFile
ProxyJump jump
SSHAGENT
1. ssh-add more than one key
2. ssh keys should have
passphrases
3. ssh-agent -t 36000
4. ssh-add -D
/ETC/SSH/SSHD_CONFIG
MaxAuthTries 10 # too low on some systems
PermitRootLogin without-password
AllowAgentForwarding yes
AllowTcpForwarding yes
DESKTOP
Learn about your desktop quick
launch
krunner demo
Set a convenient short cut to start it
TERMINALEMULATOR
For command line access, use a terminal emulator that is sophisticated, such as
Konsole. It should have tabs scrolling, multi window input, search, with colour
highlighting, control of colours, If you want a qauke style console, play with yakuake
UNDERSTANDYOURCLIPBOARD
Linux desktops have a love/hate clipboard. Basically, we have 2 clipboards, in a
standard Xwindows environment. One owned by the window manager, and one by X.
X will put selected text into it's clip board, and paste using the middle mouse button.
Window managers copy and paste using shortcut keys, and sync with the X clipboard
sometime.
Clipper, a KDE app, gives you a clipboard history, this can make you more productive
PASSWORDS
Use a password manager, or some sort, to manage your passwords. Keepass, the one
I use, has an auto type feature. This will basically, press alt-tab, type username, tab,
type password, press enter. It's pretty handy.
KDECONNECT
Even for non-kde. Get KDE connect.
Pairs with your phone, allows sending les, noti cations, remote commands and
remote control.
- Demo
RESEARCHANDFINDUSEFULAPPS
Various people do di erent things with Linux. Finding the right applications can really
improve productivity. A good editor, such as Atom, Subline, Visual Studio code and
others, can make editing les productive. A merge tool such as meld can help with
comparing les. A good phone editor, or having the language and fonts setup in your
o ce suite.
GETCROSSOVEROFFICEIFYOUNEEDIT
Demo of running word
COMMANDLINE
ORGANIZEYOUR.BASHRC
if [ -f /etc/bashrc ]; then
. /etc/bashrc
fi
HOSTNAMESHORT=${HOSTNAME/.*/}
# Source Host specific config
if [ -d $HOME/.bash.d/$HOSTNAMESHORT ]; then
for i in $HOME/.bash.d/$HOSTNAMESHORT/*; do
. $i
done
fi
if [ -f ~/.bash_aliases ]; then
. ~/.bash_aliases
fi
HISTORY
# don't put duplicate lines or lines starting with space in the history.
# See bash(1) for more options
HISTCONTROL=ignoreboth
export HISTSIZE=200000
export HISTTIMEFORMAT="%Y-%m-%d %T "
# append to the history file, don't overwrite it
shopt -s histappend
SYNTAXHIGHLIGHTING
alias ccat='pygmentize -f terminal256 -Ostyle=native -g --'
alias prettyjson='python -m json.tool'
if which pygmentize > /dev/null 2>&1; then
# Coloured tools
PYGMENTIZE_STYLE="native"
# PYGMENTIZE_STYLE="friendly"
alias ccat="pygmentize -f terminal256 -Ostyle=${PYGMENTIZE_STYLE} -g --"
export LESSOPEN="|pygmentize -f terminal256 -Ostyle=${PYGMENTIZE_STYLE} -g %s"
export LESS="-isMR --shift 5"
fi
# Set dir colours
if [ -f ~/.config/LS_COLORS/LS_COLORS ]; then
eval $( dircolors -b ~/.config/LS_COLORS/LS_COLORS )
fi
OTHERSYNTAXHIGHLIGHTING
jq
.vim/syntax and .vimrc with let &t_Co=256
lnav
syntax highlighting for your editor (atom, kwrite,
etc)
https://github.com/ogham/exa
THE LOG FILE NAVIGATOR ABOUT DOWNLOADS FEATURES DOCUMENTATION PROJECT BLOG
Single Log View
All log file contents are merged into a single view based on message timestamps.  You no longer need to manually
correlate timestamps across multiple windows or figure out the order in which to view rotated log files.  The color
bars on the left-hand side help to show which file a message belongs to.
Automatic Log Format Detection
COMMANDCOMPLETION
bash-completion package: .bash_completion
[ -f ~/aws/bin/aws_completer ] && complete -C ~/aws/bin/aws_completer aws
[ -f ~/aws/bin/eb_completion.bash ] && source ~/aws/bin/eb_completion.bash
SHELLRECORDING
# Shell recording
if [ -d ~/recordings ]; then
if which script >/dev/null 2>&1; then
alias inss='echo $IN_SCRIPT_SESSION'
alias in_script=inss
if [[ $IN_SCRIPT_SESSION ]] ; then
return;
fi
DD=`date +%F`
TTY=`tty | sed -e 's///-/g'`
N=$DD$TTY
export IN_SCRIPT_SESSION=$TTY
exec script -q -a -f -t 2>> ~/recordings/$N-timingfile ~/recordings/$N-myactions.typescript;
fi
fi
FUNCTIONS
# Re tool
re() { local x p=$PWD; for x do p=${p/${x%%=*}/${x#*=}} ; done ; cd $p ; }
# Loop and pull all git modules
function git-pullall {
p=`pwd`;
for i in $(find -L . -name ".git" -type d );
do cd `dirname $i`;
git pull;
cd $p;
done;
};
VERSIONCONTROLYOUR
HOMEDIR
myrepos, vcsh and bash
ccat .mrconfig
ccat ~/.config/mr/config.d/bash.vcsh
ls ~/.config/vcsh/repo.d/bash.git/
vcsh enter bash
git status
https://myrepos.branchable.com/
BASHSHORTCUTS
ctrl - r, etc
The Best Keyboard Shortcuts for Bash (aka the Linux
and macOS Terminal)
by Lowell Heddings on March 17th, 2017
Bash is the default command-line shell on most Linux distributions, from Ubuntu and
Debian to Red Hat and Fedora. Bash is also the default shell included with macOS, and
you can install a Linux-based bash environment on Windows 10.
The bash shell features a wide variety of keyboard shortcuts you can use. These will
work in bash on any operating system. Some of them may not work if you’re accessing
bash remotely through an SSH or telnet session, depending on how you have your keys
mapped.
Working With Processes
Use the following shortcuts to manage running processes.
DID YOU KNOW
The term shrapnel, fragmentation thrown out by an
exploding munition or bomb, comes to us by way of
Henry Shrapnel, a British o cer who invented the
rst anti-personnel round–an explosive hollow
cannon ball lled with lead shot–in 1784.
BEST OF HOW-TO GEEK
Nest vs. Ecobee3 vs. Honeywell Lyric:
Which Smart Thermostat Should You
Buy?
How to Lock Down Your Android Tablet
or Smartphone for Kids
What Is the Windows Event Viewer, and
How Can I Use It?
How to Fax a Document From Your
Smartphone
BASHVARIABLES,LOOPS
Take some time to learn about bash. Such as:
we have: a variable, a loop, using a shell expansion glob, a regex removing .tf, a
command using variable and an output.
p=; for i in [a-s]*; do a=${i/.tf/};
terraforming $a --tfstate --merge terraform.tfstate$p > terraform.tfstate.$a ; p=".$a"; done
but… this is not a bash tutorial.
svg@presentations:automation:gnu-bash-logo
POWERLINE
Powerline, is a tool that gives you a fancy prompt in the shell and a fancy setup in vim.
https://github.com/Lokaltog/vim-
powerline
. /usr/share/powerline/bash/powerline.sh
NETWORKAWARE
SETTINGS
Network manager, is pretty much what we all use to setup our network connections.
It can run scripts when it connects. Example:
Turn on services you need only at work, when at work
Have your system do what you want, when it is where you can predict
#!/bin/bash
IF=$1
STATUS=$2
vpnstate="start"
/sbin/ip a | grep 192.168.88 -q && vpnstate="stop"
if [ "$2" == "up" ]; then
systemctl $vpnstate openvpn@pup-client.service
fi;
AUTOMATETHESETUP
OFYOURLAPTOP
We tend to have to setup a new laptop every now and then, as OS upgrades, new
hardware, etc, happen.
Having done this a number of times, trying to remember all the packages you want is
hard.
Trying to remember how you got a speci c OS component setup is also hard.
I used Ansbile, because it is an easy way to get better with it.
- hosts: localhost
vars_files:
- vars.yml
become: true
tasks:
- name: Mageia packages
package:
name: "{{ item }}"
state: present
with_items:
- aircrack-ng
- airsnort
- amarok
Distro Packages
Commercial Packages
Unpackaged programs
Ruby Gems
Python pip
Sudoers con g, pam con g
Network manager con g
VPN con guration
Wi settings
Services you want stopped / started (who wants teamviewerd running all the
time?)
Autofs setup
Git checkouts
Firewall con g
Cloud tools (awscli, command completion, etc)
Dropbox setup
ANSIBLECONFIG
Running:
ansible.cfg
[defaults]
host_key_checking = false
inventory = hosts
squash_actions = urpmi
hosts
[laptop]
localhost ansible_connection=local
ansible-playbook laptop.yml
GENERALADVICEFOR
LAPTOPSETUP
Use the hardware encryption for the disk, in BIOS
Use the nger print reader if supported
Encrypt partitions if you don't have hardware encryption (with Luks)
Have an upgrade partition so you can go back to the old version
HiDPI screens work OK. - but buy hardware someone else has tried / solved the
problems for you
Expect to use UEFI. It can work these days OK. You can end up with multiple
di erent boot loaders
KEEPNOTES
Keeping notes is a good idea. It's easy to forget how you set something up 2 years
later.
I use dokuwiki, running locally on each computer I use. It's handy to keep my notes.
Useful applications (name, short
description)
Useful con gurations
Short cut keys
Links and Guides
Commands you've gured out
Things you nd helpful

More Related Content

What's hot

How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...Puppet
 
Learning Puppet Chapter 1
Learning Puppet Chapter 1Learning Puppet Chapter 1
Learning Puppet Chapter 1Vishal Biyani
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy Systemadrian_nye
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with AugeasPuppet
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)Soshi Nemoto
 
Fabric-让部署变得简单
Fabric-让部署变得简单Fabric-让部署变得简单
Fabric-让部署变得简单Eric Lo
 
Fullstack Academy - Awesome Web Dev Tips & Tricks
Fullstack Academy - Awesome Web Dev Tips & TricksFullstack Academy - Awesome Web Dev Tips & Tricks
Fullstack Academy - Awesome Web Dev Tips & TricksFrances Coronel
 
DevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementDevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementFelipe
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environmentSoshi Nemoto
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyAndré Rømcke
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantBrian Hogan
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeSoshi Nemoto
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)Soshi Nemoto
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environmentbocribbz
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015ice799
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and ChefDavid Benjamin
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)Soshi Nemoto
 

What's hot (19)

How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
How Puppet Enables the Use of Lightweight Virtualized Containers - PuppetConf...
 
Learning Puppet Chapter 1
Learning Puppet Chapter 1Learning Puppet Chapter 1
Learning Puppet Chapter 1
 
Fabric: A Capistrano Alternative
Fabric:  A Capistrano AlternativeFabric:  A Capistrano Alternative
Fabric: A Capistrano Alternative
 
A Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy SystemA Fabric/Puppet Build/Deploy System
A Fabric/Puppet Build/Deploy System
 
Configuration Surgery with Augeas
Configuration Surgery with AugeasConfiguration Surgery with Augeas
Configuration Surgery with Augeas
 
DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)DevOps(3) : Ansible - (MOSG)
DevOps(3) : Ansible - (MOSG)
 
Fabric-让部署变得简单
Fabric-让部署变得简单Fabric-让部署变得简单
Fabric-让部署变得简单
 
Fullstack Academy - Awesome Web Dev Tips & Tricks
Fullstack Academy - Awesome Web Dev Tips & TricksFullstack Academy - Awesome Web Dev Tips & Tricks
Fullstack Academy - Awesome Web Dev Tips & Tricks
 
DevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration managementDevOps Series: Extending vagrant with Puppet for configuration management
DevOps Series: Extending vagrant with Puppet for configuration management
 
Instruction: dev environment
Instruction: dev environmentInstruction: dev environment
Instruction: dev environment
 
Getting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and SymfonyGetting instantly up and running with Docker and Symfony
Getting instantly up and running with Docker and Symfony
 
Create Development and Production Environments with Vagrant
Create Development and Production Environments with VagrantCreate Development and Production Environments with Vagrant
Create Development and Production Environments with Vagrant
 
Making environment for_infrastructure_as_code
Making environment for_infrastructure_as_codeMaking environment for_infrastructure_as_code
Making environment for_infrastructure_as_code
 
Putting some "logic" in LVM.
Putting some "logic" in LVM.Putting some "logic" in LVM.
Putting some "logic" in LVM.
 
Preparation study of_docker - (MOSG)
Preparation study of_docker  - (MOSG)Preparation study of_docker  - (MOSG)
Preparation study of_docker - (MOSG)
 
Vagrant - Version control your dev environment
Vagrant - Version control your dev environmentVagrant - Version control your dev environment
Vagrant - Version control your dev environment
 
Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015Puppet Camp LA 2/19/2015
Puppet Camp LA 2/19/2015
 
Capistrano, Puppet, and Chef
Capistrano, Puppet, and ChefCapistrano, Puppet, and Chef
Capistrano, Puppet, and Chef
 
DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)DevOps(4) : Ansible(2) - (MOSG)
DevOps(4) : Ansible(2) - (MOSG)
 

Similar to Aucklug slides - desktop tips and tricks

Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...Jim Birch
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetesWilliam Stewart
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to KubernetesPaul Czarkowski
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0venkatakrishnan k
 
Baylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStackBaylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStackJesse Andrews
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentationbrian_dailey
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn WorkshopBastian Feder
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHDavid Stockton
 
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeEmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeMatt Ray
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Keith Resar
 
Muraliupdatedpersonal091215
Muraliupdatedpersonal091215Muraliupdatedpersonal091215
Muraliupdatedpersonal091215Murali Krishna R
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesPuppet
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakNETWAYS
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Amin Astaneh
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShellBoulos Dib
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modulesmohamedmoharam
 

Similar to Aucklug slides - desktop tips and tricks (20)

Command line for the beginner - Using the command line in developing for the...
Command line for the beginner -  Using the command line in developing for the...Command line for the beginner -  Using the command line in developing for the...
Command line for the beginner - Using the command line in developing for the...
 
Kubernetes laravel and kubernetes
Kubernetes   laravel and kubernetesKubernetes   laravel and kubernetes
Kubernetes laravel and kubernetes
 
THE BASIC TOOLS
THE BASIC TOOLSTHE BASIC TOOLS
THE BASIC TOOLS
 
A DevOps guide to Kubernetes
A DevOps guide to KubernetesA DevOps guide to Kubernetes
A DevOps guide to Kubernetes
 
Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0Power point on linux commands,appache,php,mysql,html,css,web 2.0
Power point on linux commands,appache,php,mysql,html,css,web 2.0
 
Linux presentation
Linux presentationLinux presentation
Linux presentation
 
Baylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStackBaylisa - Dive Into OpenStack
Baylisa - Dive Into OpenStack
 
NYPHP March 2009 Presentation
NYPHP March 2009 PresentationNYPHP March 2009 Presentation
NYPHP March 2009 Presentation
 
Eclipse HandsOn Workshop
Eclipse HandsOn WorkshopEclipse HandsOn Workshop
Eclipse HandsOn Workshop
 
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSHTame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
Tame Your Build And Deployment Process With Hudson, PHPUnit, and SSH
 
One-Man Ops
One-Man OpsOne-Man Ops
One-Man Ops
 
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP ModeEmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
EmacsConf 2019: Interactive Remote Debugging and Development with TRAMP Mode
 
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
Ansible Automation Best Practices From Startups to Enterprises - Minnebar 12
 
Muraliupdatedpersonal091215
Muraliupdatedpersonal091215Muraliupdatedpersonal091215
Muraliupdatedpersonal091215
 
Workflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large EnterprisesWorkflow story: Theory versus practice in Large Enterprises
Workflow story: Theory versus practice in Large Enterprises
 
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin PiebiakWorkflow story: Theory versus Practice in large enterprises by Marcin Piebiak
Workflow story: Theory versus Practice in large enterprises by Marcin Piebiak
 
Security Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-CodeSecurity Testing Using Infrastructure-As-Code
Security Testing Using Infrastructure-As-Code
 
Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)Linux Server Deep Dives (DrupalCon Amsterdam)
Linux Server Deep Dives (DrupalCon Amsterdam)
 
Introduction to PowerShell
Introduction to PowerShellIntroduction to PowerShell
Introduction to PowerShell
 
Ansible automation tool with modules
Ansible automation tool with modulesAnsible automation tool with modules
Ansible automation tool with modules
 

Recently uploaded

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
 
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
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...OnePlan Solutions
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
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
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxTier1 app
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...Christina Lin
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWave PLM
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantAxelRicardoTrocheRiq
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptkotipi9215
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxnada99848
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)OPEN KNOWLEDGE GmbH
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideChristina Lin
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...MyIntelliSource, Inc.
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based projectAnoyGreter
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 

Recently uploaded (20)

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
 
Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...Advancing Engineering with AI through the Next Generation of Strategic Projec...
Advancing Engineering with AI through the Next Generation of Strategic Projec...
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
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
 
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptxKnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
KnowAPIs-UnknownPerf-jaxMainz-2024 (1).pptx
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
ODSC - Batch to Stream workshop - integration of Apache Spark, Cassandra, Pos...
 
What is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need ItWhat is Fashion PLM and Why Do You Need It
What is Fashion PLM and Why Do You Need It
 
Salesforce Certified Field Service Consultant
Salesforce Certified Field Service ConsultantSalesforce Certified Field Service Consultant
Salesforce Certified Field Service Consultant
 
chapter--4-software-project-planning.ppt
chapter--4-software-project-planning.pptchapter--4-software-project-planning.ppt
chapter--4-software-project-planning.ppt
 
software engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptxsoftware engineering Chapter 5 System modeling.pptx
software engineering Chapter 5 System modeling.pptx
 
Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)Der Spagat zwischen BIAS und FAIRNESS (2024)
Der Spagat zwischen BIAS und FAIRNESS (2024)
 
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop SlideBuilding Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
Building Real-Time Data Pipelines: Stream & Batch Processing workshop Slide
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
Steps To Getting Up And Running Quickly With MyTimeClock Employee Scheduling ...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
MYjobs Presentation Django-based project
MYjobs Presentation Django-based projectMYjobs Presentation Django-based project
MYjobs Presentation Django-based project
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 

Aucklug slides - desktop tips and tricks

  • 1. WHATIDOWITHLINUX I have been using a Linux computer as my workstation for a long time I nd it a productive environment, and having my tools available allows me to work quickly Author: Glen Ogilvie - nelg@linuxsolutions.co.nz Date: July 2017 This work is licensed under a .Creative Commons Attribution-NonCommercial-ShareAlike 3.0 New Zealand License
  • 2. How many people use a Linux based computer for work? svg@presentations:automation:work_people
  • 3. TALKOUTLINE SSH SSH agent (launch on start, adding keys) Quick launch Desktop apps ( yakuake, meld, clipper, keepass, kde connect) Command line (syntax highlighting, prompt, history, script, path, aliases) version your home dir con guration (mr, vcsh, git)
  • 4. Bash LS colors Bash shortcuts Bash variable regex, loops and expansion Powerline Ansible OS setup sudo su groups network manager dispatcher keep notes
  • 5. SSH 1. use ssh keys 2. use ssh agent 3. have an .ssh/con g le Socks, and ssh keys: ~? (~C) ssh -A ssh -D 5555
  • 6. .SSH/CONFIG ProxyJump can be used twice .ssh/con g Host * ControlMaster auto ControlPath /home/nxxx/tmp/ssh-%r@%h:%p PubkeyAcceptedKeyTypes=+ssh-dss Host jump Hostname jxxxxx01.xxx.co.nz User gxxxxxxe IdentityFile ProxyJump jump
  • 7. SSHAGENT 1. ssh-add more than one key 2. ssh keys should have passphrases 3. ssh-agent -t 36000 4. ssh-add -D
  • 8. /ETC/SSH/SSHD_CONFIG MaxAuthTries 10 # too low on some systems PermitRootLogin without-password AllowAgentForwarding yes AllowTcpForwarding yes
  • 9. DESKTOP Learn about your desktop quick launch krunner demo Set a convenient short cut to start it
  • 10. TERMINALEMULATOR For command line access, use a terminal emulator that is sophisticated, such as Konsole. It should have tabs scrolling, multi window input, search, with colour highlighting, control of colours, If you want a qauke style console, play with yakuake
  • 11. UNDERSTANDYOURCLIPBOARD Linux desktops have a love/hate clipboard. Basically, we have 2 clipboards, in a standard Xwindows environment. One owned by the window manager, and one by X. X will put selected text into it's clip board, and paste using the middle mouse button. Window managers copy and paste using shortcut keys, and sync with the X clipboard sometime. Clipper, a KDE app, gives you a clipboard history, this can make you more productive
  • 12. PASSWORDS Use a password manager, or some sort, to manage your passwords. Keepass, the one I use, has an auto type feature. This will basically, press alt-tab, type username, tab, type password, press enter. It's pretty handy.
  • 13. KDECONNECT Even for non-kde. Get KDE connect. Pairs with your phone, allows sending les, noti cations, remote commands and remote control. - Demo
  • 14. RESEARCHANDFINDUSEFULAPPS Various people do di erent things with Linux. Finding the right applications can really improve productivity. A good editor, such as Atom, Subline, Visual Studio code and others, can make editing les productive. A merge tool such as meld can help with comparing les. A good phone editor, or having the language and fonts setup in your o ce suite.
  • 17. ORGANIZEYOUR.BASHRC if [ -f /etc/bashrc ]; then . /etc/bashrc fi HOSTNAMESHORT=${HOSTNAME/.*/} # Source Host specific config if [ -d $HOME/.bash.d/$HOSTNAMESHORT ]; then for i in $HOME/.bash.d/$HOSTNAMESHORT/*; do . $i done fi if [ -f ~/.bash_aliases ]; then . ~/.bash_aliases fi
  • 18. HISTORY # don't put duplicate lines or lines starting with space in the history. # See bash(1) for more options HISTCONTROL=ignoreboth export HISTSIZE=200000 export HISTTIMEFORMAT="%Y-%m-%d %T " # append to the history file, don't overwrite it shopt -s histappend
  • 19. SYNTAXHIGHLIGHTING alias ccat='pygmentize -f terminal256 -Ostyle=native -g --' alias prettyjson='python -m json.tool' if which pygmentize > /dev/null 2>&1; then # Coloured tools PYGMENTIZE_STYLE="native" # PYGMENTIZE_STYLE="friendly" alias ccat="pygmentize -f terminal256 -Ostyle=${PYGMENTIZE_STYLE} -g --" export LESSOPEN="|pygmentize -f terminal256 -Ostyle=${PYGMENTIZE_STYLE} -g %s" export LESS="-isMR --shift 5" fi # Set dir colours if [ -f ~/.config/LS_COLORS/LS_COLORS ]; then eval $( dircolors -b ~/.config/LS_COLORS/LS_COLORS ) fi
  • 20. OTHERSYNTAXHIGHLIGHTING jq .vim/syntax and .vimrc with let &t_Co=256 lnav syntax highlighting for your editor (atom, kwrite, etc) https://github.com/ogham/exa
  • 21. THE LOG FILE NAVIGATOR ABOUT DOWNLOADS FEATURES DOCUMENTATION PROJECT BLOG Single Log View All log file contents are merged into a single view based on message timestamps.  You no longer need to manually correlate timestamps across multiple windows or figure out the order in which to view rotated log files.  The color bars on the left-hand side help to show which file a message belongs to. Automatic Log Format Detection
  • 22. COMMANDCOMPLETION bash-completion package: .bash_completion [ -f ~/aws/bin/aws_completer ] && complete -C ~/aws/bin/aws_completer aws [ -f ~/aws/bin/eb_completion.bash ] && source ~/aws/bin/eb_completion.bash
  • 23. SHELLRECORDING # Shell recording if [ -d ~/recordings ]; then if which script >/dev/null 2>&1; then alias inss='echo $IN_SCRIPT_SESSION' alias in_script=inss if [[ $IN_SCRIPT_SESSION ]] ; then return; fi DD=`date +%F` TTY=`tty | sed -e 's///-/g'` N=$DD$TTY export IN_SCRIPT_SESSION=$TTY exec script -q -a -f -t 2>> ~/recordings/$N-timingfile ~/recordings/$N-myactions.typescript; fi fi
  • 24. FUNCTIONS # Re tool re() { local x p=$PWD; for x do p=${p/${x%%=*}/${x#*=}} ; done ; cd $p ; } # Loop and pull all git modules function git-pullall { p=`pwd`; for i in $(find -L . -name ".git" -type d ); do cd `dirname $i`; git pull; cd $p; done; };
  • 25. VERSIONCONTROLYOUR HOMEDIR myrepos, vcsh and bash ccat .mrconfig ccat ~/.config/mr/config.d/bash.vcsh ls ~/.config/vcsh/repo.d/bash.git/ vcsh enter bash git status https://myrepos.branchable.com/
  • 27. The Best Keyboard Shortcuts for Bash (aka the Linux and macOS Terminal) by Lowell Heddings on March 17th, 2017 Bash is the default command-line shell on most Linux distributions, from Ubuntu and Debian to Red Hat and Fedora. Bash is also the default shell included with macOS, and you can install a Linux-based bash environment on Windows 10. The bash shell features a wide variety of keyboard shortcuts you can use. These will work in bash on any operating system. Some of them may not work if you’re accessing bash remotely through an SSH or telnet session, depending on how you have your keys mapped. Working With Processes Use the following shortcuts to manage running processes. DID YOU KNOW The term shrapnel, fragmentation thrown out by an exploding munition or bomb, comes to us by way of Henry Shrapnel, a British o cer who invented the rst anti-personnel round–an explosive hollow cannon ball lled with lead shot–in 1784. BEST OF HOW-TO GEEK Nest vs. Ecobee3 vs. Honeywell Lyric: Which Smart Thermostat Should You Buy? How to Lock Down Your Android Tablet or Smartphone for Kids What Is the Windows Event Viewer, and How Can I Use It? How to Fax a Document From Your Smartphone
  • 28. BASHVARIABLES,LOOPS Take some time to learn about bash. Such as: we have: a variable, a loop, using a shell expansion glob, a regex removing .tf, a command using variable and an output. p=; for i in [a-s]*; do a=${i/.tf/}; terraforming $a --tfstate --merge terraform.tfstate$p > terraform.tfstate.$a ; p=".$a"; done
  • 29. but… this is not a bash tutorial. svg@presentations:automation:gnu-bash-logo
  • 30. POWERLINE Powerline, is a tool that gives you a fancy prompt in the shell and a fancy setup in vim. https://github.com/Lokaltog/vim- powerline . /usr/share/powerline/bash/powerline.sh
  • 31. NETWORKAWARE SETTINGS Network manager, is pretty much what we all use to setup our network connections. It can run scripts when it connects. Example: Turn on services you need only at work, when at work Have your system do what you want, when it is where you can predict #!/bin/bash IF=$1 STATUS=$2 vpnstate="start" /sbin/ip a | grep 192.168.88 -q && vpnstate="stop" if [ "$2" == "up" ]; then systemctl $vpnstate openvpn@pup-client.service fi;
  • 32. AUTOMATETHESETUP OFYOURLAPTOP We tend to have to setup a new laptop every now and then, as OS upgrades, new hardware, etc, happen. Having done this a number of times, trying to remember all the packages you want is hard. Trying to remember how you got a speci c OS component setup is also hard.
  • 33. I used Ansbile, because it is an easy way to get better with it. - hosts: localhost vars_files: - vars.yml become: true tasks: - name: Mageia packages package: name: "{{ item }}" state: present with_items: - aircrack-ng - airsnort - amarok
  • 34. Distro Packages Commercial Packages Unpackaged programs Ruby Gems Python pip Sudoers con g, pam con g Network manager con g VPN con guration Wi settings Services you want stopped / started (who wants teamviewerd running all the time?) Autofs setup Git checkouts Firewall con g Cloud tools (awscli, command completion, etc) Dropbox setup
  • 35. ANSIBLECONFIG Running: ansible.cfg [defaults] host_key_checking = false inventory = hosts squash_actions = urpmi hosts [laptop] localhost ansible_connection=local ansible-playbook laptop.yml
  • 36. GENERALADVICEFOR LAPTOPSETUP Use the hardware encryption for the disk, in BIOS Use the nger print reader if supported Encrypt partitions if you don't have hardware encryption (with Luks) Have an upgrade partition so you can go back to the old version HiDPI screens work OK. - but buy hardware someone else has tried / solved the problems for you Expect to use UEFI. It can work these days OK. You can end up with multiple di erent boot loaders
  • 37. KEEPNOTES Keeping notes is a good idea. It's easy to forget how you set something up 2 years later. I use dokuwiki, running locally on each computer I use. It's handy to keep my notes. Useful applications (name, short description) Useful con gurations Short cut keys Links and Guides Commands you've gured out Things you nd helpful