By default, when you deploy an application to Azure App Service plan – your default web location will be under /home/site/wwwroot . /home/ is a persistent storage which means if you restart your application, your data will be still there. The problem with /home folder is that, it’s actually a network folder , which means every time you want to access files on this folder, it will do a network call. Some applications using some framework like Symfony , their library is huge, they read a lot of files , this will cause your application is very slow to respond. How do we fix this?Read More →

We have some accounts such as postfix,apache .. these account has “nologin” shell, meaning you can’t sudo su – apache or “su – apache”. Sometimes we need to login to these account to run some commands to check some permission issues. The solution is: su -s /usr/bin/bash apache (as you can see in the command, we explicitly provide the shell instead of using the system default)Read More →

We have a monitoring system to check network devices, sometimes we got an alert saying the remote device is down. We check the remote device and it’s working fine. To ensure that our monitoring working properly, we create an external script to monitor system, then we want to compare the result between 2 systems. I finally come with this script (ping.sh) , it will continuously ping the remote server, if it’s down, it will write a log. #!/bin/bash hostname=”my_default_hostname”; if [[ -n $1 ]] then hostname=$1; fi while true; do date; fping -c3 $hostname ; if [[ $? -ne 0 ]] then echo “============System [$hostname]Read More →

My son was asking me to help him set up a server so that he can play with his friends – and i found this , easy to do. https://www.astralinternet.com/blog/en/build-minecraft-pocket-edition-server-ubuntu/ I turns out that this version does not work well with latest minecraft , i download the version from Minecraft official website, it works pretty well https://www.minecraft.net/en-us/download/server/bedrock/ After you download the server, just run this command: LD_LIBRARY_PATH=. ./bedrock_serverRead More →

If you are running on Linux machine and. every time you access to your corporate website , it asks you for the password , but this does not happen with your Windows machine. I have spent a lot of times to research on this and found that: Chrome supports some of these authentication method: Basic, NTLM , Negotiate with Kerberos and Certificate. In this post, i will share how i pass the NTLM authentication by using a chrome extension. Here are 2 files that i use to create the extension:webrequest.js n_try=0; chrome.webRequest.onAuthRequired.addListener(function(details){ if(n_try>2) { return ; } n_try++; console.log(“chrome.webRequest.onAuthRequired event has fired”); return { authCredentials:Read More →

I have installed mysql many many times – i decided to save a note for myself for later installation. This is to install msyql server on Redhat 7. Below is the step: wget http://repo.mysql.com/mysql-community-release-el7-5.noarch.rpm sudo rpm -ivh mysql-community-release-el7-5.noarch.rpm yum update sudo yum install mysql-server sudo systemctl start mysqld My next step will go to https://www.phpmyadmin.net/ to download phpmyadmin and set it up on my web server. I use this tool to manage the database. We need to install mysql module: yum install php-mysql apachectl restartRead More →

First , you need to share your files in MacOS Do the following things in redhatyum install samba-client cifs-utils edit this file : /etc/fstabad this line //192.168.1.6/Documents /data cifs user=user,password=password 0 0 then run: mount -a if you receive the error mount error(95): Operation not supported Refer to the mount.cifs(8) manual page (e.g. man mount.cifs) then change the line to (vers=3.0) //192.168.1.6/Documents /data cifs user=user,password=password,vers=3.0 0 0Read More →

I have a folder like this: total 4.0K -rwxrwx—. 1 root vboxsf 101 Dec 25 08:03 notes.txt drwxrwx—. 1 root vboxsf 64 Dec 24 22:43 test drwxrwx—. 1 root vboxsf 64 Dec 25 07:45 test2 Then I run a docker sudo docker run -i -v /Data:/Data ubuntu bash cd /Data mkdir test3 I got permission denied. After some research, it turned out that this related to SELinux, it’s a security feature to limit root access. You can easily identify this by looking at the dot (.) at the end of the listing. You can temporary disable it by using: su -c “setenforce 0” To makeRead More →