Free Hosting for Python Scripts on Google Cloud

  Рет қаралды 142,269

JayMartMedia

JayMartMedia

Күн бұрын

Пікірлер: 253
@exp8786
@exp8786 2 жыл бұрын
Thanks for this video, no annoying music, no bullsh!t, just straight to the point, and also you explain every single step you do including new keywords and everything. Thanks!!!
@JayMartMedia
@JayMartMedia 2 жыл бұрын
Thanks, glad you found it helpful!
@SkySesshomaru
@SkySesshomaru 2 жыл бұрын
@@JayMartMedia Oh yeah we did, nice work there man.
@JayMartMedia
@JayMartMedia 5 жыл бұрын
Check out my 100 subscriber video to enter to win a SanDisk SSD: kzbin.info/www/bejne/paqalIyboJihpNk I'm not expecting a ton of entries, so your chance to win is decent. Entry is simple: • Comment on the giveaway video (include the name of a programming language) . • Subscribe to the channel. Full rules in the description of the giveaway video. Hope to see ya' there!
@JayMartMedia
@JayMartMedia 5 жыл бұрын
Google has changed this deal and now the free account is good for 3 months instead of 12 months as it was originally. Check out my video about uploading files to the Google Cloud server: kzbin.info/www/bejne/a6CsZo15Ys-hgLM
@kristians4958
@kristians4958 4 жыл бұрын
JayMartMedia Hey,i have question when i put credit card info will it take out like 1€ like other sites do? so it could check if its real
@aman4434
@aman4434 4 жыл бұрын
Great video! I came to the comments to see if I could do this and you've said it yourself. I need to run a selenium script so do you think uploading the driver exe will work?
@JayMartMedia
@JayMartMedia 4 жыл бұрын
@@aman4434 Unfortunately Linux does not run .exe files natively. There is a chance that you could install a program, but I have never tried. You may be about to install a version of selenium that was built for Linux, it it MAY be possible to run a version of Windows on Google Cloud.
@aman4434
@aman4434 4 жыл бұрын
@@JayMartMedia ah right. I will check it out. This will still be useful for other purposes. Thanks again!
@patrickmuller9819
@patrickmuller9819 4 жыл бұрын
Thanks. These 10 minutes saved a lot of my time!
@JayMartMedia
@JayMartMedia 4 жыл бұрын
Great, glad to hear it!
@mr22b56
@mr22b56 5 жыл бұрын
don't stop making videos. you way of explaining things is awesome
@GoodSmile3
@GoodSmile3 3 жыл бұрын
This approach is not limited to python scripts, I deployed my jar as well, thank you!
@hanimyusof7973
@hanimyusof7973 5 жыл бұрын
Thanks alot! I was looking for this type of solution. Your tutorial is easy to follow. Thank you for sharing this. Keep up the good work.
@swahareddy8822
@swahareddy8822 4 жыл бұрын
Loved it !! Thanks for taking it so slow and thorough :)
@JayMartMedia
@JayMartMedia 4 жыл бұрын
Glad you found it helpful!
@makedollarsandsense7194
@makedollarsandsense7194 4 жыл бұрын
This content quality and education value is great. Thank you so much!
@jbkwon
@jbkwon 3 жыл бұрын
Thank you so, so much. This was one of the best tutorials I have ever watched.
@user-qs7dp6yb2x
@user-qs7dp6yb2x 2 жыл бұрын
BOMB!!!! Thank you for the video, especially for the cron!
@erensarnic4058
@erensarnic4058 2 жыл бұрын
Most valuable 10 minutes I have ever seen 🙌
@alexandrutausch4616
@alexandrutausch4616 4 жыл бұрын
great video. It was really helpful. I was able to automate a process of tunrning an XML into a csv and put it on a server for a php script to pick up and inject products into a e commerce shop data base. Thank you Jay!!
@greentea_
@greentea_ 4 жыл бұрын
This is extremely helpful. My code ran for about 25 hrs. Thank you!
@igorvujcic1731
@igorvujcic1731 4 жыл бұрын
I've been looking for this quite a lot, thanks for amazingly useful info
@zackplauche
@zackplauche 3 жыл бұрын
Bro your mic and radio voice is 🔥
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Thanks!
@brexterity8385
@brexterity8385 3 жыл бұрын
This is the best and most useful tech video I've ever used. Thanks so much
@JayMartMedia
@JayMartMedia 3 жыл бұрын
I'm glad you found it helpful!
@MRichard333
@MRichard333 4 жыл бұрын
Hi, be careful, the blur can be removed, I don't want to teach how, but I suggest you and everyone to don't input private information under bluring. You can also simply make an exemple in text without your information for the video purposes. (My goal is to help, I hope it does) Nice video! Perfect for testing.
@venomlovekitties
@venomlovekitties 2 жыл бұрын
Blur can be removed? You think we live inside a cave?
@leonardosantana4543
@leonardosantana4543 2 жыл бұрын
nice bait
@srazavitousi
@srazavitousi 4 жыл бұрын
Thanks for explaining what acronyms stand for, I never knew them!
@JayMartMedia
@JayMartMedia 4 жыл бұрын
Yes, understanding what the acronyms mean really helps me to remember them. Glad you found it helpful!
@OnlineGreg
@OnlineGreg 4 жыл бұрын
hey, nice video! but if i see it right, it is not for free. it is 4,28 USD monthly? (see 1:44 )
@MacTavishSoap1
@MacTavishSoap1 4 жыл бұрын
Have the same question, although I have 2 guesses: 1. You have free tier for operations each month, and only exceeding are paid. 2. You have $300 credit for registration which is almost 6 years with that price.
@Origameasy
@Origameasy 3 жыл бұрын
*Actually you can directly upload your files by clicking the settings icon then "upload file", as simple as that no need to use FTP !*
@Joe-zg9eq
@Joe-zg9eq 3 жыл бұрын
Or you can use git to install your files from github. I prefer to use that way
@andywub
@andywub 4 жыл бұрын
clear and concise, thanks a lot my dude
@artabra1019
@artabra1019 3 жыл бұрын
WOW this is the best tutorial in cloud easy to understand.
@IntrovertCoder
@IntrovertCoder 4 жыл бұрын
Love your video! I'm working on a project with several APIs and I have to deploy it on a cloud but I don't have any experience with cloud
@masterburns
@masterburns 3 жыл бұрын
thx, this is a really great tutorial and i could not have done the job without your help!
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Glad you found it helpful!
@snerd6936
@snerd6936 3 жыл бұрын
Sir you did this all wrong. You were straight to the point and showed exactly what to do. You explained everything. You didn't skip steps. Tisk tisk. Thank you so much!
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Glad you found it helpful!
@yahiamahmoud3177
@yahiamahmoud3177 Жыл бұрын
Thanks a lot for this clear explanation, can you also explain how to run a scraping script on google cloud and how to get the outputs even if they were CSVs, images, pdfs, etc.?
@manchuparkaviks2403
@manchuparkaviks2403 4 жыл бұрын
Good one. EASY to follow and it works!
@cemdogansahin
@cemdogansahin 2 ай бұрын
Thank you. It really helped a lot. 👍🏻👍🏻👍🏻
@RUDAW12
@RUDAW12 9 ай бұрын
Love it!, much appreciated.
@RenatoEsquarcit
@RenatoEsquarcit 4 жыл бұрын
Super well explained!
@wdhare
@wdhare 3 жыл бұрын
This is fantastic! I am extremely new to Python and this is exactly what I wanted and very easy to follow. Thank you! One question - I just signed up for the Google Cloud Platform. If I selected the lowest VM tier items (like you did) to run my script, will this still be free for me to run after my trial runs out?
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Glad you found the video helpful! No, unfortunately the trial does not extend after the 3 month trial, even if you have a credit remaining. So you will have to cancel after three months, or start paying.
@wdhare
@wdhare 3 жыл бұрын
@@JayMartMedia Thanks for responding! I am running a very simple python script using TMUX. Is there a way to tell how much this will cost after the trial ends?
@JayMartMedia
@JayMartMedia 3 жыл бұрын
@@wdhare Unfortunately I can't say for sure exactly how much it would cost. Google has a calculator here which says that one instance of the f1-micro compute engine will cost ~$3.88/month when running 24/7: cloud.google.com/products/calculator One option would be to continue one month after the trial ends, and then cancel if. You decide it is too expensive.
@wdhare
@wdhare 3 жыл бұрын
@@JayMartMedia Thanks! Huge help!
@jakubkahoun5263
@jakubkahoun5263 2 жыл бұрын
@@JayMartMedia Actually this answer is false, since T2 micro in free tier, so if you have ONE T2 micro instance, you can have it for unlimited time for free. (You have 720h montly)
@nasr-rsln
@nasr-rsln 5 ай бұрын
man.. you're amazing!!!!!!
@JainmiahSk
@JainmiahSk 4 жыл бұрын
Like Heroku, If I want to run the script continuously 24/7 as there are some scheduled functions in it. Which will be the cheaper option GCP or Heroku
@prayushdawda7807
@prayushdawda7807 5 жыл бұрын
So, by using tmux, is the script in running state or does tmux only save the last state and then resumes to that state once we manually login? So, for example, if I had a script that continuosly downloaded random images from the internet and I leave it on with tmux, would it continue downloading images in the background even when I've closed the SSH terminal? Btw, awesome tutorial!
@JayMartMedia
@JayMartMedia 5 жыл бұрын
Good question, tmux stays in a running state even after you disconnect. Assuming that your script doesn't crash, and that you wrote your script to run continually (for example, a while longer that never exits) it will continue downloading images from the internet!
@qwertwhy3601
@qwertwhy3601 2 жыл бұрын
Very well explained, saved so much of my time! I have a question though, basically if my script was supposed to run forever, I'd be using tmux right?
@JayMartMedia
@JayMartMedia 2 жыл бұрын
Correct, tmux will allow the script to continue running when you close the terminal window. If there is an uncaught error in your program it will stop. You could look into using something like PM2 to restart your script if it ever stops: www.npmjs.com/package/pm2
@qwertwhy3601
@qwertwhy3601 2 жыл бұрын
@@JayMartMedia Alright, thanks
@sig7813
@sig7813 2 жыл бұрын
Another great video. Thank you
@haseebkhang1
@haseebkhang1 3 жыл бұрын
dear sir i am quite new to this field and watched this very carefully and i was so impressed, but now tell me about my password my project id and how to deploy python code regards abdul haseeb
@EnglishRain
@EnglishRain 3 жыл бұрын
Thanks for the "update" heads up in the description!
@codewik1176
@codewik1176 4 жыл бұрын
Thank you so much. .This is the video I am searching for.
@felixtorres4301
@felixtorres4301 2 жыл бұрын
Amazing tutorial. Thank you so much bro!
@johnl9015
@johnl9015 2 жыл бұрын
Hi I'm getting an error that says: Reading state information... Done E: Unable to locate package python3.9 E: Couldn't find any package by glob 'python3.9' E: Couldn't find any package by regex 'python3.9' when trying to execute sudo apt-get install python3.9 Any thoughts?
@JayMartMedia
@JayMartMedia 2 жыл бұрын
You will need to add an additional package archive to install newer versions of python. Here is an article about that: docs.python-guide.org/starting/install3/linux/
@muhammedozdemir5933
@muhammedozdemir5933 3 жыл бұрын
YOU ARE GREAT MAN !
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Thanks, glad you found the video helpful!
@zelbeboshoff2533
@zelbeboshoff2533 3 жыл бұрын
How do we install all the dependencies needed for our python script?
@JayMartMedia
@JayMartMedia 3 жыл бұрын
You can use pip to install packages just as you would locally. Here is a video where I install the discord library, your libraries will be similar, just a different package name: kzbin.info/www/bejne/jHbRaGN5bLhoh5o
@zelbeboshoff2533
@zelbeboshoff2533 3 жыл бұрын
@@JayMartMedia thanks for all the help!
@digitalnomad2196
@digitalnomad2196 7 ай бұрын
Great Share ! I know it says the about hourly 0.006 hourly so if you a run a simple script all day rob wont charge you. The estimate monthly says 4.28 dollars. Im assuming you tried this and never got charged.
@JayMartMedia
@JayMartMedia 7 ай бұрын
Yeah, this tutorial is pretty old, but there is still a 90 day trial where you can use up to $300 of credit (if it's a new account). It also looks like you can have one free small compute VM indefinitely as long as it is in one of the eligible regions: cloud.google.com/free/docs/free-cloud-features#free-tier-usage-limits
@digitalnomad2196
@digitalnomad2196 7 ай бұрын
@@JayMartMedia awesome thanks, do you have any new videos on this on your channel.
@abetterliferu
@abetterliferu 3 жыл бұрын
Super cool tutorial i dreamed of!!! Thank you a ton👍👍👍👍👌👌😎
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Glad it helped you, Bogdan!
@EL-sc9on
@EL-sc9on Жыл бұрын
can you make an update video to this showing how to restart and run the script even after it crashes
@GhullieUser
@GhullieUser 4 жыл бұрын
This is great! Thanks man
@ShovonMallick41
@ShovonMallick41 3 жыл бұрын
mkdir: cannot create directory ‘first-directory’: Permission denied if there any supporting file need to run that script, where should i put it? I have a python script that uses selenium webdriver to scrap data and then push this data to google sheet, how can I deploy this code including all supporting file on google cloud?
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Should not be anything else that you need to run before creating a new directory. Where are you trying to create the directory? It may be restricted and require admin permission to create a new directory in that directory. You should either run 'sudo mkdir {insert name of dir}' to try to create the directory as a super-user (admin). Or you could try to cd into a different directory that is not restricted. 'cd ~' will move you to the home directory of the current user, which I expect will not be restricted.
@joaopedro-jo8zg
@joaopedro-jo8zg 3 күн бұрын
Thank you, i found a lot of videos recomending some shity free services. while google doing this amazing job. apreciate it my friend 🇧🇷
@KJ-fs1li
@KJ-fs1li 3 жыл бұрын
Is it necessary to use tmux with corntab to run even if you close
@ashishmagar581
@ashishmagar581 4 жыл бұрын
Hey, working on college project n I've one python code and want to keep it running continuously 24/7, as it contains conditional statements, I don't want to start the whole code again from beginning, just want to keep it active/running as it is for 24/7 until it gets stopped by stop() command. I don't know whether it's possible as you described in video at last using tmux, as it restarts the code from start.
@BaceJeleren
@BaceJeleren 4 жыл бұрын
You would have to implement your own loop in your code, and just run it using tmux once. This could create some problems depending on your code though, and you'd need a lot of error handling
@scotter
@scotter 4 жыл бұрын
Thank you! Possible to use this method (Google Cloud) to run a python-based web site associated with a domain name?
@JayMartMedia
@JayMartMedia 4 жыл бұрын
Yes, that is possible! The most difficult part is setting up the nameservers and port forwarding. This documentation may help you out: codelabs.developers.google.com/codelabs/cloud-webapp-hosting-gce/index.html?index=..%2F..index#0
@KM-yw3ft
@KM-yw3ft 3 жыл бұрын
Hey, I am a bit confused and new to this stuff. Do you have to use tmux to keep the crontab running or they are two separate things and once I set up a crontab it will be live and stay live even if I close the window?
@JayMartMedia
@JayMartMedia 3 жыл бұрын
You do not have to use tmux to keep cron running. Cron will continue running commands at the specified time once the crontab is saved and closed.
@danieltech9458
@danieltech9458 5 жыл бұрын
Thank you, I got it make my project. Your video is amazing
@tommyc_123
@tommyc_123 2 жыл бұрын
Awesome video! Thanks a lot.
@JayMartMedia
@JayMartMedia 2 жыл бұрын
Thanks! Glad you found it helpful!
@jal051
@jal051 Жыл бұрын
One question. What is the difference between Compute Engine, App Engine and Cloud Run?
@JayMartMedia
@JayMartMedia Жыл бұрын
Compute engine is a virtual machine running on a cloud server. You don't maintain the hardware, but you have full control of the OS. Cloud Run is used to run docker images. So you create a docker (or other container) image, and tell cloud run what image to use, and it will spin up and scale as needed. App Engine is somewhat between the two. It is similar to Cloud Run, except you don't need to create a docker image. App Engine supports a few popular language, but not all languages. Here is a document from Google that may be helpful: www.google.com/url?sa=t&source=web&rct=j&url=cloud.google.com/blog/topics/developers-practitioners/where-should-i-run-my-stuff-choosing-google-cloud-compute-option
@jal051
@jal051 Жыл бұрын
@@JayMartMedia Thank you!
@lucasfernandeslima7474
@lucasfernandeslima7474 4 жыл бұрын
very nice, Jay! thank you!
@Zipppy012
@Zipppy012 4 жыл бұрын
One Question I have created a python game using pygame and tkinter and i want to upload the file on the web/make the game run on the web and have its own address not localhost how can i do that?
@RabeeQasem
@RabeeQasem 3 жыл бұрын
thank you man :-) but I have a question when we say ( 4 v CPU) for example we mean by that 4 core CPU ?
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Pretty much. vcpu is a virtual cpu, this could be a single core or in the case of hyper-threading, there may be two vcpu's per core. stackoverflow.com/questions/45967797/is-1-vcpu-on-google-compute-engine-basically-half-of-1-physical-cpu-core
@imVoyager3
@imVoyager3 2 жыл бұрын
Any good tips on how to integrate this with some sort of web form that other people can use? For instance if I wanted to perform some simple script hosted as you describe above, but have a web form where people can enter the parameters to run it with and see the results?
@giovanninirta945
@giovanninirta945 3 жыл бұрын
Thanks for the video, it's been very helpful. One question, why my bot python go on sleep mode and it Needs two commands for start?
@goaapie
@goaapie 4 жыл бұрын
@JayMartMedia Do I need to run the TMUX command in order to have the CRON JOB work? Or is this something seperate?
@JayMartMedia
@JayMartMedia 4 жыл бұрын
These are separate things. The cron job simply runs a specified command at a specific time (Command Run ON). And tmux allows a terminal session to remain open after disconnecting.
@marekkancir8272
@marekkancir8272 4 жыл бұрын
Hey, can I download txt or csv file which has been created by a script? Is it accessable from google drive or is there some easy chain of commands to either dowload it directly or move it to the my google drive? Thanks a lot!
@08ykr22
@08ykr22 4 жыл бұрын
I have a question. If I need another file besides the python code in the directory, for example a JSON file, how would I add that to the directory? Would I add it the same way the python file was added?
@JayMartMedia
@JayMartMedia 4 жыл бұрын
You can either create it as you did the python file, or you can follow this video about uploading files: kzbin.info/www/bejne/a6CsZo15Ys-hgLM Or you can look up how to upload files via FTP
@08ykr22
@08ykr22 4 жыл бұрын
@@JayMartMedia Thanks!
@parthpatel5532
@parthpatel5532 4 жыл бұрын
i have a question, i have a python script that does checks prices for products on amazon, and emails me if if there is a price drop/discount. So because of that, my python script requires other libraries, so will I need to first pip install/download those libraries to the server?
@JayMartMedia
@JayMartMedia 4 жыл бұрын
You will need to use pip to install those libraries onto the virtual machine
@Harry-tj2yz
@Harry-tj2yz 5 жыл бұрын
May be a stupid question but when u install something with pip can you just type import in the python document or will u need to gave it a file directory or move stuff around?
@JayMartMedia
@JayMartMedia 5 жыл бұрын
When you install with pip you should be able to just import in your python script. No moving files around required!
@kalpeshrawal7661
@kalpeshrawal7661 3 жыл бұрын
What's difference between screen and tmux ? Which is better and for what reasons ?
@JayMartMedia
@JayMartMedia 3 жыл бұрын
It's really personal preference. They both have a lot of the same features, and either could be used to run the script in the background. linuxhint.com/tmux_vs_screen/
@kalpeshrawal7661
@kalpeshrawal7661 3 жыл бұрын
@@JayMartMedia Thanks 👍
@kalpeshrawal7661
@kalpeshrawal7661 3 жыл бұрын
@@JayMartMediacan you plz make a video on how to read msg. From multiple group or channels of telegram in which we are not admin but just member. I done that but that's only applicable for a single group or channel not able for multiple
@danzrust
@danzrust 4 жыл бұрын
Any ideas why SSH window keeps crashing a few moments after I click the "SSH" button? I can't get into the black SSH at all... I just see the loading screen and then boom... crash. I just see "Transferring SSH keys to the VM".... I am clicking the SSH button for the very first time, had never logged in before because I keeps failing ever since.
@JayMartMedia
@JayMartMedia 4 жыл бұрын
I'm not sure. I haven't had that problem before. I tried to see if I could find a solution online, but nothing stick out to me. If there is a specific error message displayed, I would try copy/pasting that into your search bar in case someone else has had the problem. Otherwise you may be able to try a different browser
@danzrust
@danzrust 4 жыл бұрын
@@JayMartMedia I've found a person on stackoverflow with the same issue but no suggestion provided... I tried different browser, different projects... same issue, I don't really understand.
@JayMartMedia
@JayMartMedia 4 жыл бұрын
The only other option I can think of is using a different ssh client. You may be able to use gcloud: Click the dropdown next to the SSH button in the google cloud console and click "View gcloud command", then click "Run in cloud shell". This should open a panel in the bottom of your browser and prompt you to create an RSA key (type "Y" for yes, type a new password for the key, confirm the password) Alternatively you could use a third-party client such as PuTTY on Windows. This will be more difficult to set up if you haven't done it before. You can probably find another youtube video about it, and there is also documentation from Google here: cloud.google.com/compute/docs/instances/connecting-advanced#thirdpartytools
@brianwalsh7040
@brianwalsh7040 4 жыл бұрын
Great, thank you! do i get charged for running the vm for all the time my script is not running? For example, I run my script nightly at 8pm -- am i getting billed for running the vm for the other 23:50 hours of the day I am not running the script? Also how can I tell if my script is running from the cron job?
@thecorruptraider5112
@thecorruptraider5112 4 жыл бұрын
With google, you have the $300 free credit, and, they don't charge you unless you manually sign up to do so.
@as34242
@as34242 4 жыл бұрын
Beast, appreciate it man!
@jayjaychoo7284
@jayjaychoo7284 4 жыл бұрын
Hi Jay, thanks for the informative video. I am currently making a Twitter bot which is supposed to run on an hourly basis. I followed the crontabs part, but it doesn't seem to run, any idea what's causing this? Must I use tmux for this since I only want the bot to post hourly? Thanks once again.
@Justin-General
@Justin-General 4 жыл бұрын
I am having difficulties understanding the frequency, say I wanted to run nightly, doesn't matter when, so say midnight, what is the cronjob setting then? Thanks!!
@JayMartMedia
@JayMartMedia 4 жыл бұрын
This site may be helpful when setting cron job frequencies: crontab.guru/every-night-at-midnight Tl;dr: "0 0 * * *" is midnight First: 0 means it only runs the first minute Second: 0 means it only runs in the first hour Third: * means it runs any day of the month Fourth: * means it runs any month Fifth: * means it runs any day of the week
@muhammadyousef6261
@muhammadyousef6261 Жыл бұрын
Thank you so much for this video, I tried the cronjob however it's not working.
@liamtrotzuk59
@liamtrotzuk59 4 жыл бұрын
fantastic tutorial. thank you so much for sharing - incredibly helpful.
@iriealdana9228
@iriealdana9228 3 жыл бұрын
question how to import package to the python script? it always says "ModuleNotFoundError: No module named 'schedule'
@lugiadark21
@lugiadark21 4 жыл бұрын
You are a GOD. One video is all I needed, that is a miracle. Thank you so much
@SlightCatch
@SlightCatch 4 жыл бұрын
help! everything works but the crontab! i write "00 10 * * * python tweepy-bots/mybot.py" but it doesnt work! it works when i write it (its a twitter bot, when i type the command it works) but if i put that in crontab it doesnt work at all and i really dont know what to do.
@JayMartMedia
@JayMartMedia 4 жыл бұрын
The issue is likely that you are using a relative file path in the command. A relative path is dependent on which directory that you are in when you run a command. Crontab is likely 'running' the command from a different directory than you are running it from when you are testing the command. I would recommend using an absolute path. Here is a document which discusses the difference between relative vs absolute file paths: www.google.com/amp/s/www.geeksforgeeks.org/absolute-relative-pathnames-unix/amp/ Hope that helps!
@viniciusmacario4660
@viniciusmacario4660 2 жыл бұрын
Great video!
@jeffbong7989
@jeffbong7989 4 жыл бұрын
Hi Jay, this video is amazing, exactly what I am looking for! Thanks Jay!. However, I do have some confusion here. 1. Is the CRONTAB-E function same as TMUX? Is there any relation between tmux and cron job? 2. If I want to schedule a cron job to send out an email at 7pm every day, do I need to do the tmux thing first? Or just open ssh and then type crontab -e? 3. If i don't use the tmux upfront and set up a cron job, will the script running after I close the cron job? Your advise is very much appreciated.. Millions thanks in advance!
@JayMartMedia
@JayMartMedia 4 жыл бұрын
Hi Jeff, I'm glad you found the video helpful! There is no relation between tmux and crontab. Crontab is used for running commands at a certain time or interval. Cron comes from "Command Run ON". It literally just runs a certain command at a certain time. In this video I'm only using tmux to keep the terminal session active after closing the browser terminal. From what you said, it sounds like you probably just want to use crontab. The Cron job will run at the specified time even if you do not have a current terminal session (so you don't need tmux).
@jeffbong7989
@jeffbong7989 4 жыл бұрын
@@JayMartMedia Hi Jay, you are such a good guy! Thank you very much for your reply and detail reply. I have tried and it works, and at the same time has understand crontab and tmux better now.. A big thank you for your help! I will always view your video!
@kelvao.mp4
@kelvao.mp4 3 жыл бұрын
can I host a bot to run 24 hours? or would I have a limit and would I have to pay something?
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Yes, you could run the bot 24/7 for three months until the trial period runs out. Then you would have to start paying. I believe there is also a spending limit during the trial period as well, but you shouldn't get anywhere close to it if you get a single, small compute instance.
@varshilshah8311
@varshilshah8311 5 жыл бұрын
post 12 months / after my free credits i still have to pay right ?
@avishkarraut4755
@avishkarraut4755 4 жыл бұрын
Does scripts works even after we shut down system ?? Also I don't understand why you have filled info in google cloud platform ??
@edwinite
@edwinite 4 жыл бұрын
I'm getting this error and when I delete this code line it's still happening in other lines can you help me with that please ? File "bot.py", line 64 await channel.send(f'Welcome {member.mention}! Ready to jam out? See `!help` command for details!') ^ SyntaxError: invalid syntax
@sebastianmedina4993
@sebastianmedina4993 3 жыл бұрын
Hi this work for a webpage created with django?
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Yes, this would work with a django web server. Just need to make sure that you open the http and/or https port on the compute engine instance
@sebastianmedina4993
@sebastianmedina4993 3 жыл бұрын
@@JayMartMedia thanks!! (Sorry for my bad English, im from Argentina 🤣)
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Your English is much better than my Spanish!
@KobiLDN
@KobiLDN Жыл бұрын
very usefull, thanks for making this
@adalar42
@adalar42 2 жыл бұрын
Great video, thanks
@lkogangster9162
@lkogangster9162 3 жыл бұрын
YAY THANKS btw this is da 200th comment pls pin
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Hey Gangster, glad you found the video helpful! Thanks for 200th comment!
@SmarcosGameR
@SmarcosGameR 3 жыл бұрын
Hi, my script needs several packages , where i have to install it ?
@syedaizaznaqviofficial5453
@syedaizaznaqviofficial5453 2 жыл бұрын
How to create virtual environment or install requirements on cloud machine while running the script
@JayMartMedia
@JayMartMedia 2 жыл бұрын
You can use docker to containerize an application in the computer engine instance, you can use pip or pip3 to install python libraries, you can use apt/apt-get to install other programs or applications
@saurabhclh
@saurabhclh 2 жыл бұрын
Amazing video, How can i run selenium script in google cloud.
@djariwala1990
@djariwala1990 3 жыл бұрын
Helloo.. I am new on python and i want to install python web application on my web hosting ...and I face problem for installing pip install TA-Lib using Cpanel terminal..please help if you know solution
@TheNoviceCreator
@TheNoviceCreator 4 жыл бұрын
Will I be able to see the prints of my python script while it is executed using a crontab?
@JayMartMedia
@JayMartMedia 4 жыл бұрын
Copied from another comment thread: Outputting to a console from cron is difficult. However, if you only want to view the output, then you can save the scripts output into a text file pretty easily. Try using : "*/5 * * * * /usr/bin/python3 /home/USERNAME/my-first-directory/my-script.py > /home/USERNAME/my-first-directory/cronoutput.txt 2>&1" All I did was append "> /home/USERNAME/my-first-directory/cronoutput.txt 2>&1" to the end of you current Cron job. The ">" routes the normal output to the file specified. The "2&>1" routes any error output to the same file (alternatively you could replace the "1" in "2&>1" with a path to a different file if you wanted error output to a different file.) Let me know if this helps you out!
@TheNoviceCreator
@TheNoviceCreator 4 жыл бұрын
@@JayMartMedia thank you I'll try; my system is a bit complex in terms of prints because it scrapes form e-commerce sites, and I need to know if there is any unhandled exception.
@gnm280
@gnm280 3 жыл бұрын
This might be dumb question but it will work for ruby scripts in the crontab? like "ruby my-script.rb
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Yes, it will work for other languages/programs too. (Assuming the languages runtime environment etc. is installed!)
@gnm280
@gnm280 3 жыл бұрын
@@JayMartMedia thanks...I have succesfully implemented this solutions of yours for my project using python scripts..But now in other project, I'm trying to run ruby scripts and nothings happens. Its there a way to debugg it ? The commands in crontab -e wont run.
@JayMartMedia
@JayMartMedia 3 жыл бұрын
Here's a copy pasted response to debugging cron tab. I think it may be helpful in this case: Outputting to a console from cron is difficult. However, if you only want to view the output, then you can save the scripts output into a text file pretty easily. Try using : "*/5 * * * * /usr/bin/python3 /home/USERNAME/my-first-directory/my-script.py > /home/USERNAME/my-first-directory/cronoutput.txt 2>&1" All I did was append "> /home/USERNAME/my-first-directory/cronoutput.txt 2>&1" to the end of you current Cron job. The ">" routes the normal output to the file specified. The "2&>1" routes any error output to the same file (alternatively you could replace the "1" in "2&>1" with a path to a different file if you wanted error output to a different file.) Let me know if this helps you out!
@JayMartMedia
@JayMartMedia 3 жыл бұрын
I would make sure that you are using an absolute file path as opposed to a relative path. It could be that cron is attempting to run the script, but can't find it due to a relative path.
@gnm280
@gnm280 3 жыл бұрын
@@JayMartMedia thanks...I'm trying all sort of things. I have a script to insert rows into my bigquery table. If I run "ruby ~/scripts/insert_rows.rb" in my home directory, It works perfectly. If I wrote this same command in my crontab file nothing happens. Edit: I tried the command "touch test.txt" and works perfectly
@timtom3403
@timtom3403 4 жыл бұрын
Bro do python selenium scripts run on free VMs?I tried AWS free windows VM , didn't work on it
@JayMartMedia
@JayMartMedia 4 жыл бұрын
The Google Cloud VM's in this video are connected to the internet, so I believe it should work.
@timtom3403
@timtom3403 4 жыл бұрын
@@JayMartMedia even the aws vms are connected to the internet
@СуперХмырь
@СуперХмырь 5 жыл бұрын
Awesome, thanks man! But I used it on Russian Yandex Cloud :D
@JayMartMedia
@JayMartMedia 5 жыл бұрын
Great. I'm glad it worked for you!
@eazye7059
@eazye7059 3 жыл бұрын
яндекс дерьмо феерическое.Самая еб*нутая авторизация на яндекс клауд ,из всех что я видел. так и не удалось зайти)
@Cyrus_FG
@Cyrus_FG 4 жыл бұрын
Can you not install pip files, it won’t let me, keeps saying pip command not found
@hhhqqq3918
@hhhqqq3918 4 жыл бұрын
idk how to use this, but i wna just learn to make a gui rock paper scissors game on this. awesome! going to start this project!
@P3teR0cK
@P3teR0cK 5 жыл бұрын
good job. very helpful
@JayMartMedia
@JayMartMedia 5 жыл бұрын
Thanks for the encouragement. I'm glad you found the video helpful.
@aiblessed9061
@aiblessed9061 5 жыл бұрын
the ls doesn't work... please tell me why?
@JayMartMedia
@JayMartMedia 5 жыл бұрын
Hmmmm, I'm not sure why that doesn't work. Are you sure you are using a Linux based operating system? On Windows, the command to list the contents of a folder is "dir".
@JayMartMedia
@JayMartMedia 5 жыл бұрын
Also, are you sure that there are files in the directory that you are using ls in? Try doing: "cd .." (this will move you to the parent directory) Then: "ls" (this should list the directory that you were just in)
How I run my Python scripts everyday in the cloud
17:11
John Watson Rooney
Рет қаралды 9 М.
How to Host a FREE Website on Google Cloud Platform
16:23
Tony Teaches Tech
Рет қаралды 139 М.
Гениальное изобретение из обычного стаканчика!
00:31
Лютая физика | Олимпиадная физика
Рет қаралды 4,8 МЛН
When you have a very capricious child 😂😘👍
00:16
Like Asiya
Рет қаралды 18 МЛН
Deploy your Flask app on Google Cloud Platform
17:51
Leslie Wubbel
Рет қаралды 22 М.
Automate Python script execution on GCP
14:14
Cloud 4 Data Science
Рет қаралды 27 М.
Best Platforms to Host Python Apps (for free!!)
9:50
Patrick Loeber
Рет қаралды 140 М.
A new way to generate worlds (stitched WFC)
10:51
Watt
Рет қаралды 551 М.
This Took Me 150 Hours to Code
16:40
Kenny Gunderman
Рет қаралды 332 М.
SSH into Remote VM with VS Code | Tunneling into any cloud | GCP Demo
10:26
Deploy Python Applications From Source - Google Cloud Run
10:54
Raspberry Pi versus AWS // How to host your website on the RPi4
8:39
I made maps that show time instead of space
10:44
Václav Volhejn
Рет қаралды 825 М.