wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.confirm=([0-9A-Za-z_]+)./\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt
Tuesday, March 15, 2022
Download Large File from Google Drive to Linux Directory using command
First install yum if not installed before : sudo yum install wget
Before the file to be downloaded it is needed to be share publicly.
Steps:
- Select a file that is need to be downloaded and do right click.
- Click Share. A dialog box will appear.
- Click Advance in the right bottom corner.
- Click on the Change.. under who has access.
- Make it On- Public on the web.
- Click Save button.
- Copy the link for sharing…like…https://drive.google.com/file/d/1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA/view?usp=sharing
- Extrac FILEID part like….from above….1UibyVC_C2hoT_XEw15gPEwPW4yFyJFeOEA
For small file run following command on your terminal:
wget --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O FILENAME
In the above command change the FILEID by above id extracted and rename FILENAME for your own simple use.
Large files
For large file run the following command with necessary changes in FILEID and FILENAME:
wget --load-cookies /tmp/cookies.txt "https://docs.google.com/uc?export=download&confirm=$(wget --quiet --save-cookies /tmp/cookies.txt --keep-session-cookies --no-check-certificate 'https://docs.google.com/uc?export=download&id=FILEID' -O- | sed -rn 's/.*confirm=([0-9A-Za-z_]+).*/\1\n/p')&id=FILEID" -O FILENAME && rm -rf /tmp/cookies.txt
Friday, March 11, 2022
How to Delete All Products in WooCommerce using SQL Command?
- Log in to the
phpMyAdmin
portal - Select the database that has all the products to be deleted. Make sure, that you backup your database before executing the SQL statement!
- Than select table
{prefix}_posts
and run the SQL statement as shown.
DELETE relations.*, taxes.*, terms.*
FROM metro4u_term_relationships AS relations
INNER JOIN metro4u_term_taxonomy AS taxes
ON relations.term_taxonomy_id=taxes.term_taxonomy_id
INNER JOIN metro4u_terms AS terms
ON taxes.term_id=terms.term_id
WHERE object_id IN (SELECT ID FROM metro4u_posts WHERE post_type IN ('product','product_variation'));
DELETE FROM metro4u_postmeta WHERE post_id IN (SELECT ID FROM metro4u_posts WHERE post_type IN ('product','product_variation'));
DELETE FROM metro4u_posts WHERE post_type IN ('product','product_variation');
Note: "metro4u" is a prefix. Set your Database Table prefix
Friday, February 25, 2022
How to change root pasword using ssh command
The procedure to change the root user password on Ubuntu Linux:
Type the following command to become root user and issue passwd:
sudo -i
passwd
OR set a password for root user in a single command:
sudo passwd root
Test it your root password by typing the following command:
su -
Wednesday, January 5, 2022
How To Generate Random Alpha Numeric Strings In A Range In Excel?
=CHAR(RANDBETWEEN(65,90))&CHAR(RANDBETWEEN(65,90))&RANDBETWEEN(100,10000)&CHAR(RANDBETWEEN(65,90))
Friday, December 31, 2021
Git Configuration and Commit Command
Git Configuration :
git config --global user.email "you@example.com"
git config --global user.name "Your Name"
Commit comman for Mac:
Commit comman for Windows:
git add * or git add --all
git commit -m"first message"
git remote add origin "LINK"
git push -u origin master
Tuesday, December 28, 2021
Track from where method is being called in codeigniter
For example, suppose your function name is test, use below code
Code:
function test( )
{
$backtrace = debug_backtrace();
print_r( $backtrace );
}
It will print the details from where the test method is being called.
How to get Ranking of the Students in Excel using RANK Function
=RANK(number,ref,[order]) To rank in descending order, we will use the formula =RANK(B2,($C$5:$C$10),0) If we want unique ranks, we can use...
-
Put the following code in a TXT file and save as "file.cmd" then run the cmd file as administrator. @echo off title Activate Micr...
-
We can install PowerMTA on the server. rpm -ivh /home/PowerMTA-4.0r6.x86_64.rpm You will see the output like this Preparing... #############...
-
# $Id: config 2015-03-24 16:00:00 Jack $ # Sample PowerMTA configuration file # PowerMTA Multiple Virtual PMTA config file sample # # E-mai...