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
wget -q -O - https://dl.google.com/linux/linux_signing_key.pub | sudo apt-key add - |
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
gs -dNOPAUSE -dBATCH -dNOPLATFONTS -sDEVICE=pdfwrite -dEmbedAllFonts=true -sOutputFile=out.pdf -f Wireless_Sensors_for_Assessment_of_Cardiac_Function_Final-BW2.pdf |
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
security find-generic-password -ga "wifi_network_name" | grep "password:" |
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
#crop bottom 10 pixels off all files that look like ffefd224-f72b-47e7-9671-c79fbebe25fd.jpg | |
# ie 8 digits hex, dash, 4 digits ....jpg | |
for f in $(ls|grep -E '^([a-f0-9]){8}\-([a-f0-9]){4}.*.jpg'); do echo $f; convert $f -gravity south -chop 0x10 $f;done | |
# grep -E is extended regex which requires less slashes iiuc, () around capture group you want to appear {n} times, . matches anyting |
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
rdfind -deleteduplicates true . # delete duplicates with criteria for what to keep | |
file * # info on files e.g. image sizes | |
exec # get piped info and act on it | |
webhttrack # gui for web scrape | |
detox -r <folder> # remove spaces | |
find /tmp/ -depth -name "* *" -execdir rename 's/ /_/g' "{}" \; # remove filename spaces | |
to fix errs on apt-get update try removing old/broken/irrelevant files from /etc/apt/sources.list.d |
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
# sed 's\.*/\\' cuts anything before the final forward slash , leaving filename without path | |
for f in $(find . -name '*.jpg'); do echo $f;echo $f|sed 's\.*/\\' ;cp $f $(echo $f|sed 's|.*/||'); done | |
#or e.g. only .jpgs larger than 10k and put in specific dir | |
for f in $(find /path/to/dirwithsubdirs/ -name '*mark.png' -size +10k ); do echo $f;echo $f|sed 's|.*/||' ;cp $f /path/to/destiny/data_logos/$(echo $f|sed 's\.*/\\'); done | |
#dont clobber extant files, by using cp --backup=numbered | |
for f in $(find /path/to/dir -name '*.jpg'); do cp --backup=numbered $f pics/$(echo $f|sed 's|.*/||'); done |
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 os | |
def ensure_dir(path): | |
''' | |
Create missing dirs recursively unless something coincides with file, or no permissions | |
:param path:desired path , to be created | |
:return:True if desired path created, False if not | |
''' | |
if not os.path.isdir(path): | |
print(path+' does not exist, creating') |
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
sudo apt update | |
sudo apt install firefox python3-pip xvfb x11-utils --yes | |
sudo -H pip3 install bpython selenium | |
export DISPLAY=:2 | |
Xvfb $DISPLAY -ac & | |
export GECKO_DRIVER_VERSION='v0.24.0' | |
wget https://github.com/mozilla/geckodriver/releases/download/$GECKO_DRIVER_VERSION/geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz | |
tar -xvzf geckodriver-$GECKO_DRIVER_VERSION-linux64.tar.gz |
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
#assumes selenium browser object | |
def get_img_and_further_info(browser,img_src): | |
try: | |
im = imageio.imread(img_src) | |
plt.plot(im) | |
plt.imshow() | |
# vv.imshow(im) | |
imageio.imwrite('test.jpg',im) | |
except Exception as e: |
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
<!DOCTYPE html><html lang="en"><head> | |
<meta charset="utf-8"> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge"> | |
<title>Sales Navigator</title> | |
<meta name="description" content=""> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0"> | |
<style> | |
/* stylelint-disable */ | |
.initial-load-animation { |
NewerOlder