The Diamond operator is almost exclusively used in a while-loop. It allows us to iterate over the rows in all the files given on the command line. Diamond – using $_, the default variable We can make the above example even more compact by remembering that certain operation in Perl will use $_, the default variable of Perl, if no explicit variable is given. use strict; use warnings; while (<>) { print if /perl/; }  Read More →

apex, bare domain ( domain without www) and www.domain.com should point to the same IP. In amazon load balance or some of the cloud solution, they do not provide us a static IP, they provide us a name and asks us to point our domain to their domain. There is no problem with www.domain.com , but we can’t point apex domain (domain.com) to a cname record, it ‘s because the current DNS RFC does not allow this. There are many dns hosting providers customized their DNS to support this feature. If you are using Route53, you can use the script below to monitor the differenceRead More →

I recently had to clone a very large repository through SSH, every time i did i got this error   Cloning into ‘large-repository’… remote: Counting objects: 20248, done. remote: Compressing objects: 100% (10204/10204), done. error: RPC failed; curl 18 transfer closed with outstanding read data remaining fatal: The remote end hung up unexpectedly fatal: early EOF fatal: index-pack failed I could be the connection is bad , i finally fixed by using the commands below: $ git clone [email protected]:large-repository –depth 1 $ cd large-repository $ git fetch –unshallowRead More →

Environment variable GIT_SSH_COMMAND: From Git version 2.3.0, you can use the environment variable GIT_SSH_COMMAND like this: GIT_SSH_COMMAND=”ssh -i ~/.ssh/id_rsa_example” git clone example Note that -i can sometimes be overridden by your config file, in which case, you should give SSH an empty config file, like this: GIT_SSH_COMMAND=”ssh -i ~/.ssh/id_rsa_example -F /dev/null” git clone example Configuration core.sshCommand: From Git version 2.10.0, you can configure this per repo or globally, so you don’t have to set the environment variable any more! git config core.sshCommand “ssh -i ~/.ssh/id_rsa_example -F /dev/null” git pull git pushRead More →

There are some situation  when we run a time-consuming process, we need to see the output of that command to see its progress. Normally, we would have to wait until the process ends , then we can see the output. The reason for this is because web or standard output normally buffer some contents, it will wait for enough data to print out to the client. To fix this issue, we tell our server/script not buffering anything, print out immediately when it can. Here are some steps that i did in Python. Step1: Tell the server not buffering anything, don’t use gzip ( if weRead More →

Run this script to see your SSL Version <?php $ch = curl_init(‘https://www.howsmyssl.com/a/check’); curl_setopt($ch, CURLOPT_RETURNTRANSFER, true); $data = curl_exec($ch); curl_close($ch); $json = json_decode($data); echo $json->tls_version; ?>   If you want to check your open SSL version? <?php $curl_info = curl_version(); echo $curl_info[‘ssl_version’]; ?> OpenSSL 1.0.1 and later support  TLS v1.1 and TLS v1.2 If you see your OpenSSL version from 1.0.1, then it will support TLS V1.1 and TLS V1.2Read More →

Do you still love working with Delphi 7? I do. Delphi 7 is quite old and there are many features on the new Windows 7 that it’s not able to do. Today i faced a problem with UAC, my application needs to run under administrator account, when UAC is enabled, i can’t detect if the user is running with admin account or not. With the new application, the application can force the user to run in administrator mode when UAC is enable easily. Luckily, there is a solution on now. 1. Remove XPMan: Remove any reference to XPMan component in your project. XPMan adds aRead More →