Skip to content

Instantly share code, notes, and snippets.

View dcampos's full-sized avatar

dcampos dcampos

  • Brazil
  • 03:35 (UTC -03:00)
View GitHub Profile
@dcampos
dcampos / btrs-subvolume-swap.sh
Last active July 29, 2025 12:45
Create a swap file on a btrfs subvolume and use it for hibernation in openSUSE. Reference: https://forums.opensuse.org/t/create-btrfs-subvolume/167047/2
# Create subvolume and swap file
# <dev> is the volume of the btrfs partition
sudo mount -o subvol=/ /dev/<dev> /mnt/
sudo btrfs subvolume create /mnt/@/swap
sudo umount /mnt
sudo mkdir /swap
sudo mount -o subvol=/@/swap /dev/<dev> /swap/
# This creates ~12GB swap file
# Check /sys/power/image_size for the minimum needed
PS1='\[\e[32m\]┌──(\[\e[94;1m\]\u\[\e[94m\]@\[\e[94m\]\h\[\e[0;32m\])-[\[\e[38;5;46;1m\]\w\[\e[0;32m\]] [\[\e[32m\]$?\[\e[32m\]]\n\[\e[32m\]╰─\[\e[94;1m\]\$\[\e[0m\]'
all:
g++ nvim.cpp -o nvim_test -I msgpack/include/ -lboost_filesystem -lboost_system
@dcampos
dcampos / nvim.sh
Created April 8, 2023 16:48
Build nvim debian package (non longer generated after 0.9.0)
CC=gcc make CMAKE_BUILD_TYPE=RelWithDebInfo CMAKE_EXTRA_FLAGS="-DCMAKE_INSTALL_PREFIX:PATH="
make DESTDIR="build/release/nvim-linux64" install
cd build/
cpack -C RelWithDebInfo
#include <stdio.h>
int fib(int n) {
switch (n) {
case 0:
return 0;
break;
case 1:
return 1;
#!/bin/bash
LOGFILE=/var/log/autoupdate.log
echo "==> Starting system update at `date +'%d/%m/%y %T'`" >>$LOGFILE
/usr/bin/mintupdate-cli upgrade --refresh-cache --yes >> $LOGFILE 2>&1
# UPDATE_SCRIPT=/usr/local/bin/autoupdate
# @hourly $UPDATE_SCRIPT
@dcampos
dcampos / autoupdate.sh
Last active January 31, 2021 14:23
Linux mint auto update
#!/bin/bash
LOGFILE=/var/log/autoupdate.log
echo "==> Starting system update at `date +'%d/%m/%y %T'`" >>$LOGFILE
/usr/bin/mintupdate-cli upgrade --refresh-cache --yes >> $LOGFILE 2>&1
@dcampos
dcampos / README.md
Last active June 19, 2025 01:48 — forked from AidasK/README.md
Automatic update of CloudFlare IP addresses in nginx

This script is a copy of https://marekbosman.com/site/automatic-update-of-cloudflare-ip-addresses-in-nginx/

How to use?

wget https://gist.githubusercontent.com/AidasK/27aa5d6f918eca12d95427178b5aaa59/raw/e3ce185de43d89c237e081d3f56e5a79024b4115/cloudflare-update-ip-ranges.sh -P /usr/local/bin/
chmod +x /usr/local/bin/cloudflare-update-ip-ranges.sh

add include /etc/nginx/cloudflare; this line to /etc/nginx/nginx.conf (above include /etc/nginx/conf.d/*.conf;)

VteTerminal, vte-terminal {
padding: 3px;
}
call fzf#run(fzf#wrap({'source': map(split(&rtp, ','), "v:val . '/snippets/' . &ft . '.snippets'"), 'options': '-m', 'sink': 'sp'}))