Skip to content

Instantly share code, notes, and snippets.

@emilcarr
emilcarr / display-ip.service
Created March 14, 2021 20:48
Display IP address on boot
# 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"
@emilcarr
emilcarr / C and C++.md
Last active March 15, 2021 15:14
C/C++ Development Workflow

C/C++ Development Workflow

Setup

Install nvim with coc.nvim and NERDTree

Add this to your .vimrc:

""" NERDTree
" Show NERDTree file manager
@emilcarr
emilcarr / sxhkdrc
Created March 17, 2021 22:06
sxhkd config to take a screenshot and copy it to the x clipboard
Print
scrot -s ~/Pictures/%d-%m-%y_%h-%m-%T_$wx$h_scrot.png -e 'xclip -selection clipboard -target image/png -i $f'
#!/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
@emilcarr
emilcarr / FFMPEG.md
Last active May 28, 2021 13:05
ffmpeg commands cheatsheet

FFMPEG cheatsheet

Convert video for twitter

Twitter only works with videos with AAC audio, YUV 4:2:0 pixel format and an aspect ratio between 1:3 and 3:1, according to their developer docs

ffmpeg -i input_video.mp4 -c:a aac -c:v libx264 -filter:v "format=yuv420p" output_video.mp4

Audio over a static image

@emilcarr
emilcarr / INDEX.md
Last active May 28, 2021 13:06
Index of all my gists and other bookmarks
@emilcarr
emilcarr / EFIstub.md
Created March 15, 2021 15:42
Create an EFI Stub bootloader for those times GRUB refuses to behave.

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:

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 April 5, 2024 13:49
Minimal GNOME Shell Setup and environment

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 / scanning.md
Last active April 5, 2024 13:51
List of useful scanning tools