Skip to content

Instantly share code, notes, and snippets.

View ivansaul's full-sized avatar

ivansaul

View GitHub Profile
@ivansaul
ivansaul / python-save-cookies-in-netscape-format.ipynb
Created February 2, 2024 01:04
Python save cookies with Selenium, Playwright and Requests in Netscape Format
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

Privacy Policy for Cheat Sheets App

Last Updated: 05/04/24

Welcome to Cheat Sheets. This page informs you of our policies regarding the collection, use, and disclosure of personal information when you use our application and the services associated with it. By using the Cheat Sheets application, you agree to the practices described in this privacy policy.

1. Information We Collect:

1.1. Non-Personal Data: Cheat Sheets is an open-source application, meaning we do not collect personally identifiable information (PII) or any sensitive data. We do not actively track user activity or gather personally identifiable data.

@ivansaul
ivansaul / How-to-Install-Odoo-on-Arch-Linux.md
Created November 29, 2021 06:55
How to Install Odoo on Arch Linux

How to Install Odoo on Arch Linux?

  1. Install the Odoo AUR package.
$  yay -S odoo
  1. Configuring PostgreSQL to run with Odoo It is necessary to create a new PostgreSQL user for Odoo. For that log in as the default PostgreSQL superuser, 'postgres', by executing the following command:
@ivansaul
ivansaul / python-to-exe.md
Created July 26, 2021 22:59
How to convert python project into an executable? | cx_freeze | python to exe

How to convert a python project into an executable?

Suppose our project has the following structure.

MyApp
  |-models
  |  |-login.kv
  |-data
  |  |-words.json
@ivansaul
ivansaul / tinypng.py
Created May 31, 2021 21:29
Python: How to reduce the image file size with python| How to compress images in python
#https://tinypng.com/developers
#Free first 500 images per month
#pip install tinify
import tinify
tinify.key = "YOUR_API_KEY"
#Compressing images
source = tinify.from_file("unoptimized.jpg")
source.to_file("optimized.jpg")
@ivansaul
ivansaul / Google_Colab_SSH.md
Created March 4, 2021 03:01
How to connect to google colab with ssh from terminal
  1. You need to create an account on ngrok.com.
  2. Copy and paste below code in colab.
#@markdown <br><center></center>
#@markdown <center><h2>SSH Google Colab</h2></center><br>

#CODE
#Generate root password
import random, string
password = ''.join(random.choice(string.ascii_letters + string.digits) for i in range(5))
@ivansaul
ivansaul / Win7InstallMongoDB.md
Created February 26, 2021 23:01
Install Mongodb on windows 7 - 64 bit

Install Mongodb on windows 7 - 64 bit

  1. Firstly you downloaded mongodb 4.2.12 from here
  2. Unzip the folder in your directory example C:\mongodb
  3. Open the command prompt
  4. Go to your folder where the bin is and you write this on your command prompt : cd C:\mongodb\bin
  5. Then you have to specifies the directory where you want to put the data, you can create a folder called : C:\mongodb\data
  6. Whrite on your command prompt: mongod.exe --dbpath C:\mongodb\data
  7. Open new command prompt and write: cd C:\mongodb\bin then mongo.exe

Install Mongodb Compass on windows 7 - 64 bit

@ivansaul
ivansaul / get_youtube_id.py
Last active November 5, 2024 16:43
Python: Get youtube id | Extract Video id from a Youtube url
#pip install pytube
#Examples
url1='http://youtu.be/SA2iWivDJiE'
url2='http://www.youtube.com/watch?v=_oPAwA_Udwc&feature=feedu'
url3='http://www.youtube.com/embed/SA2iWivDJiE'
url4='http://www.youtube.com/v/SA2iWivDJiE?version=3&amp;hl=en_US'
url5='https://www.youtube.com/watch?v=rTHlyTphWP0&index=6&list=PLjeDyYvG6-40qawYNR4juzvSOg-ezZ2a6'
url6='youtube.com/watch?v=_lOT2p_FCvA'
url7='youtu.be/watch?v=_lOT2p_FCvA'
@ivansaul
ivansaul / fish_alias.md
Last active February 21, 2021 03:21
Create alias in Fish shell and save this as a permanent.

First method

A fish alias is actually implemented as a function. To save a function, you need funcsave. So this is the sequence

alias foo=bar
funcsave foo

That creates ~/.config/fish/functions/foo.fish which will then be available in any fish session.

Second method

I prefer this method so that I can easily edit my aliases in a single file.

@ivansaul
ivansaul / google_sheets.py
Created February 11, 2021 08:28
Simplest Way of Reading Google Sheets into a Pandas Dataframe (Python)
import pandas as pd
#Create a public URL
#https://docs.google.com/spreadsheets/d/0Ak1ecr7i0wotdGJmTURJRnZLYlV3M2daNTRubTdwTXc/edit?usp=sharing
#get spreadsheets key from url
gsheetkey = "0Ak1ecr7i0wotdGJmTURJRnZLYlV3M2daNTRubTdwTXc"
#sheet name
sheet_name = 'Sheet 1'