The Linux Philosophy for SysAdmins And Everyone Who Wants To Be
One by David Both
- About the Author xix
- About the Technical Reviewer xxi
- Acknowledgments xxiii
Part I: Introduction 1
Chapter 1: Introduction to the Linux Philosophy 3
- Am I a SysAdmin? 5
- The Structure of the Philosophy 7
- Who Should Read This Book 9
- But I Don't Meet Those Requirements 10
- Who Should Not Read This Book 11
- The Linux Truth 11
- Restrictive Operating Systems 12
- Linux Is Open and Free 12
- Real Knowledge 13
- Enlightenment 14
Chapter 2: Getting Ready 15
- The Experiments 15
- System Requirements 17
- How to Access the Command Line 18
- Create the Student User 19
- Preparing the USB Thumb Drive 19
- What to Do if the Experiments Do Not Work 21
- Pseudo Terminal 117
- Session 117
- Shell 118
- Secure Shell (SSH) 121
- Screen 121
- The GUI and the CU 124
- Non-Restrictive Interface 125
- The Mailing List 125
- Baffle Them with Big Data 128
- CLI Power 130
Chapter 8: Be a Lazy SysAdmin 131
- Preparation 131
- True Productivity .. 132
- Preventative Maintenance 133
- Minimize Typing 134
- Aliases 134
- Other Typing Shortcuts 136
- File Naming 136
- BASH Efficiency 136
- Completion Facility 136
- Command-Une Recall and Editing 139
- History 139
- Using the History 140
- Logs Are Your Friend 146
- SAR 146
- Mail Logs 149
- messages 150
- dmesg 151
- secure .. 152
- systemd Logs 156
- logwatch 160
- Success as a Lazy SysAdmin 163
Chapter 9: Automate Everything 165
- Why l Use Scripts 165
- How I Got Here 166
- Scripting Repetitive Tasks 167
- Making It Easier 167
- From Desirable to Necessity 168
- Updates 169
- Additional Levels of Automation 181
- Using cron for Timely Automation 183
- crontab 183
- cron.d 186
- anacron 188
- Scheduling Tips 190
- Thoughts About cron 190
- cron Resources 191
- Other Automation Possibilities 191
- Some Alt Ideas 192
- Deepening the Philosophy 192
Chapter 10: Always Use Shell Scripts 195
- Definition 195
- The SysAdmin Context 197
- Requirements 197
- Development Speed 198
- Performance Speed 199
- Variables 200
- Testing 200
- Open and Open Source 201
- Shell Scripts as Prototypes 201
Process 202
- Quick and Dirty 202
- Planning and Foresight 203
- Final Thoughts 215
Chapter 11: Test Early, Test Often 217
- Procedures 218
- Create a Test Plan 218
- Start Testing at the Beginning 220
- Final Testing 220
- Testing in Production 221
- Fuzzy Testing 222
- Automated Testing 223
- Trying It Out 224
- Requirements for MOTD Script 225
- Test Plan for MOTD Script 226
- Developing the Script 227
- Add Sanity Checks 231
- Fixing a Script 245
- Summary 246
Chapter 12: Use Commonsense Naming 247
- Script and Program Names 247
- Variables 250
- Naming Variables 250
- Make Everything a Variable 251
- Procedures 255
- Hosts 255
- Organizational Naming 256
- Summary 256
- Open Is Knowable 258
- Flat ASCII Text 259
- System Configuration Files 260
- Global Bash Configuration 265
- User Configuration Files 268
- ASCII Rocks 270
- Final Thoughts 272
Chapter 14: Use Separate filesystems for Data 273
- Why We Need Separate filesystems 273
- Hard Drive Crashes 274
- Full filesystems 274
- Laptop Lament 275
- Data Security 278
- Recommendations 279
- /boot. 280
- /home 281
- /usr 282
- /opt 283
- /var 283
Лтр 284
The Other Branches 284
Starting with Separate filesystems 285
Adding Separate filesystems Later 285
Final Thoughts 292
Part IV: Becoming Zen 325
Chapter 17: Strive for Elegance 327
- Hardware Elegance 327
- ThePC8 328
- Motherboards 328
- Computers 329
- Data Centers 329
- Power and Grounding 330
- Software Elegance 331
- Fixing My Web Site 336
- Removing Crutt 338
- Old or Unused Programs 338
- Old Code In Scripts 342
- Old Files 343
- A Final Word 350
Chapter 18: Find the Simplicity 353
- Complexity in Numbers 353
- Simplicity In Basics 355
- The Never-Ending Process of Simplification 356
- Simple Programs Do One Thing 356
- Simple Programs Are Small 359
- Simplicity and the Philosophy 361
- Simplifying My Own Programs 361
- Simplifying Others’ Programs 362
- Uncommented Code 362
- Hardware 367
- Linux and Hardware 368
- The Quandary. 369
- The Last Word
Chapter 19: Use Your Favorite Editor 371
- More Than Editors 372
- Linux Startup 372
- Why I Prefer SystemV 373
- Why I Prefer systemd 373
- The Real Issue 374
- Desktop 374
- sudo or Not sudo 375
- Bypass sudo 376
- Valid Uses for sudo 378
- A Few Closing Words 379
Chapter 20: Document Everything 381
- The Red Baron 382
- My Documentation Philosophy 383
- The Help Option 383
- Comment Code Liberally 384
- My Code Documentation Process 387
- Man Pages 388
- Systems Documentation 388
- System Documentation Template 389
- Document Existing Code 392
- Keep Docs Updated 393
- File Compatibility 393
- A Few Thoughts 394
Chapter 21: Back Up Everything - Frequently 395
- Data Loss 395
- Backups to the Rescue 397
- The Problem 397
- Recovery 404
- Doing It My Way 405
- Backup Options 405
- Off-Site Backups 413
- Disaster Recovery Services 414
- Other Options 415
- What About the "Frequently" Part? 415
- Summary 415
Chapter 22: Follow Your Curiosity 417
- Charlie 417
- Curiosity Led Me to Linux 418
- Curiosity Solves Problems 423
- Securiosity 423
- Follow Your Own Curiosity 440
- Be an Author 441
- Failure Is an Option 441
- Just Do It 442
- Summary 443
Chapter 23: There Is No Should 445
- There Are Always Possibilities 445
- Unleashing the Power 446
- Problem Solving 447
- Critical Thinking 449
- Reasoning to Solve Problems 450
- Integrated Reason 453
- Self-Knowledge 455
- Finding Your Center 455
- The Implications of Diversity 456
- Measurement Mania 457
- The Good Manager 458
- Working Together 458
- Silo City „..460
The Easy Way 461
Thoughts 462
Chapter 24: Mentor the Young SysAdmins 463
- Hiring the Right People 464
- Mentoring 465
- BRuce the Mentor 466
- The Art of Problem Solving 467
- The Five Steps ot Problem Solving 467
- Knowledge 469
- Observation 469
- Reasoning 472
- Action 473
- Test 473
- Example 474
- Iteration 475
- Concluding Thoughts 475
Chapter 25: Support Your Favorite Open Source Project 477
- Project Selection 477
- Code 478
- Test 479
- Submit Bug Reports 479
- Documentation 480
- Assist 481
- Teach 482
- Write 482
- Donate 483
- Thoughts 484
Chapter 26: Reality Bytes 485
- People 485
- The Micromanager 486
- More Is Less 487
- Tech Support Terror 488
- You Should Do It My Way 489
- It’s OK to Say No 490
- The Scientific Method 490
- Understanding the Past 491
- Final Thoughts 492