Skip to main content

Posts

Never Stop Learning

I got a news letter today from John Sonmez The founder of  Simple Programmer  .  I really Liked some ideas to stay motivated. And stay passionate to learning.   He state that, " Fail often and fail hard, learn and grow, overcome and succeed my previous self every single day ".  Never Stop Learning, Be more. Grow and learn and be the best version of yourself.  If you don't like the road you're walking, start paving another one.
Recent posts

Things you need to know about cron

cron is a Linux utility which schedules a command or script on your server to run automatically at a  specified  time and date.  They're most commonly used for automating system maintenance or administration. However, they are also relevant to web application development.   Why use cron?  Server admins have been using cron jobs for a long time.   You can expire and erase cached data files in a certain interval. You can auto-check your website content for broken links and have a report e-mailed to yourself regularly. Can update your database from external api  Syntax Here is a simple cron job: 1 10 * * * * /usr/bin/php /www/virtual/username/cron.php > /dev/null 2>&1 It consists of five parts: minute hour day of month month day of week Can generate the sequence from  crontab guru ,    https://crontab.guru/every-30-minutes Editing the Crontab Running this command will launch vi (text editor) and will let you edit th
To copy some same types of files from a directory (inside subdirectory too) into a single folder. cp -a /*.png ../7thjuly/ cp -a source/*.typeofext  destination

Some Handy ssh/cli Commands

On Wednesday night you logged in into your server through ssh. Checking is this server capable to certain applications or not. First you ask which OS is it using.  Assuming its a Linux server. Following command will show you the OS : uname - a

Download Files From Remote to local via command line

To download Files From Remote to local via command line  normally we use scp. To copy all from  Local Location  to  Remote Location  (Upload) scp - r / path / from / destination username@hostname :/ path / to / destination Copy on current directory from  Remote to Local scp - r username@hostname :/ path / from / file . To download a single file the command will be: scp user@your . server . example . com :/ path / to / foo/file.name / home / user / Desktop / To download a single file the command will be:  scp - r user@your . server . example . com :/ path / to / foo / home / user / Desktop / Help: -r  Recursively copy all directories and files Always use full location from  / , Get full location by  pwd scp  will replace all existing files hostname  will be hostname or IP address if custom port is needed (besides port 22) use  -P portnumber . (dot)  - it means current working directory, So download/copy from server and paste here only

Git: Remove Branches after Merge

After complete your task of a branch commit and push it. Then checkout to the main(normally master branch) Suppose your branch is   branch1  Then merge it git checkout master git merge branch1 After the merge, it's safe to delete the branch: git branch -d branch1 Additionally, git will warn you (and refuse to delete the branch) if it thinks you didn't fully merge it yet. If you forcefully delete a branch (with  git branch -D ) which is not completely merged yet, you have to do some tricks to get the unmerged commits back though (see below). There are some reasons to keep a branch around though. For example, if it's a feature branch, you may want to be able to do bugfixes on that feature still inside that branch. If you also want to delete the branch on a remote host, you can do: git push origin :branch1 This will forcefully delete the branch on the remote (this will not affect already checked-out repositiories though and won't prevent anyone with pu

Why ReactJS ?

I was decided to learn ReactJs. And asking my self why I want to learn React. What can I do or build using React? To get the answer I do some Researchs and make couple of important notes. Hope It will help who have interest to learn ReactJS. Lets know what is React First.  React is a JavaScript library for building User Interface s. Very often it’s misinterpreted as tool, framework, language. React allows developers to create large web applications that use data which can change over time, without reloading the page. Its main goal is to be fast, simple and scalable. React processes only user interface in applications ( source ).   It also can be use along with other JS freamwork.  To learn More visit :  https://reactjs.org/ As Inspired from Simon Sinek The author of "Start with Why", firstly I was finding my why's. Love the Quote : It is one of life’s greatest joys to wake up in the morning... every morning, With a clear sense of why that day matters, why

Getting Started with Parcel

Parcel is a web application bundler. Parcel is a web application bundler. It offers blazing fast performance utilizing multicore processing, and requires zero configuration. Install parcel using npm:  npm install -g parcel-bundler Create a package.json file in your project directory using: npm init -y Next, create an index.html and index.js file. < html > < body > < script src = "./index.js" > </ script > </ body > </ html > console .log( "hello world" ); Parcel has a development server built in, which will automatically rebuild your app as you change files and supports hot module replacement for fast development. Just point it at your entry file: parcel index.html Now open http://localhost:1234/ in your browser. You can also override the default port with the -p <port number> option. parcel index.html -p <port number> Use the development server when you do