Bits
How to Add Progress Bar in Basic Form Submission to Get Rid of Form Resubmission
· ☕ 1 min read · ✍️ shibu
Few days ago, I created a form for submitting user information. It required to upload lot of images. which actually takes time. Since, it wasn’t a ajax form, I was unable to add any indication that “form is submitting” Adding Progress element using following method solve 2 problems: Help to rid of form Resubmission Giving indication to user about form submission So, after tinkering little time, I found a solution.

How to Add Block Cursor in Vim Specially in Gitbash or Cygwin Vim Editor
· ☕ 1 min read · ✍️ shibu
.vimrc In windows gitbash vim / Cygwin vim / linux subsystem terminal, switching between line cursor and block cursor not happened automatically. I feel uncomfortable when writing inside vim. since, I can’t distinguish between command mode and normal mode. To get a block cursor in Vim in the Cygwin terminal write following code in .vimrc file 1 2 3 4 let &t_ti.

How to Convert Digit to Words in Php Laravel Using Php Built in NumberFormatter Class
· ☕ 1 min read · ✍️ shibu
NumberFormatter We can convert number to string using php built in class NumberFormatter . 1 2 3 4 <?php $digit = new NumberFormatter("en", NumberFormatter::SPELLOUT); echo $digit->format(264); // output will be "two hundred sixty-four" Troubleshooting: You need to enable php_intl extension, when using NumberFormatter class. You can enable this from php.ini setting file. In my case, I am using ubuntu server. I required to install php7.

How to Get List of User by List of Email Using Eloquent Query in Laravel
· ☕ 1 min read · ✍️ shibu
user Laravel eloquent, we can select all users from arrays of emails. I made a cart application. Where I required to get list of users from list of emails(order emails). Using whereIn eloquent method we can easily fetch array of users from database. 1 2 User::whereIn('email', ['polodev10@gmail.com', 'company@gmail.com', 'milky@gmail.com']) ->get(); In my case, I required to fetch, array of user ids.

How to Disable Submit Button Once It Has Been Clicked
· ☕ 1 min read · ✍️ shibu
Whenever form submitted with media, It will take time to process. Since it require time to upload then process the form. In this case, If user click this button again, form submit again. Eventually we are having duplicate, sometimes 3/4 form submission happen simultaneously. Which is not expected. To get rid such circumstance, we will disable submit button, once user click this button.

How to Check SSD and Hard disk Performance in Ubuntu Linux
· ☕ 1 min read · ✍️ shibu
hdparam command in teminal using hdparm command we can check ssd or har disk perfomance 1 sudo hdparm -Tt /dev/sda following output I am getting in terminal dev/sda: Timing cached reads: 13614 MB in 1.99 seconds = 6837.31 MB/sec Timing buffered disk reads: 874 MB in 3.02 seconds = 289.78 MB/sec dd command for write speed To know about write speed we can run a loop to copy and delete file

How to Check Battery Health and Battery Status in Ubuntu Linux
· ☕ 2 min read · ✍️ shibu
using upower command upower command will give you lot more information about battery, like battery health, battery vendor, battery model. Battery model will help you to buy battery in case battery replacement. 1 upower -i /org/freedesktop/UPower/devices/battery_BAT0 Here battery_BAT0 refer to first battery of your laptop If you using a laptop with extra battery like thinkpad t460s, t470s, You need to change battery index number to battery_BAT1 in case of, you want to know about second battery.

How to Check Cpu Info in Linux
· ☕ 7 min read · ✍️ shibu
lscpu command lscpu is the simplest command that shows the cpu information like processor vendor, number of processor, cache, processor speed 1 lscpu best way to remember, list cpu for cpu Architecture: x86_64 CPU op-mode(s): 32-bit, 64-bit Byte Order: Little Endian Address sizes: 39 bits physical, 48 bits virtual CPU(s): 4 On-line CPU(s) list: 0-3 Thread(s) per core: 2 Core(s) per socket: 2 Socket(s): 1 NUMA node(s): 1 Vendor ID: GenuineIntel CPU family: 6 Model: 78 Model name: Intel(R) Core(TM) i5-6300U CPU @ 2.

How to Know Service Process and Ram Status in Ubuntu Linux
· ☕ 1 min read · ✍️ shibu
to know about ram To display the total amount of ram in ubuntu 1 free default size show in kilobyte unit To display the total amount of ram in ubuntu in megabyte mb unit 1 free -m To display the total amount of ram in ubuntu in human friendly unit 1 free -h To display RAM type and speed, use the command:

How to Replace Auth Socket by Mysql Native Password
· ☕ 1 min read · ✍️ shibu
Initially, default mysql settings, comes with “auth_socket” plugin for root user. In my case I was unable to login to phpmyadmin from web browser using root user Login to mysql To see which plugin used for specific user we need to login to our mysql from command line 1 sudo mysql -uroot Plugin used for user in mysql Once we login to mysql, we can view current used plugin for user, using following code

How to Store Git Credential in Ubuntu Linux Using Libsecret
· ☕ 1 min read · ✍️ shibu
Git credential storing using Libsecret Installing libsecret 1 sudo apt install libsecret-1-0 libsecret-1-dev Run make command for recompile. If you don’t have make command accessible install build essential 1 sudo apt install build-essential 1 2 cd /usr/share/doc/git/contrib/credential/libsecret sudo make Update git credential.helper 1 git config --global credential.helper /usr/share/doc/git/contrib/credential/libsecret/git-credential-libsecret Alternative - git cache credential helper If you don’t want to install anything you can use git credential helper.

How to Clone a Git Project With Submodule
· ☕ 1 min read · ✍️ shibu
Git clone and update submodule later clone the repository 1 git clone <git repository> You have to do two things to update submodule 1 2 git submodule init git submodule update Git cloning including submodules In git 2.13 version and later, –recurse-submodules can be used instead of –recursive: 1 git clone --recurse-submodules -j8 git://github.com/username/repository.git heres, -j8 is an optional performance optimization that became available in version 2.