Skip to content

Instantly share code, notes, and snippets.

@rhoconlinux
rhoconlinux / pip_check_v2.py
Created January 17, 2024 21:44
pip_check_v2.py
import importlib.metadata
import subprocess
import sys
def check_and_install(package_or_file, file=False):
if file:
with open(package_or_file, 'r') as file:
packages = file.readlines()
else:
packages = [package_or_file]
@rhoconlinux
rhoconlinux / pip_check_then_install.py
Created January 17, 2024 10:09
pip_check_then_install.py
def check_and_install(package):
try:
importlib.metadata.version(package)
print(f"Package {package} already installed ... ✅")
except importlib.metadata.PackageNotFoundError:
subprocess.check_call([sys.executable, '-m', 'pip', 'install', package])
#use:
#check_and_install("langchain")
@rhoconlinux
rhoconlinux / loki window buttons mac
Created September 21, 2017 02:12
loki window buttons mac
#Window Button Fixes
gsettings set org.gnome.shell.overrides button-layout 'close,minimize,maximize:' < "/dev/null"
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/DecorationLayout': <'close,minimize,maximize:'>}" < "/dev/null"
gsettings set org.pantheon.desktop.gala.appearance button-layout 'close,minimize,maximize:' < "/dev/null"
gsettings set org.gnome.desktop.wm.preferences button-layout 'close,minimize,maximize:' < "/dev/null"
@rhoconlinux
rhoconlinux / marp-installer.sh
Last active September 12, 2017 21:57
marp-installer.sh
#/bin/bash
cd /tmp
wget https://gist.githubusercontent.com/rhoconlinux/36e7e64485ea76cecae8ef0b919b577f/raw/bcffec6b90faaad3ce4acf8d3e115aa65e75c815/marp.desktop
cp marp.desktop ~/.local/share/applications
chmod +x ~/.local/share/applications/marp.desktop
@rhoconlinux
rhoconlinux / marp.desktop
Last active September 12, 2017 21:53
marp.desktop
[Desktop Entry]
Version=1.0
Terminal=false
Type=Application
Name=Marp
Exec=/opt/Marp/marp
Icon=/opt/Marp/marp.png
NoDisplay=true
StartupWMClass=marp
@rhoconlinux
rhoconlinux / wavebox icon hardcode fix
Created August 6, 2017 09:12
wavebox icon hardcode fix
wget https://github.com/rhoconlinux/algunas-cosas-sueltas/raw/master/icon-fixes/Spark%20Alt_1024x1024x32.png -O icon.png ; sudo rm /opt/wavebox/icon.png ; sudo mv icon.png /opt/wavebox/
@rhoconlinux
rhoconlinux / apt dpkg fixer.sh
Created July 21, 2017 03:03
apt dpkg fixer
sudo systemctl stop apt-daily.timer
sudo killall -9 apt
sudo killall -9 apt-get
sudo systemctl start apt-daily.timer
@rhoconlinux
rhoconlinux / Loki in Macbook Installer 201707 devnull
Last active November 11, 2017 03:32
Loki in Macbook Installer 201707 devnull
#!/bin/bash
############## Ver 4
############## Fixes & Upgrade
#basic fixes for loki
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/DialogsUseHeader': <0>, 'Gtk/ShellShowsAppMenu': <0>, 'Gtk/DecorationLayout': <'close:menu,maximize'>}" < "/dev/null"
sudo service apport stop ;
sudo sed -i 's/enabled=1/enabled=0/g' /etc/default/apport ;
@rhoconlinux
rhoconlinux / loki v 201707 macbokk.sh
Last active August 21, 2017 00:46
loki v 201707 macbokk
#!/bin/bash
############## Ver 3a
############## Fixes & Upgrade
#basic fixes for loki
gsettings set org.gnome.settings-daemon.plugins.xsettings overrides "{'Gtk/DialogsUseHeader': <0>, 'Gtk/ShellShowsAppMenu': <0>, 'Gtk/DecorationLayout': <'close:menu,maximize'>}" < "/dev/null"
sudo service apport stop ;
sudo sed -i 's/enabled=1/enabled=0/g' /etc/default/apport ;
@rhoconlinux
rhoconlinux / nautilus csd 1604 loki fix script.sh
Last active July 14, 2017 23:19
nautilus csd 1604 loki fix script
#!/bin/bash
sudo cd /tmp
wget https://gist.githubusercontent.com/rhoconlinux/68af9d6b4be8de97c284ff9dde303d4c/raw/cbf22486dfffffcce43d736c554846bf111682eb/nautilus%20csd%20fix%201604 -O nautilus.desktop
cat nautilus.desktop
sudo mv /usr/share/applications/nautilus.desktop /usr/share/applications/nautilus-nocsd.ddesktop
sudo mv nautilus.desktop /usr/share/applications/nautilus.desktop
cd
#