Skip to content

Instantly share code, notes, and snippets.

View fastfingertips's full-sized avatar
🧶
knitting..

fastfingertips

🧶
knitting..
  • Istanbul
  • 02:51 (UTC +03:00)
View GitHub Profile
url="https://gist.githubusercontent.com/zneak/53f885f1fc5856741cb4/raw/a17a81d15acb8109cda8524c743186901dd269b6/words.txt"
words=($(curl -s $url | grep '^\w\w\w\w\w$' | tr '[a-z]' '[A-Z]'))
actual=${words[$[$RANDOM % ${#words[@]}]]}
end=false
guess_count=0
max_guess=6
if [[ $1 == "unlimit" ]]; then
max_guess=999999
fi
while [[ $end != true ]]; do
@fastfingertips
fastfingertips / urlextract.py
Last active February 3, 2023 02:42
extract URL from HTML Page using BeautifulSoup
from bs4 import BeautifulSoup
import requests
inputUrl = input('Enter the url: ')
urlReq = requests.get(inputUrl)
reqData = urlReq.text
dataDom = BeautifulSoup(reqData)
domLinks = dataDom.find_all('a')
for linkNo, link in enumerate(domLinks): print(linkNo,link.get('href'))
import webbrowser
new = 2 # open in a new tab, if possible
url = "https://unix.org/"
webbrowser.open(url,new=new)
# open an HTML file on my own (Windows) computer
url = "file://C:/Users/User/index.html"
webbrowser.open(url,new=new)
@fastfingertips
fastfingertips / get_a_href.py
Created February 20, 2022 16:05
Scraping Link from HTML
from bs4 import BeautifulSoup
import requests, re
def getDom(_url):
return requests.get(_url).text # response
urlDom = getDom(input('Url: '))
parserDom = BeautifulSoup(urlDom, 'html.parser')
for link in parserDom.find_all('a', attrs={'href': re.compile('^https://')}):
@fastfingertips
fastfingertips / wlan-export.bat
Created March 10, 2022 12:34
Export wlan pw
netsh wlan export profile folder="%UserProfile%\Desktop"
netsh wlan export profile key=clear folder="%UserProfile%\Desktop"
@fastfingertips
fastfingertips / ssid_pw.sh
Created March 10, 2022 12:37
Get ssid pw
echo Wifi name:?
read ssid
netsh wlan show profile name=$ssid key=clear
read -s -p "Press any key to exit ..."
@fastfingertips
fastfingertips / wlan-details.ps1
Created March 10, 2022 12:46
lists saved wlan passwords
(netsh wlan show profiles) | Select-String “\:(.+)$” | %{$name=$_.Matches.Groups[1].Value.Trim(); $_} | %{(netsh wlan show profile name=”$name” key=clear)} | Select-String “Key Content\W+\:(.+)$” | %{$pass=$_.Matches.Groups[1].Value.Trim(); $_} | %{[PSCustomObject]@{ PROFILE_NAME=$name;PASSWORD=$pass }} | Format-Table -AutoSize
@fastfingertips
fastfingertips / scraping
Last active August 11, 2022 00:49
Scraping tools
LXML
SCRAPY
HTTPLIB
REQUESTS
SELENIUM
HTMLparser
HTMLPARSER
BEAUTIFULSOUP
URLLIB / URLLIB2
https://lxml.de/
@fastfingertips
fastfingertips / google-10000-words.txt
Last active September 2, 2022 17:45
Google 10000 words.
the
of
and
to
a
in
for
is
on
that
def uncamel(text):
"""helloWorld => hello_world"""
r = ''
for t in text:
r += '_' + t.lower() if t.isupper() else t
return r
print(uncamel('helloWorld'))
print(uncamel('goodbyeWorld'))
print(uncamel('loremIpsum'))