Posts

Showing posts from December, 2021

How to Cron Job in CentOS 7/8

 A cron job is scheduled operation which can execute a script or an API at any defined interval. To create a cron job in a CentOS Server you’ll need to edit a file called CronTab. CronTab is a configuration file that contained commands that are read by Cronie, a command scheduler that is supposedly already installed in your CentOS server. To edit the crontab file, EDITOR=nano crontab -e To creadte a scheduled task in Cron, * * * * ping http://www.example.com The first 5 fields of a crontab command define minute (0-59) hour (0-23) day of the month (1-31) month (1-12) day of the week (0-6) An asterisk, * in a time runs the command at every valid value. After first five field that define the schedule, next field is a shell command that is supposed to be executed. Example, To ping a web address at every minute, * * * * ping http://www.example.com To run a php script at every 2 minutes */2 * * * * php /var/www/html/myscript.php To hit an GET REST API every week 0 0 * * 0 curl https://exampl

How to LAMP on CentOS 7 with phpMyAdmin

Image
 LAMP stands for Linux, Apache, MySQL and PHP. If you’re trying to build a web application using PHP you’ll need a server and installing the required applications on it. Collectively called LAMP, we’ll be installing the required applications on a Centos 7 Cloud Server and run a WordPress blog on it in later posts. ====== LAMP on CentOS 7 ====== update system sudo yum update check firewall status sudo systemctl status firewalld if firewall is not running, run it sudo systemctl start firewalld enable firewall to start on boot sudo systemctl enable firewalld allow HTTP and HTTPS services through firewall sudo firewall-cmd --permanent --add-service=http sudo firewall-cmd --permanent --add-service=https to open port through firewall firewall-cmd --permanent --add-port=80/tcp to check status of opened ports firewall-cmd --list-all reload for above rules for them to take effect sudo firewall-cmd --reload install APACHE module sudo yum install httpd start APACHE sudo systemctl start httpd.serv

DNS Server Addresses to block ads or access blocked content

Image
To change DNS on Android devices, go to Settings > Network and Internet > Advanced > Private DNS To change DNS on iOS Devices, Settings > WiFi > Select your connected WiFi Network > Configure DNS > Manual and add your preferred DNS server. To change DNS on Windows PC, Settings > Network and Internet > Under Related Settings - Change adaptor  options > Right Click on your connected Network > Highlight Internet Protocol Version 4 (TCP/IPv4) > Click Properties and add your preferred DNS settings in the following window. Google DNS 8.8.8.8 8.8.4.4 Open DNS 208.67.222.222 208.67.220.220 Quad9 DNS 9.9.9.9. 9.9.9.9 CloudFlare DNS 101.101.101.101. 101.101.101.101 Comodo DNS 1.1.1.1 1.0.0.1 Quad101 DNS 8.26.56.26 8.20.247.20 For Ad Blocking dns.adguard.com us.adhole.org

How to drag and drop item in Unity3D

Image
  For dragging and dropping to work we will need to first grab the Game Object and ensure while the Game Object remains grabbed it's position reciprocates the mouse position. This will work fine for not only PC bug mobile devices as well. First define GameObject which we will be dragging. public GameObject selectedPiece; Now inside Update method we will give reference to touched/clicked object and while there is a reference available to an game object(selectedPiece;) we will move that object to mouse position. When the reference is remove, object won't move therefore dropped. void Update(){ RaycastHit2D hit = Physics2D.Raycast(Camera.main.ScreenToWorldPoint(Input.mousePosition), Vector2.zero); if (Input.GetMouseButtonDown(0)){ if(hit.transform != null)             {                 if (hit.transform.CompareTag("PIECE"))                 {                     selectedPiece = hit.transform.gameObject;                 }             } } if (In