Skip to content

Instantly share code, notes, and snippets.

View TheZoc's full-sized avatar

Felipe Guedes TheZoc

  • London, United Kingdom
  • X @zoc
View GitHub Profile
@TheZoc
TheZoc / Setting up guide for ArchLinux on Raspberry Pi.md
Last active May 3, 2024 23:08
This is a guide to setup Arch Linux in Raspberry Pi 4, using macOS as the auxiliary system.

Raspberry Pi Setup Guide

This guide will use either a macOS or an ArchLinux base system, to prepare a microSD card with Arch Linux for Raspberry Pi.

If someone managed to do the initial setup using Windows, please let me know, so I can add to this guide.

This guide will be verbose at times for some simple tasks. This is intended to help people just starting out, so it's not confusing. If something confuses you, let me know and I'll try my best to answer it.

@TheZoc
TheZoc / mp3-to-m4r.bat
Created June 25, 2015 02:51
Convert a MP3 file to an Apple iPhone's ringtone file (M4R), using FFMPEG.
@echo off
rem =====================================================
rem Converts a MP3 file to a M4R file using ffmpeg.
rem Usage: Drop a MP3 file at the top of this batch file.
rem =====================================================
set ffmpeg_exe="C:\ffmpeg\ffmpeg-20150619-git-bb3703a-win64-static\bin\ffmpeg.exe"
rem %~f1 = Full File Path, with drive letter
rem %~p1 = Drive Letter
rem %~p1 = Path Only
;
; Apple Wireless Keyboard Eject Key and Function kKey remapper for Windows.
; You can get the latest version of this file at:
; https://gist.github.com/TheZoc/a913642e9bedf62ba3ef
;
;==========================================================================================================================================
; Please, if you make a significant change, fix or would like to improve this script,
; I'd really appreciate if you can contact me so we can merge both works :)
;==========================================================================================================================================
;

Archlinux + Docker + Pi Hole

This is a guideline on how to setup Pi Hole in ArchLinux.

For this, I used a Raspberry Pi 4b with 8gb ram, using aarch64 version of ArchLinux.

This can also be done using a Raspberry Pi Zero, though I haven't tested myself (yet).

References:

@TheZoc
TheZoc / sublime_text_setup.bat
Last active January 26, 2023 18:08
Sublime Text right click context menu and PATH variable setup (Windows)
@ECHO off
REM ===========================================================================
REM Sublime Text - Path and Right Click context menu
REM Felipe Guedes - https://github.com/TheZoc
REM https://gist.github.com/TheZoc/e3295df094801fa937596964499ac048
REM ---------------------------------------------------------------------------
REM I've swapped my environment so many times recently, that I decided to write
REM this overengineered solution to add Sublime Text 3 to the right click menu
REM on Windows, and to add it to the current user PATH environment variable
REM allowing `subl.exe` to be easily usable from command line.
;
; AutoHotkey "Raw Input" listing and capture
; You can get the latest version of this file at:
; https://gist.github.com/TheZoc/4bf163aa9a9922b21fbf
;
;==========================================================================================================================================
; Please, if you make a significant change, fix or would like to improve this script,
; I'd really appreciate if you can contact me so we can merge both works :)
;==========================================================================================================================================
;
@TheZoc
TheZoc / setup.bat
Last active March 25, 2020 18:34
Automatic python virtual environment setup for Windows
rem ===============================================================
rem Automatic python virutal environment setup for Windows
rem Felipe "Zoc" Silveira - Apr 2019
rem ---------------------------------------------------------------
rem https://gist.github.com/TheZoc/fa690df3ec4cca7a992fe49b97c47cac
rem ===============================================================
@echo off
rem Check if we already have a venv folder. If so, stop and exit
@TheZoc
TheZoc / snippet.cpp
Last active January 22, 2020 11:12
Q_PROPERTY with functions (Qt Creator Snippet)
Q_PROPERTY($type$ $name$ READ $name:c$ WRITE Set$name:c$ NOTIFY $name$Changed)
$type$ $private_variable$_;
$type$ $name:c$() const { return $private_variable$_; }
void Set$name:c$(const $type$& $private_variable$)
{
if ($private_variable$_ == $private_variable$)
return;
@TheZoc
TheZoc / contrast-snippet.qml
Created November 26, 2019 11:16
Qt QML High Contrast functions
// I wrote those for a dialog in QML that needed to keep high contrast while the background color could be customized
// by the user. I"m keeping it here in case I need it in the future :)
/**
* Calculates the relative luminance of given color
* Reference: https://www.w3.org/TR/WCAG20/#relativeluminancedef
*
* @param {color} color Color to calculate the relative luminance.
* @return Luminance, as a real between 0 and 1
*/
@TheZoc
TheZoc / crab-fix.py
Created May 24, 2018 02:23
A small script to help revert the damage caused by crab ransomware
#!/usr/bin/python3
#
# .crab file fixer
# This small script was created to help a friend who got attacked by a ransomware
# I hope this helps someone else out there :)
#
import os
from glob import glob