Skip to content

Instantly share code, notes, and snippets.

View dan-r95's full-sized avatar
🥵
Focusing

Daniel dan-r95

🥵
Focusing
View GitHub Profile
@dan-r95
dan-r95 / ocr.sh
Created April 13, 2023 10:04
ocr all pdfs - make them searchable
#!/bin/zsh
# iterate through all files in the current directory
for file in *.pdf
do
# get the filename without the extension
filename="${file%.*}"
# create a new filename with the extension .txt
newfile="output/$filename-s.pdf"
# run the command
yes | sudo apt update
yes | sudo apt upgrade
yes | sudo apt autoremove
@dan-r95
dan-r95 / applist.sh
Last active November 15, 2022 18:52
applist.sh
#!/bin/bash
# todo add error checking ${}..
cd ~/Downloads
sudo apt install git
wget -nc https://release.gitkraken.com/linux/gitkraken-amd64.deb
wget -nc 'https://code.visualstudio.com/sha/download?build=stable&os=linux-deb-x64' -O code.deb
wget https://dbeaver.io/files/dbeaver-ce_latest_amd64.deb -O dbeaver.deb
sudo dpkg -i *.deb
sudo apt install snapd
@dan-r95
dan-r95 / pandas-MAGIC.py
Last active August 21, 2020 18:55
💯
# either when comp is turning 1 or failure equals comp1
# turn ob the life eihter when maintenance happened or failure!
labeled_features['life_comp1'] = labeled_features.groupby((labeled_features['comp1'] != labeled_features['comp1'].shift(1)).cumsum()).cumcount()+1
labeled_features['life_comp2'] = labeled_features.groupby((labeled_features['comp2'] != labeled_features['comp2'].shift(1)).cumsum()).cumcount()+1
labeled_features['life_comp3'] = labeled_features.groupby((labeled_features['comp3'] != labeled_features['comp3'].shift(1)).cumsum()).cumcount()+1
labeled_features['life_comp4'] = labeled_features.groupby((labeled_features['comp4'] != labeled_features['comp4'].shift(1)).cumsum()).cumcount()+1
#print(labeled_features.groupby((labeled_features['comp1'] != labeled_features['comp1'].shift(1)).cumsum()).tail(1))
#print(labeled_features.groupby((labeled_features['comp1'] != labeled_features['comp1'].shift(1)).cumsum()))
@dan-r95
dan-r95 / hotspot.sh
Last active August 20, 2020 05:41
Automatically turn on ubuntu wifi hotspot
#!/bin/bash
nmcli connection up Hotspot
# run with:
# crontab -e
# insert this line
@dan-r95
dan-r95 / autokeras-load-save-problem.ipynb
Created August 7, 2020 13:04
autokeras - load save problem.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dan-r95
dan-r95 / memory-error.ipynb
Created August 6, 2020 15:09
memory-error.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dan-r95
dan-r95 / memory-error.ipynb
Created August 6, 2020 14:53
memory-error.ipynb
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@dan-r95
dan-r95 / bearing.py
Created June 25, 2020 13:22
download Case Western Reserve University Bearing Data to folder (google colab)
import pandas as pd
""" downloads the dataset, so that all matlab files of each class are in their own folder
the package cwru is sadly only for python2
12DriveEndFault / 172.mat
/ 189.mat
...
12FanEndFault / 89.mat
...
@dan-r95
dan-r95 / googleVMsetup.sh
Created May 27, 2020 15:26
setup google vm dependencies
yes | sudo apt update && sudo apt upgrade
pip3 install tensorflow
pip3 install torch torchvision
git clone git://github.com/jupyter/jupyter-drive.git
pip install -e jupyter-drive
python -m jupyterdrive