Skip to content

Instantly share code, notes, and snippets.

View sujit's full-sized avatar

Sujit Ghosal sujit

View GitHub Profile
@sujit
sujit / vim_epoch_utc_convert.md
Last active July 16, 2019 11:56
Modify/Substract/Add hours offsets to UTC timestamps (eliot_debug.log)

Open JSON log & type the following to convert all timestamps:

7 hrs past (epoch format):

%s/"timestamp":\s*\zs\(\d\+\)\ze\./\=(str2nr(submatch(1)) - (7 * 60 * 60))/g

8 hrs forward (epoch format):

%s/"timestamp":\s*\zs\(\d\+\)\ze\./\=(str2nr(submatch(1)) + (8 * 60 * 60))/g

7 hrs past (human readable):

@sujit
sujit / bypass_ssl_insecurities.py
Last active April 28, 2024 13:18
Selenium Bypass SSL Bad/Revoked Certificates
import sys
from time import sleep
from selenium import webdriver
from selenium.common.exceptions import TimeoutException
from selenium.common.exceptions import WebDriverException
from eliot import start_action, to_file, log_call
# from selenium.webdriver.common.keys import Keys
# from selenium.webdriver.common.desired_capabilities import DesiredCapabilities
# from selenium.webdriver.common.by import By
# from selenium.webdriver.support import expected_conditions as EC