Skip to content

Instantly share code, notes, and snippets.

View Ramhm's full-sized avatar
👾

Ramin Hakimi Ramhm

👾
View GitHub Profile
@Ramhm
Ramhm / certbot.sh
Created January 14, 2023 13:36 — forked from fideloper/certbot.sh
Certbot on Ubuntu, wildcard subdomains via CloudFlare DNS challenge
# Used on Ubuntu 18.04 and 20.04
# Find instructions for other OSes here: https://certbot.eff.org/instructions
# Install Certbot via Snaps
sudo snap install core; sudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
# Install DNS CloudFlare plugin
sudo snap set certbot trust-plugin-with-root=ok
# Problem Description:
How to resolve scheduler and controller-manager unhealthy state in Kubernetes
# Symptom:
$ kubectl get cs / kubectl get componentstatuses
Warning: v1 ComponentStatus is deprecated in v1.19+
NAME STATUS MESSAGE ERROR
controller-manager Unhealthy Get "http://127.0.0.1:10252/healthz": dial tcp 127.0.0.1:10252: connect: connection refused
scheduler Unhealthy Get "http://127.0.0.1:10251/healthz": dial tcp 127.0.0.1:10251: connect: connection refused
etcd-0 Healthy {"health":"true"}
@Ramhm
Ramhm / web-servers.md
Created May 1, 2021 10:22 — forked from willurd/web-servers.md
Big list of http static server one-liners

Each of these commands will run an ad hoc http static server in your current (or specified) directory, available at http://localhost:8000. Use this power wisely.

Discussion on reddit.

Python 2.x

$ python -m SimpleHTTPServer 8000
@Ramhm
Ramhm / ExcelData
Created February 12, 2021 15:12 — forked from charlottevaval/ExcelData
Selenium login
Url Username Password Result
http://deltauat.managedmaint.com/auth/logout [email protected] test1234
http://deltauat.managedmaint.com/auth/logout [email protected] 125lkk
@Ramhm
Ramhm / example.py
Created February 12, 2021 15:05 — forked from ochen1/example.py
Google Login
from signal import pause
from rich.console import Console
from google_login import *
console = Console()
console.log("Initializing ChromeOptions...")
options = webdriver.ChromeOptions()
options.headless = False
@Ramhm
Ramhm / recaptcha.py
Created February 12, 2021 15:03 — forked from anton-petrov/recaptcha.py
Solve reCAPTCHA with Selenium + Python
import re, csv
from time import sleep, time
from random import uniform, randint
from selenium import webdriver
from selenium.webdriver.common.by import By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.common.action_chains import ActionChains
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import NoSuchElementException
from selenium import webdriver
from selenium.webdriver.chrome.options import Options
from BeautifulSoup import BeautifulSoup
import time
NAME = "Mom"
RELOAD_TIMEOUT = 1
ERROR_TIMEOUT = 5
NUM_CYCLES = 10
FIREFOX_PATH = "/Users/sgrover/Library/Application Support/Firefox/Profiles/9w4h7jdq.default"
@Ramhm
Ramhm / whatsapp.py
Created February 12, 2021 15:01 — forked from deepak3081996/whatsapp.py
send whatsapp messages using python
from selenium import webdriver
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.webdriver.common.by import By
from selenium.webdriver.common.keys import Keys
def message(to,message=''):
"""this a simple function to send a whatsapp message to your friends
and group using python and selenium an automated tool to parse the HTML
content and to change the properties.
@Ramhm
Ramhm / scrape-google-image-search.py
Created February 12, 2021 15:00 — forked from kekeblom/scrape-google-image-search.py
A script for scraping image thumbnails from google image search using selenium.
# Copyright (c) 2016 Kenneth Blomqvist
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFT
@Ramhm
Ramhm / proxy.py
Created February 12, 2021 14:59 — forked from rajat-np/proxy.py
from selenium import webdriver
from selenium.webdriver.common.proxy import Proxy
from selenium.webdriver.common.keys import Keys
from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
from selenium.webdriver.chrome.options import Options
import zipfile,os
def proxy_chrome(PROXY_HOST,PROXY_PORT,PROXY_USER,PROXY_PASS):
manifest_json = """
{