Interesting article on Linux permissions.
It explains how to recognise which permission system might be in use (eg SELinux, facl), the meaning and how to use the special bits, umask and more:
What are the dynamic IP ranges used by AWS in Ireland for the EC2 service?
$ curl -s https://ip-ranges.amazonaws.com/ip-ranges.json | jq '.prefixes| . | select((.region == "eu-west-1") and (.service == "EC2"))|.ip_prefix'|sed 's/"//g'
Interesting article on the different levels and skill set of System Administrators:
If you’re working in open source, why would you use anything but Linux as your main desktop?
Sometimes disks stop responding and cause issues/slowness to the whole system, simply because the system is expecting some sort of response.
In these cases, the device/disk would appear to be 100% utilised (e.g. in iostat) and to avoid having to reboot the whole system, it needs to be reset.
When dealing with hardware, you often see messages in the logs about disk issues or warnings.
ata9: hard resetting link
ata9: SATA link up 1.5 Gbps (SStatus 113 SControl 310)
ata9.00: configured for UDMA/33
ata9: EH complete
ata3: SATA max UDMA/133 abar [email protected][......]
Somebody had the brilliant idea to use Unix timestamps in the Squid log.
I suppose this makes it easy to parse, not so easy to read for us humans though!
This is an elegant and common way of solving this problem:
cat /var/log/squid/access.log | perl -p -e 's/^([0-9]*)/"[".localtime($1)."]"/e'[......]
You can achieve the same result with other (more powerful) tools, but I like this approach because it’s the simplest I can think of.
Let’s say you have this text file called test.txt
Remove the first line
tail -n +2 test.txt
Remove the last l[……]
I had to make some modifications to several BIND zone files, sed proved itself invaluable once again!
All the zone files looked something like this:
domain.com. IN SOA ns1.domain.com. postmaster.domain.com. (
2015021001 ; Serial
600 ; Refresh (10 minu[......]
Sometimes when creating one-liners, when the source is not “clean”, you may end up with non-ascii characters which make the parsing harder.
To get rid of all of it, you can use perl.
cat dirty-source.txt|perl -pe 's/[^[:ascii:]]//g' > clean-output.txt
The same command can be used on a file[……]