Most users are familiar with FTP, but if you want to kickstart Red Hat installs, PXE boot systems, auto-provision VoIP phones or unbrick a Linux-based router, you want a Trivial File Transfer Protocol (TFTP) server. Setting one up on Linux is easy, and a perfect project to take on over the weekend.
Source: Weekend Project: Set Up a TFTP Server on Linux | Linux.com | The source for Linux information
script -a my_history mkdir test cd test touch hello_world.txt echo 'Hello World' ./hello_world.txt # This closes the "script -a my_history" file exit Source: How To Record Everything You Do In Terminal - OSTechNix
If you’re developing on a Windows platform for an application targeted for Linux or Unix that deals with email, then this article will be useful.
Let us begin by understand the problem.
Problem If you are a Java/Spring developer, (developing in Java is platform independent - runs on any platform where a JVM is available) then you have two options in front of you for sending emails from a Java application:
In CentOS 7, a lot of the command-line utilities for configuring and troubleshooting network properties like arp, ifconfig, iptunnel, iwconfig, nameif, netstat, route - are no longer there in the new CentOS 7 version. While still included in many Linux Distributions, (and you may be tempted to run - ‘yum install net-tools’ - to get them back into your Linux footprint). But they are considered deprecated and therefore should be phased out in favor of more modern replacements.
Here is a cheat sheet on changing the timezone in a linux system (CentOS 6.8 or 7):
# Remove the current timezone file rm /etc/localtime # Create a symbolic link to the new timezone you want # ls -la /usr/share/zoneinfo/ # ls -la /usr/share/zoneinfo/US/ # For GMT ln -s /usr/share/zoneinfo/GMT /etc/localtime # For EST ln -s /usr/share/zoneinfo/EST /etc/localtime # For UTC ln -s /usr/share/zoneinfo/UTC /etc/localtime # For GMT ln -s /usr/share/zoneinfo/GMT /etc/localtime # For New York (Eastern) ln -s /usr/share/zoneinfo/US/Eastern /etc/localtime # For Central ln -s /usr/share/zoneinfo/US/Central /etc/localtime # For Mountain time ln -s /usr/share/zoneinfo/US/Mountain /etc/localtime # For Pacific time ln -s /usr/share/zoneinfo/US/Pacific /etc/localtime # Set Date and Time (as needed) # MMDDHHmmYYYY date 072522172010 hwclock --systohc # If you're using NTPD Service # CentOS 6.
This article focuses on synchronizing/updating the clock in your guest linux VM after you restore a VirtualBox snapshot.
When you create a VirtualBox snapshot, it’s essentially a photo taken and frozen in time. All bits including the date and time are frozen to that instant. When you restore a snapshot, the Linux guest VM system is restored back to that snapshot including the date and time. This may not be desired all the time especially if the purpose is to restore the configuration and settings to an earlier time but your want to roll forward the clock on the VM to the present instance.
Came across this tiny IoT embedded micro-controller/computer that runs BusyBox or FreeBSD Linux and can run code written in Node.js, Python, C/C++, Ruby and PHP all at a cost of $5 to $10 with WiFi, 2G/3G, Bluetooth, GPS add-ons for your cloud services. It also has enough GPIO pins to interface with external world and not to mention the I2C and I2S interfaces for talking to other devices and peripherals as well as interfacing for sounds (I2S).
In CentOS 6.8, the init system that brings up all the services (link autoexec files in Windows) was called SysV- Init. This has been the foundation for ages as long I’ve been using CentOS. But in the latest release of CentOS (CentOS 7+) the init engine has been moved to a more favorable engine labeled SystemD. SystemD is the init engine behind Ubuntu, Fedora, Red Hat and CentOS. So the standardization is good for the Linux community but moving from CentOS 6.
Sometimes we have situations where you need to wait until one application is loaded that may bind to a certain port before kicking off a second application that may depend on that port. This process is typically described as “Wait-Until-Port-Opens” (or it could be the reverse - where you want to wait until a port closes).
Here are some use-cases for this method or script:
You have a Java web application (Jetty, Tomcat, WildFly, etc) that listens on port 8080 and you want your Nginx or Apache HTTPd server to start as a proxy-server once that back-end web server is bound to port 8080.
Sometimes we have configuration or properties file (as templates) such as httpd.conf or server.conf where we want to dynamically replace $variables with values before writing the output to a new file.
# httpd.conf.tmpl SetHandler server-status Order deny,allow Deny from all Allow from $MONITOR_IP We want to develop an install script in Bash such that it reads the httpd.conf.tmpl and replaces the $STATUS_URI and $MONITOR_IP with appropriate values (either passed in as script arguments or coded in the bash script) and then write out the resulting output to a new file such as /tmp/httpd.
You may have observed once in a while that when you SSH onto a server and you try to look up a command you ran earlier (maybe the previous day) in the “history” output but you do not see it. This is because of how a SSH session works! Each time you ssh into a server, it leverages a set of TTY screens to maintain an individual history for that session.
Prior to CentOS 7, “iptables” and “shorewall” were the two options avaiable. Since CentOS-7, the default firewall tool is “firewalld”.
Here is a short-guide on how to open two ports in the firewalld application:
firewall-cmd --get-active-zones # Lets open Jetty Web Server port firewall-cmd --zone=public --add-port=8080/tcp --permanent # Lets open some other port 4242 for TCP firewall-cmd --zone=public --add-port=4242/tcp --permanent # Commit changes firewall-cmd --reload firewall-cmd --list-all Cheers.
CentOS 7 uses Systemd for managing services (prior to CentOS 7 it was using upstart-init.d to manage the services).
Step-1: Create CentOS 7 Service file: vim /usr/lib/systemd/system/opentsdb.service
[Unit] Description=OpenTSDB Service After=network.target hbase.service [Service] Type=forking PrivateTmp=yes ExecStart=/usr/share/opentsdb/etc/init.d/opentsdb start ExecStop=/usr/share/opentsdb/etc/init.d/opentsdb stop Restart=on-abort [Install] WantedBy=multi-user.target Step-2: Let’s test the start and stop of this new OpenTSDB service
$ sudo systemctl start opentsdb # If it starts up good, you should see the website when you goto http://&lt;servername&gt;:4242/ ps -leaf | grep &quot;tsdb&quot; # shows you something similar then you can add it as a service to auto-start sudo systemctl enable opentsdb Step-3: (optional) Reboot node and make sure that the service starts up accordingly after a reboot.
Here is a simple command that can fix your vim editor for dark backgrounds so that your comments are not showing up in dark blue (unreadable).
The temporary fix is to run the following command in the vim editor:
:set background=dark instead of
:set background=light The permanent fix for this is to add the command inside $HOME/.vimrc file
set background=dark Please note that when you’re adding the property into the .
When getting started on ZeroMQ (version 4.2.0 or above) can be quite challenging especially with all the prerequisites. I’ve spent a good two days to get the process ironed out. So I’m sharing this so that others can avoid the same pitfalls and can have a good head-start with setting up their environment.
Pitfall #1: Develop for your platform. I’m accustomed to developing in Ubuntu 14.04.3 LTE but in this case my deployment environment happens to be CentOS 6.
Sometimes you want an easy way to simulate load on a file-system that you are trying to test. Here’s a quick and easy way.
Suppose your mount point you want to perform this IO is “/myspecialmount”. (Assuming you have plenty of space to test)
Then the easiest way to load some IO is through the following bash-script:
[sourcecode language="bash”] #!/bin/bash
while true do echo “=== Starting clean-up ====” rm -fr /myspecialmount/usr echo “=== Starting load ====” rsync -avp /usr /myspecialmount done [/sourcecode]
Sometimes you need to see what’s installed as part of a package via yum. To see the package contents you can use a utility that’s available on the RHEL/CentOS.
$repoquery –list packagename
If you do not have this utility available, you can install it by using this command
$yum install yum-utils
Here is a sample output from looking at the package contents of Apache httpd.