Skip to content

Instantly share code, notes, and snippets.

View wdog's full-sized avatar
🎯
Focusing

wdog wdog

🎯
Focusing
View GitHub Profile
@wdog
wdog / PageTemplates_Faq.php
Created November 29, 2024 10:13 — forked from pxlrbt/PageTemplates_Faq.php
Filament Template
<?php
namespace App\Filament\PageTemplates;
use Filament\Forms\Components\Repeater;
use Filament\Forms\Components\RichEditor;
use Filament\Forms\Components\TextInput;
final class Faq
{
@wdog
wdog / songChange.py
Last active November 8, 2020 11:09
Simple script for notify-send on song change for mocp player
#!/usr/bin/env python3
import os
import argparse
import stagger
def notify(song, album, artist, icon='music'):
command = f'''
notify-send -i "{icon}" "🎵 {song}" "<i>📀 {album}</i>\n<b>👄 {artist}</b>"
@wdog
wdog / .dunstrc
Last active July 3, 2022 23:57
Simple configuration for dunst notification
# <- this tricks vim into using syntax highlighting
[global]
# font = Tewi 8
font = "FontAwesome, Noto Sans 11"
icon_path = /usr/share/icons/Faenza/status/16/:/usr/share/icons/Faenza/devices/16/
markup = yes
# The format of the message. Possible variables are:
# %a appname
# %s summary
@wdog
wdog / vlan.sh
Last active January 16, 2020 10:19
Simple script for vlan
#!/bin/bash
DEFADPATER=eno1
DEFVLAN=300
DEFNET=10.137.1.2
RED='\033[0;31m'
GREEN='\033[0;32m'
INFO='\033[0;36m'

Installing Debian on btrfs subvolume

Install debian as usual:

  • EFI partition ~256M, boot, esp flags
  • ext2 boot partition ~512M
  • luks cyrpt volume
    • LVM pv
      • swap ~5G
      • btrfs

When the installation is finished, boot into SystemRescueCD.

@wdog
wdog / sensors.ino
Created March 8, 2019 22:28
LCD 1602 w/ BMP280 + MQ7 + RTC
#include <Wire.h>
#include "RTClib.h"
RTC_DS1307 RTC;
#include <LiquidCrystal_I2C.h>
#include <SPI.h>
#include <Adafruit_Sensor.h>
#include <Adafruit_BMP280.h>
@wdog
wdog / arduino_waper_pump
Created October 20, 2018 12:28
arduino nano moist sensor temperature humidity waper pump
#include <Wire.h>
#include <LiquidCrystal_PCF8574.h>
#include "DHT.h"
#define DHTPIN 11
#define DHTTYPE DHT11 // DHT 11
DHT dht(DHTPIN, DHTTYPE);
#define MOISTPIN 6
int sensorvalue = 0;
@wdog
wdog / i3block_spotify
Created October 9, 2018 09:34
i3block for spotify
#!/usr/bin/python3
import dbus
import os
import sys
STATUS_TO_ICON = {
'Playing': '',
'Paused': '',
'Stopped': '',
@wdog
wdog / iban.php
Created March 16, 2018 13:07
IBAN TO PARTS - ITALY
<?php
function iban_get_parts( $iban )
{
return [
'country' => substr( $iban, 0, 2 ),
'checksum' => substr( $iban, 2, 2 ),
'checksum_national' => substr( $iban, 4, 1 ),
'abi' => substr( $iban, 5, 5 ),
'cab' => substr( $iban, 10, 5 ),
@wdog
wdog / bash_prompt.sh
Created September 13, 2017 14:20
wdog bash prompt
#!/bin/sh
function fy(){
echo $(/bin/ls -lah | /bin/grep -m 1 total | /bin/sed 's/total //')
}
function fx(){
echo $(/bin/ls -1 | /usr/bin/wc -l | /bin/sed 's: ::g')
}