Skip to content

Instantly share code, notes, and snippets.

View mysql_watch_online
#!/bin/bash
# /etc/cron.d/mysql_watch_online
# Test the database connection and restart on failure
mysql -e '\q'
if [ $? != 0 ]; then
echo `systemctl status mysql` | mail -s "MySQL Databse experience issues | `hostname`" your@email.com
systemctl restart mysql
fi
View 99-ddcci.rules
SUBSYSTEM=="i2c-dev", ACTION=="add",\
ATTR{name}=="NVIDIA i2c adapter*",\
TAG+="ddcci",\
TAG+="systemd",\
ENV{SYSTEMD_WANTS}+="ddcci@$kernel.service"
@emilcarr
emilcarr / GNOME.md
Last active Apr 7, 2021
Minimal GNOME Shell Setup and environment
View GNOME.md

Minimal GNOME Shell Setup

GNOME is nice, but it comes with a lot of packages by default. You may wish to install a more lightweight version.

screenshot of this setup

Packages

@emilcarr
emilcarr / sxhkdrc
Created Mar 17, 2021
sxhkd config to take a screenshot and copy it to the x clipboard
View sxhkdrc
Print
scrot -s ~/Pictures/%d-%m-%y_%h-%m-%T_$wx$h_scrot.png -e 'xclip -selection clipboard -target image/png -i $f'
@emilcarr
emilcarr / $urxvt-nvim.md
Last active Mar 19, 2021
urxvt and vim setup for productivity
View $urxvt-nvim.md

urxvt and nvim Setup for Productivity

Install nvim, urxvt and zsh:

Arch:

# pacman -S neovim rxvt-unicode zsh

Debian:

@emilcarr
emilcarr / INDEX.md
Last active Apr 7, 2021
Index of all my gists and other bookmarks
View INDEX.md
@emilcarr
emilcarr / EFIstub.md
Created Mar 15, 2021
Create an EFI Stub bootloader for those times GRUB refuses to behave.
View EFIstub.md

EFI Stub

Sometimes GRUB refuses to behave. In those cases, unless you are dual booting, you can make an EFI Stub to boot directly into linux. You must be using an EFI system partition.

Setup

Install efibootmgr

Arch Linux:

@emilcarr
emilcarr / C and C++.md
Last active Mar 15, 2021
C/C++ Development Workflow
View C and C++.md

C/C++ Development Workflow

Setup

Install nvim with coc.nvim and NERDTree

Add this to your .vimrc:

""" NERDTree
" Show NERDTree file manager
@emilcarr
emilcarr / display-ip.service
Created Mar 14, 2021
Display IP address on boot
View display-ip.service
# put me in /etc/systemd/system/display-ip.service
[Unit]
Description=Display IP address on boot
After=multi-user.target
After=network-online.target
[Service]
Type=oneshot
ExecStart=/usr/bin/bash -c "echo `ifconfig | awk '/inet /{print $2}'` > /dev/tty1"