Skip to content

Instantly share code, notes, and snippets.

#!/usr/bin/env bash
#Bypass any and all “Are you sure?” messages from pacman.
NOCONFIRM=1
#Install reflector (https://www.archlinux.org/packages/?name=reflector) ,
#To update mirrorlist and set REFLECTOR_ENABLE=1
REFLECTOR_ENABLE=0
REFLECTOR_COUNTRY="United States"
@mozlima
mozlima / rc.powersave
Created January 1, 2021 20:40 — forked from gdamjan/rc.powersave
a script to enable powersaving options
#!/bin/sh
# A script to enable laptop power saving features for #! & Debian GNU+linux.
# http://crunchbanglinux.org/forums/topic/11954
# List of modules to unload, space seperated. Edit depending on your hardware and preferences.
modlist="nsc_ircc uhci_hcd"
# Bus list for runtime pm. Probably shouldn't touch this.
buslist="pci i2c"
case "$1" in
@mozlima
mozlima / stb.c
Created January 28, 2022 12:43 — forked from urraka/stb.c
#define STB_IMAGE_IMPLEMENTATION
#define STB_IMAGE_WRITE_IMPLEMENTATION
#define STBI_ONLY_PNG
#define STBI_ONLY_JPEG
#define STBI_ONLY_BMP
#define STBI_ONLY_GIF
#include "stb_image.h"
#include "stb_image_write.h"
@mozlima
mozlima / relayd-igmpproxy.sh
Created August 5, 2022 18:17 — forked from braian87b/relayd-igmpproxy.sh
How to setup Client Bridged / Client Mode / RelayD and IGMPProxy for OpenWRT / LEDE
# Client Bridged / Client Mode / RelayD and IGMPProxy (It works)
# RelayD is to redirect packages and IGMP is for redirect IGMP packages
# Our network is 192.168.1.0/24
# Steps:
# Configure WAN as static
# We should edit our wan iface and put static IP
uci set network.wan='interface'
uci set network.wan.proto='static'
uci set network.wan.ipaddr='192.168.1.239' # Main Network IP
@mozlima
mozlima / dumb-ap-wired-link.sh
Created August 5, 2022 18:17 — forked from braian87b/dumb-ap-wired-link.sh
How to setup a Dumb AP, Wired backbone for OpenWRT / LEDE
@mozlima
mozlima / wireless-link-wds.sh
Created August 5, 2022 18:20 — forked from braian87b/wireless-link-wds.sh
How to setup Wireless Links to avoid Wired backbone using WDS on Atheros for OpenWRT / LEDE
@mozlima
mozlima / duperemove-weekly@.timer
Created August 9, 2023 18:10 — forked from Arano-kai/duperemove-weekly@.timer
SystemD service and timer templates for duperemove.
[Unit]
# Usage: systemctl enable --now duperemove-weekly@$(systemd-escape <path>).timer
# Utilize %J specifier for duration set.
# One can hardlink/copy with 'weekly' part changed
# to set other duration.
Description=Deduplicate %I at calendar event (%J)
After=local-fs.target
Requires=local-fs.target
Conflicts=shutdown.target rescue.target rescue.service emergency.service
@mozlima
mozlima / aes.go
Created September 16, 2023 17:40 — forked from enyachoke/aes.go
simple AES encryption/decryption example with PBKDF2 key derivation in Go, Javascript, and Python
package main
import (
"crypto/aes"
"crypto/cipher"
"crypto/rand"
"crypto/sha256"
"encoding/hex"
"fmt"
"strings"
@mozlima
mozlima / aes_cbc_pkcs5.go
Created September 16, 2023 23:42 — forked from hothero/aes_cbc_pkcs5.go
AES/CBC/PKCS5Padding implementation by Golang (can work with JAVA, C#, etc.)
package main
import (
"bytes"
"crypto/aes"
"crypto/cipher"
"encoding/base64"
"fmt"
)