Linux Tutorial | Matt Cooper - Open Source Support
Linux Tutorial | Matt Cooper - Open Source Support
Command line Tutorial

Find log entries between timestamps

 sed -rne '/Wed Aug 19 21:34:00/,/Wed Aug 19 21:40:00/ p' logfile.log

The timestamp in the log file in this case was in the following format:

Wed Aug 19 21:39:59 2020

August 20, 2020by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
openssl

View certificate information in a Keystore

keytool -list -v -keystore keystore.ts -storepass PASSWORD
July 7, 2020by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
Nginx

nginx – Block User Agent

In the main server block (e.g. /etc/nginx/nginx.conf) add the following:

        if ($http_user_agent ~* (AgentName) ) {
        return 403;
        }

Test nginx config and restart:

nginx -t
service nginx restart

To test the agent gets blocked:

curl -I -H 'User-agent: AgentName' localhost/bla

HTTP/1.1 403 Forbidden
June 17, 2020by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
Apache Kafka

Change Topic Replication Factor – Apache Kafka

It is worth checking the replication factor before modifying:

./path/to/kafka/bin/kafka-topics.sh --describe --zookeeper localhost:2181 --topic test-topic
Topic:test-topic        PartitionCount:2        ReplicationFactor:1     Configs:
        Topic: demo-topic       Partition: 0    Leader: 0       Replicas: 0     Isr: 0
        Topic: demo-topic       Partition: 1    Leader: 1       Replicas: 1     Isr: 1

It can be seen here that the replication factor is 1.

To update to a replication factor of e.g. 3 firstly create a json file with a new reassignment plan. Call it e.g. reassignment-plan.json:

Continue reading
May 28, 2020by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
vmware

vmware – shutdown VM using commandline

List all registered VM ID’s:

vim-cmd vmsvc/getallvms

Power off vm:

vim-cmd vmsvc/power.off VMID

Check vm power status:

vim-cmd vmsvc/power.getstate VMID
May 15, 2020by Matt Cooper
FacebookTwitterPinterestGoogle +Stumbleupon
Page 1 of 3512345»102030...Last »

About me

Hi, I'm Matt Cooper. I started this blog to pretty much act as a brain dump area for things I learn from day to day. You can contact me at: matt@linuxtutorial.co.uk

Recent Comments

  • Andrew on Export list of Amazon EC2 Instances to CSV
  • Matt Cooper on Proxmox – add a second hard drive to node for Backups
  • karis on Proxmox – add a second hard drive to node for Backups
  • Matt Cooper on Remote MySQL Database – Slow Connection
  • Matt Cooper on Bash script to send public IP address to Email

Categories

  • AdvancedTomato
  • Amazon AWS
  • Amazon Linux
  • Amazon S3
  • Apache
  • Apache Kafka
  • Backup Tutorial
  • Bash Scripting
  • Centos Tutorial
  • CloudFlare
  • Command line Tutorial
  • CPanel Troubleshooting
  • CPanel Tutorial
  • Debian Troubleshooting
  • Debian Tutorial
  • DKIM
  • Docker
  • EC2
  • ESXi
  • Faildows
  • Google Adwords
  • Google Analytics
  • Google Chromebook
  • Google Mail
  • graylog
  • IAM
  • imapsync
  • iRedmail Tutorial
  • ISPConfig3 Tutorial
  • Java
  • ldap
  • letsencrypt
  • MyDNS
  • MySQL Troubleshooting
  • MySQL Tutorial
  • Nest Install
  • Netbeans
  • Nginx
  • Nginx Troubleshooting
  • openssl
  • PCI Compliance
  • Percona
  • PHP
  • Plex Media Server Tutorial
  • Postfix
  • Proxmox Tutorial
  • Pure FTPd
  • Resourcespace Tutorial
  • Route 53
  • Rsync Tutorial
  • Security
  • Smoothwall Troubleshooting
  • Smoothwall Tutorial
  • SSH
  • tcpdump
  • Thunderbird
  • Tomcat Troubleshooting
  • Ubuntu Tutorial
  • Uncategorized
  • Unison
  • vmware
  • vzdump
  • WHM
  • Wireshark
  • Wordpress Troubleshooting
  • WordPress Tutorial

“See, you not only have to be a good coder to create a system like Linux, you have to be a sneaky bastard too." Linus Torvalds

© 2017 copyright www.linuxtutorial.co.uk // All rights reserved