This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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://')}): |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
netsh wlan export profile folder="%UserProfile%\Desktop" | |
netsh wlan export profile key=clear folder="%UserProfile%\Desktop" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
echo Wifi name:? | |
read ssid | |
netsh wlan show profile name=$ssid key=clear | |
read -s -p "Press any key to exit ..." |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
LXML | |
SCRAPY | |
HTTPLIB | |
REQUESTS | |
SELENIUM | |
HTMLparser | |
HTMLPARSER | |
BEAUTIFULSOUP | |
URLLIB / URLLIB2 | |
https://lxml.de/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
the | |
of | |
and | |
to | |
a | |
in | |
for | |
is | |
on | |
that |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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')) |
OlderNewer