necrux

Print Until it Makes Sense!

  • Who am I?

Bash

Parse Log Files with sed

January 3, 2016 / Leave a Comment

When parsing log files sed is not the go-to tool for most techs, but it offers a pretty neat feature: the ability to easily search a log file for a specific date/time range. Pattern Matching sed -n ‘/Dec 30 13:00/p’ /var/log/messages Date Range Matching sed -n ‘/Dec 30 13:00/,/Dec 30 14:00/p’ /var/log/messages Change Delimiters If … [Read more…]

Posted in: Bash, Linux, sed Tagged: Bash, Linux, logs, sed

Backup and Restore Permissions in Linux

December 31, 2015 / Leave a Comment

Inevitably every Linux administrator will eventually have to alter permissions and owerships, perhaps even FACLs. But what happens when your changes go awry? The problem is amplified if you were making changes recursively! Backup Permissions Fortunately there is a pretty simple method to backup the permissions, ownerships, and FACLs: getfacl -pR /path/to/backup > /root/perms.bak NOTE: … [Read more…]

Posted in: Bash, Linux, Permissions Tagged: FACLs, Linux, Ownersip, Permissions

Bind Mounts in Linux

December 31, 2015 / Leave a Comment

Bind mounts in Linux allow you to mount one part of the file hierarchy somewhere else. I highly recommend using bind mounts in chrooted environment as it can simplify user access control. Creating Bind Mounts Bind mounts were added in kernel 2.4.0, so older systems will not support it. Run uname -r to verify your … [Read more…]

Posted in: Bash, FTP, Linux, SFTP Tagged: Bind Mounts, Linux

Bash Shortcuts

December 19, 2015 / Leave a Comment

I tend to spend quite a bit of my time on a command line, so I am always looking for little ways to make my life easier. Because of that, this post will be a bit of a living document that I plan to occasionally update as I discover more handy tricks. This is not … [Read more…]

Posted in: Bash, Linux Tagged: Bash, Linux, Shortcuts

Finding Help in Linux!

September 17, 2015 / Leave a Comment

Linux is chock-full of documentation, the challenge however is knowing where to find that documentation. One of the first things that every Linux user ought to learn is how to view the manual pages, man <command>, but there is more to know. The man pages are divided into 9 sections: Executable programs or shell commands … [Read more…]

Posted in: Bash, Linux Tagged: docs, Linux, Man Pages

Recent Posts

  • SMTP Sender-Dependent SASL Authentication in Postfix
  • My Adventures with Multiple Monitors on Linux
  • Parse Log Files with sed
  • Backup and Restore Permissions in Linux
  • Bind Mounts in Linux

Recent Comments

  • D. Axel on SMTP Sender-Dependent SASL Authentication in Postfix

Archives

  • January 2016
  • December 2015
  • September 2015

Categories

  • Bash
  • email
  • FTP
  • Linux
  • Mailgun
  • Permissions
  • Postfix
  • sed
  • SFTP
  • SSH
  • Virtualization

Meta

  • Log in
  • Entries feed
  • Comments feed
  • WordPress.org