Skip to content

Instantly share code, notes, and snippets.

View filipsPL's full-sized avatar
💭
🚀 travelling to Mars and back

filips filipsPL

💭
🚀 travelling to Mars and back
View GitHub Profile
@filipsPL
filipsPL / gpsinfo.sh
Created December 5, 2023 20:48
information on gps from gpsd (gpspipe and qj)
#!/bin/bash
# Run gpspipe to get GPS data in JSON format
# gps_data=$(gpspipe -w -n 10 | grep -m 1 TPV)
gps_data=$(/usr/local/bin/gpspipe -w -n 15 | grep -m 1 -E "TPV")
gps_data_sat=$(/usr/local/bin/gpspipe -w -n 15 | grep -m 1 -E "SKY")
# Check if the data is available
if [ -n "$gps_data" ]; then
@filipsPL
filipsPL / dirstats.sh
Created July 10, 2023 09:31
List dir sizes and number of files there in bash, with colors.
#!/bin/bash
printf "\033[32m%20s\033[m \033[35m%20s\033[m %10s\n" "Dir size" "Directory" "Number of files"
echo "------------------------------------------------------------------------------------"
for d in $(find . -maxdepth 1 -mindepth 1 -type d 2>/dev/null); do
printf "\033[32m%20s\033[m \033[35m%20s\033[m %10d files\n" $(du -sh $d 2>/dev/null | tr -d '\n') $(find $d -type f 2>/dev/null | wc -l)
done
@filipsPL
filipsPL / output.txt
Created February 10, 2023 11:07
bash script to split multimodel pdb file into separate files
# split-pdb-models.sh model1_1.pdb
2.3.4.5.6.7.8.9.10.11.12.13.14.15.16.17.18.19.20.21.22.23.24.25.26.27.28.29.30.31.32.33.34.35.36.37.38.39.40.41.42.43.44.45.46.47.48.49.50.51.52.53.54.55.56.57.58.59.60.61.62.63.64.65.66.67.68.69.70.71.72.73.74.75.76.77.78.79.80.81.82.83.84.85.86.87.88.89.90.91.92.93.94.95.96.97.98.99.100.101.102
# ls
model1_1_model_100.pdb model1_1_model_18.pdb model1_1_model_28.pdb model1_1_model_38.pdb model1_1_model_48.pdb model1_1_model_58.pdb model1_1_model_68.pdb model1_1_model_78.pdb model1_1_model_88.pdb model1_1_model_98.pdb
model1_1_model_101.pdb model1_1_model_19.pdb model1_1_model_29.pdb model1_1_model_39.pdb model1_1_model_49.pdb model1_1_model_59.pdb model1_1_model_69.pdb model1_1_model_79.pdb model1_1_model_89.pdb model1_1_model_99.pdb
model1_1_model_102.pdb model1_1_model_1.pdb model1_1_model_2.pdb model1_1_model_3.pdb model1_1_model_4.pdb model1_1_model_5.pdb model1_1_model_6.pdb model1_1_model_7.pdb model1_1_model_8.pdb model1_1_model_
@filipsPL
filipsPL / howto.md
Created January 10, 2022 17:32
Solve OpenWrt problems with starting adblock

The message:

Mon Jan 10 18:26:02 2022 user.err adblock-4.1.3[1577]: coreutils sort not found or not executable

/etc/init.d# ./adblock status
::: adblock runtime information
  + adblock_status  : error
  + adblock_version : 4.1.3
 + blocked_domains : 0
@filipsPL
filipsPL / update_all_pips.sh
Last active December 14, 2021 08:06
Update all packages installed via pip but in a conda environment
#!/bin/bash
# update all packages installed via pip but in a conda environment
# may be necesarry to run twice to satisfy all requirements
conda list | egrep "pypi$" | tr -s ' ' | cut -d ' ' -f 1 | xargs pip install --upgrade
@filipsPL
filipsPL / README.md
Last active March 11, 2021 21:19
mosquitto_sub with timestamp and colors

To create pretty outputs from mosquitto_sub with timestamp install:

How to use:

mosquitto_sub -h brokerIp -t iot/# -v | ts | h esp32-keypad esp32-tm1637 esp32-strych status temp 'timeInt|time' offline ready scanning
@filipsPL
filipsPL / fixme.md
Created November 9, 2020 09:22
Atom.io Python Autocomplete doesn't work

It just doesnt work.

How to fix:

cd ~/.atom/packages/autocomplete-python/lib/jedi/parser`
cp grammar3.7.txt grammar3.8.txt
cp grammar3.7.txt grammar3.9.txt
@filipsPL
filipsPL / README.md
Last active August 19, 2020 07:44
Polski opis warunków pogodowych publikowanych przez met.no json
@filipsPL
filipsPL / README.md
Created July 7, 2020 08:11
Installing pymol from sources under Ubuntu 20.04 LTS

Single time procedure

sudo apt-get install git build-essential python3-dev libglew-dev \
   libpng-dev libfreetype6-dev libxml2-dev \
   libmsgpack-dev python3-pyqt5.qtopengl libglm-dev libnetcdf-dev freeglut3-dev

pip3 install PyQt5

git clone --depth=1 https://github.com/schrodinger/pymol-open-source.git
@filipsPL
filipsPL / README.md
Created June 15, 2020 11:49
[solved] Unable to start h2o AI java jar: Boot class path mechanism is not supported

the problem

when running h2o.ai:

java -jar h2o.jar

there is an error:

06-15 13:26:18.086 192.168.12.198:54321 19409 main INFO: ----- H2O started -----