The Apache Commons Lang library could help you to determine the running OS type. Here is an simple example.
In the Ant build.xml, i need to make sure the JBoss server is started before running the test cases. There are 2 possible approaches.
- Using twiddle.sh to check the status
- Monitoring server.log until “Started in” is written on it
I took the 2nd approach. Here is an example output log when the JBoss server is started successfully.
Mess up with the PHP dependencies in different environments? Composer is a PHP dependency manager where all the dependencies information are stored in the JSON file called composer.json. Similar to the pom.xml if you are using Maven in Java.
This example is done on a Windows machine. You could refer to Composer website if you are using Mac or Linux.
1. Download and install the Composer as stated in the Composer website.
1. Create a 10MB file named as dummy.
- dd if=/dev/zero of=dummy bs=1024k count=10
Use the following command to create a 10MB file.
- dd if=/dev/zero of=<filename> bs=1024k count=10
The output file size is equal to bs x count.
Reference: Creating Empty File with Specified Size
Actually there is no way to use symbolic links in FTP. A workaround is to mount the folder with the bind option. For example, i have a jailed FTP account and i want to allow it to access the /tmp/eureka folder.
1. Create the mount point folder in the user home directory.
2. Mount the /tmp/eureka folder with the bind option.
mount --bind /tmp/eureka /home/<username>/eureka
Reference: vsFTPd and Symbolic Links
1. Edit /etc/vsftpd.conf as follow.
2. Create the /etc/vsftpd.chroot_list and enter the usernames which you want to jail.
This is an example shell script which creates a file with datetime as filename.
echo "Eureka!" > eureka.$(date '+%Y-%m-%d').txt
The file is created.
Reference: StackOverflow – linux redirector to log filename with $date variable
We can find the memory usage on a Ubuntu server using the following command
To check your file encoding/charset. Use the following command.
file --mime-encoding <filename>